package aws

  1. Overview
  2. Docs

All AWS api operations should have type Call. Runtime implementation should take as input modules of type Call.

type input

The native OCaml datatype input to the Call.

type output

The native OCaml datatype that is produced as output to a successful Call.

type error

The native OCaml error type. This is shared between all calls for a single API.

val service : string

The AWS service, for example, 'ec2'. This is used for request signing, and to determine the endpoint to send the request.

val to_http : input -> Request.t

This function converts the native input into the HTTP request type. In particular, it is responsible for properly encoding the request type into query format. It also sets the Action and Version query parameters.

val of_http : string -> [ `Ok of output | `Error of error Error.error_response ]

This function converts from a HTTP response body to an output or an error if the response could not be decoded.

val parse_error : int -> string -> error option

This function parses an AWS error (which has been successfully deserialized from XML) into an API specific native error that could have been triggered by this call. It should fail to parse if the error it is given is not one of those listen in the specification, or if the passed HTTP status code does not match the specified one.

OCaml

Innovation. Community. Security.