diff --git a/.gitignore b/.gitignore index f26a8b942..9d8c0dca3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ libraries/**/*.install lib/**/.merlin .envrc **/.merlin +.idea diff --git a/Makefile b/Makefile index 4ca8596d4..5d4fe4f80 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,11 @@ clean: update-version: scripts/update-version +.PHONY: endpoints + +endpoints: + dune exec endpoint-gen -- -i input/endpoints.json -o lib + aws-ec2: dune exec aws-gen -- --is-ec2 -i input/ec2/latest/service-2.json -r input/ec2/overrides.json -e input/errors.json -o libraries @@ -35,6 +40,7 @@ LIBRARIES := \ aws-sts \ aws-s3 \ aws-route53 \ + aws-sqs \ .PHONY: $(LIBRARIES) $(LIBRARIES): aws-%: diff --git a/async/runtime.ml b/async/runtime.ml index b6cf00f17..ea2c19a2d 100644 --- a/async/runtime.ml +++ b/async/runtime.ml @@ -49,7 +49,7 @@ let run_request (inp : M.input) = let meth, uri, headers = - Aws.Signing.sign_request ~access_key ~secret_key ~service:M.service ~region (M.to_http inp) + Aws.Signing.sign_request ~access_key ~secret_key ~service:M.service ~region (M.to_http M.service region inp) in let headers = Header.of_list headers in try_with begin fun () -> diff --git a/aws-async.opam b/aws-async.opam index 7e4557336..d96b0a49f 100644 --- a/aws-async.opam +++ b/aws-async.opam @@ -1,7 +1,8 @@ opam-version: "2.0" -maintainer: "Spiros Eliopoulos " +maintainer: "Tim McGilchrist " authors: [ "Spiros Eliopoulos " - "Daniel Patterson " ] + "Daniel Patterson " + "Tim McGilchrist "] synopsis: "Amazon Web Services SDK bindings for async" description: "Amazon Web Services SDK bindings for async" license: "BSD-3-clause" diff --git a/aws-gen.opam b/aws-gen.opam index d626f87bb..59afeb66b 100644 --- a/aws-gen.opam +++ b/aws-gen.opam @@ -1,7 +1,9 @@ opam-version: "2.0" -maintainer: "Spiros Eliopoulos " +maintainer: "Tim McGilchrist " authors: [ "Spiros Eliopoulos " - "Daniel Patterson " ] + "Daniel Patterson " + "Tim McGilchrist " + ] synopsis: "Amazon Web Services code generator" description: "Amazon Web Services code generator - Builds OCaml bindings for AWS using botocore API definition" license: "BSD-3-clause" @@ -13,6 +15,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ + "atdgen" "yojson" "base-unix" "cmdliner" diff --git a/aws-lwt.opam b/aws-lwt.opam index 4e9cd5001..8c68d4309 100644 --- a/aws-lwt.opam +++ b/aws-lwt.opam @@ -1,7 +1,8 @@ opam-version: "2.0" -maintainer: "Spiros Eliopoulos " +maintainer: "Tim McGilchrist " authors: [ "Spiros Eliopoulos " - "Daniel Patterson " ] + "Daniel Patterson " + "Tim McGilchrist "] synopsis: "Amazon Web Services SDK bindings for lwt" description: "Amazon Web Services SDK bindings for lwt" license: "BSD-3-clause" diff --git a/aws.opam b/aws.opam index 7973c5808..bd8b2b080 100644 --- a/aws.opam +++ b/aws.opam @@ -1,7 +1,8 @@ opam-version: "2.0" -maintainer: "Spiros Eliopoulos " +maintainer: "Tim McGilchrist " authors: [ "Spiros Eliopoulos " - "Daniel Patterson " ] + "Daniel Patterson " + "Tim McGilchrist "] synopsis: "Amazon Web Services SDK" description: """ Amazon Web Services SDK diff --git a/aws_sqs.opam b/aws_sqs.opam new file mode 100644 index 000000000..d82b38688 --- /dev/null +++ b/aws_sqs.opam @@ -0,0 +1,22 @@ +opam-version: "2.0" +maintainer: "Tim McGilchrist " +authors: [ "Spiros Eliopoulos " + "Daniel Patterson " + "Tim McGilchrist " + ] +synopsis: "Amazon Web Services SDK bindings to Amazon Simple Queue Service" +description: "Amazon Web Services SDK bindings to Amazon Simple Queue Service" +version: "1.1" +license: "BSD-3-clause" +homepage: "https://github.com/inhabitedtype/ocaml-aws" +dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git" +bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues" +doc: "https://github.com/inhabitedtype/ocaml-aws" +build: [ + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] +] +depends: [ + "aws" {>= "0.1.0"} + "dune" {build} +] diff --git a/input/endpoints.json b/input/endpoints.json new file mode 100644 index 000000000..ead5f1bc1 --- /dev/null +++ b/input/endpoints.json @@ -0,0 +1,3797 @@ +{ + "partitions" : [ { + "defaults" : { + "hostname" : "{service}.{region}.{dnsSuffix}", + "protocols" : [ "https" ], + "signatureVersions" : [ "v4" ] + }, + "dnsSuffix" : "amazonaws.com", + "partition" : "aws", + "partitionName" : "AWS Standard", + "regionRegex" : "^(us|eu|ap|sa|ca)\\-\\w+\\-\\d+$", + "regions" : { + "ap-northeast-1" : { + "description" : "Asia Pacific (Tokyo)" + }, + "ap-northeast-2" : { + "description" : "Asia Pacific (Seoul)" + }, + "ap-south-1" : { + "description" : "Asia Pacific (Mumbai)" + }, + "ap-southeast-1" : { + "description" : "Asia Pacific (Singapore)" + }, + "ap-southeast-2" : { + "description" : "Asia Pacific (Sydney)" + }, + "ca-central-1" : { + "description" : "Canada (Central)" + }, + "eu-central-1" : { + "description" : "EU (Frankfurt)" + }, + "eu-north-1" : { + "description" : "EU (Stockholm)" + }, + "eu-west-1" : { + "description" : "EU (Ireland)" + }, + "eu-west-2" : { + "description" : "EU (London)" + }, + "eu-west-3" : { + "description" : "EU (Paris)" + }, + "sa-east-1" : { + "description" : "South America (Sao Paulo)" + }, + "us-east-1" : { + "description" : "US East (N. Virginia)" + }, + "us-east-2" : { + "description" : "US East (Ohio)" + }, + "us-west-1" : { + "description" : "US West (N. California)" + }, + "us-west-2" : { + "description" : "US West (Oregon)" + } + }, + "services" : { + "a4b" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "acm" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "acm-pca" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "api.ecr" : { + "endpoints" : { + "ap-northeast-1" : { + "credentialScope" : { + "region" : "ap-northeast-1" + }, + "hostname" : "api.ecr.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2" : { + "credentialScope" : { + "region" : "ap-northeast-2" + }, + "hostname" : "api.ecr.ap-northeast-2.amazonaws.com" + }, + "ap-south-1" : { + "credentialScope" : { + "region" : "ap-south-1" + }, + "hostname" : "api.ecr.ap-south-1.amazonaws.com" + }, + "ap-southeast-1" : { + "credentialScope" : { + "region" : "ap-southeast-1" + }, + "hostname" : "api.ecr.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2" : { + "credentialScope" : { + "region" : "ap-southeast-2" + }, + "hostname" : "api.ecr.ap-southeast-2.amazonaws.com" + }, + "ca-central-1" : { + "credentialScope" : { + "region" : "ca-central-1" + }, + "hostname" : "api.ecr.ca-central-1.amazonaws.com" + }, + "eu-central-1" : { + "credentialScope" : { + "region" : "eu-central-1" + }, + "hostname" : "api.ecr.eu-central-1.amazonaws.com" + }, + "eu-north-1" : { + "credentialScope" : { + "region" : "eu-north-1" + }, + "hostname" : "api.ecr.eu-north-1.amazonaws.com" + }, + "eu-west-1" : { + "credentialScope" : { + "region" : "eu-west-1" + }, + "hostname" : "api.ecr.eu-west-1.amazonaws.com" + }, + "eu-west-2" : { + "credentialScope" : { + "region" : "eu-west-2" + }, + "hostname" : "api.ecr.eu-west-2.amazonaws.com" + }, + "eu-west-3" : { + "credentialScope" : { + "region" : "eu-west-3" + }, + "hostname" : "api.ecr.eu-west-3.amazonaws.com" + }, + "sa-east-1" : { + "credentialScope" : { + "region" : "sa-east-1" + }, + "hostname" : "api.ecr.sa-east-1.amazonaws.com" + }, + "us-east-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "api.ecr.us-east-1.amazonaws.com" + }, + "us-east-2" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "api.ecr.us-east-2.amazonaws.com" + }, + "us-west-1" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "api.ecr.us-west-1.amazonaws.com" + }, + "us-west-2" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "api.ecr.us-west-2.amazonaws.com" + } + } + }, + "api.mediatailor" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "api.pricing" : { + "defaults" : { + "credentialScope" : { + "service" : "pricing" + } + }, + "endpoints" : { + "ap-south-1" : { }, + "us-east-1" : { } + } + }, + "api.sagemaker" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "api-fips.sagemaker.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "api-fips.sagemaker.us-east-2.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "api-fips.sagemaker.us-west-1.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "api-fips.sagemaker.us-west-2.amazonaws.com" + } + } + }, + "apigateway" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "application-autoscaling" : { + "defaults" : { + "credentialScope" : { + "service" : "application-autoscaling" + }, + "hostname" : "autoscaling.{region}.amazonaws.com", + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "appstream2" : { + "defaults" : { + "credentialScope" : { + "service" : "appstream" + }, + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "appsync" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "athena" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "autoscaling" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "autoscaling-plans" : { + "defaults" : { + "credentialScope" : { + "service" : "autoscaling-plans" + }, + "hostname" : "autoscaling.{region}.amazonaws.com", + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "batch" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "budgets" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "budgets.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "ce" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "ce.us-east-1.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "chime" : { + "defaults" : { + "protocols" : [ "https" ], + "sslCommonName" : "service.chime.aws.amazon.com" + }, + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "service.chime.aws.amazon.com", + "protocols" : [ "https" ] + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "cloud9" : { + "endpoints" : { + "ap-southeast-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "clouddirectory" : { + "endpoints" : { + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "cloudformation" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "cloudfront" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "cloudfront.amazonaws.com", + "protocols" : [ "http", "https" ] + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "cloudhsm" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "cloudhsmv2" : { + "defaults" : { + "credentialScope" : { + "service" : "cloudhsm" + } + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "cloudsearch" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "cloudtrail" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "codebuild" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "codebuild-fips.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "codebuild-fips.us-east-2.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "codebuild-fips.us-west-1.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "codebuild-fips.us-west-2.amazonaws.com" + } + } + }, + "codecommit" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "fips" : { + "credentialScope" : { + "region" : "ca-central-1" + }, + "hostname" : "codecommit-fips.ca-central-1.amazonaws.com" + }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "codedeploy" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "codedeploy-fips.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "codedeploy-fips.us-east-2.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "codedeploy-fips.us-west-1.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "codedeploy-fips.us-west-2.amazonaws.com" + } + } + }, + "codepipeline" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "codestar" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "cognito-identity" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "cognito-idp" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "cognito-sync" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "comprehend" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "config" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "cur" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "data.iot" : { + "defaults" : { + "credentialScope" : { + "service" : "iotdata" + }, + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "datapipeline" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "datasync" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "dax" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "devicefarm" : { + "endpoints" : { + "us-west-2" : { } + } + }, + "directconnect" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "discovery" : { + "endpoints" : { + "us-west-2" : { } + } + }, + "dms" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "docdb" : { + "endpoints" : { + "eu-west-1" : { + "credentialScope" : { + "region" : "eu-west-1" + }, + "hostname" : "rds.eu-west-1.amazonaws.com" + }, + "us-east-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "rds.us-east-1.amazonaws.com" + }, + "us-east-2" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "rds.us-east-2.amazonaws.com" + }, + "us-west-2" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "rds.us-west-2.amazonaws.com" + } + } + }, + "ds" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "dynamodb" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "local" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "localhost:8000", + "protocols" : [ "http" ] + }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "ec2" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "ecs" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elasticache" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "elasticache-fips.us-west-1.amazonaws.com" + }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elasticbeanstalk" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elasticfilesystem" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elasticloadbalancing" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elasticmapreduce" : { + "defaults" : { + "protocols" : [ "https" ], + "sslCommonName" : "{region}.{service}.{dnsSuffix}" + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { + "sslCommonName" : "{service}.{region}.{dnsSuffix}" + }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { + "sslCommonName" : "{service}.{region}.{dnsSuffix}" + }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "elastictranscoder" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "email" : { + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "entitlement.marketplace" : { + "defaults" : { + "credentialScope" : { + "service" : "aws-marketplace" + } + }, + "endpoints" : { + "us-east-1" : { } + } + }, + "es" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "es-fips.us-west-1.amazonaws.com" + }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "events" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "firehose" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "fms" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "fsx" : { + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "gamelift" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "glacier" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "glue" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "greengrass" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + }, + "isRegionalized" : true + }, + "guardduty" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + }, + "isRegionalized" : true + }, + "health" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "iam" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "iam.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "importexport" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1", + "service" : "IngestionService" + }, + "hostname" : "importexport.amazonaws.com", + "signatureVersions" : [ "v2", "v4" ] + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "inspector" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "iot" : { + "defaults" : { + "credentialScope" : { + "service" : "execute-api" + } + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "iotanalytics" : { + "endpoints" : { + "ap-northeast-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "kinesis" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "kinesisanalytics" : { + "endpoints" : { + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "kinesisvideo" : { + "endpoints" : { + "ap-northeast-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "kms" : { + "endpoints" : { + "ProdFips" : { + "credentialScope" : { + "region" : "ca-central-1" + }, + "hostname" : "kms-fips.ca-central-1.amazonaws.com" + }, + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "lambda" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "license-manager" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "lightsail" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "logs" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "machinelearning" : { + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { } + } + }, + "marketplacecommerceanalytics" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "mediaconvert" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "medialive" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "mediapackage" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "mediastore" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "metering.marketplace" : { + "defaults" : { + "credentialScope" : { + "service" : "aws-marketplace" + } + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "mgh" : { + "endpoints" : { + "us-west-2" : { } + } + }, + "mobileanalytics" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "models.lex" : { + "defaults" : { + "credentialScope" : { + "service" : "lex" + } + }, + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "monitoring" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "mq" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "mturk-requester" : { + "endpoints" : { + "sandbox" : { + "hostname" : "mturk-requester-sandbox.us-east-1.amazonaws.com" + }, + "us-east-1" : { } + }, + "isRegionalized" : false + }, + "neptune" : { + "endpoints" : { + "ap-northeast-1" : { + "credentialScope" : { + "region" : "ap-northeast-1" + }, + "hostname" : "rds.ap-northeast-1.amazonaws.com" + }, + "ap-southeast-1" : { + "credentialScope" : { + "region" : "ap-southeast-1" + }, + "hostname" : "rds.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2" : { + "credentialScope" : { + "region" : "ap-southeast-2" + }, + "hostname" : "rds.ap-southeast-2.amazonaws.com" + }, + "eu-central-1" : { + "credentialScope" : { + "region" : "eu-central-1" + }, + "hostname" : "rds.eu-central-1.amazonaws.com" + }, + "eu-west-1" : { + "credentialScope" : { + "region" : "eu-west-1" + }, + "hostname" : "rds.eu-west-1.amazonaws.com" + }, + "eu-west-2" : { + "credentialScope" : { + "region" : "eu-west-2" + }, + "hostname" : "rds.eu-west-2.amazonaws.com" + }, + "us-east-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "rds.us-east-1.amazonaws.com" + }, + "us-east-2" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "rds.us-east-2.amazonaws.com" + }, + "us-west-2" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "rds.us-west-2.amazonaws.com" + } + } + }, + "opsworks" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "opsworks-cm" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "organizations" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "organizations.us-east-1.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "pinpoint" : { + "defaults" : { + "credentialScope" : { + "service" : "mobiletargeting" + } + }, + "endpoints" : { + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "polly" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "rds" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { + "sslCommonName" : "{service}.{dnsSuffix}" + }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "redshift" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "rekognition" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-2" : { } + } + }, + "resource-groups" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "robomaker" : { + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "route53" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "route53.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "route53domains" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "route53resolver" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "runtime.lex" : { + "defaults" : { + "credentialScope" : { + "service" : "lex" + } + }, + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "runtime.sagemaker" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "s3" : { + "defaults" : { + "protocols" : [ "http", "https" ], + "signatureVersions" : [ "s3v4" ] + }, + "endpoints" : { + "ap-northeast-1" : { + "hostname" : "s3.ap-northeast-1.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { + "hostname" : "s3.ap-southeast-1.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "ap-southeast-2" : { + "hostname" : "s3.ap-southeast-2.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { + "hostname" : "s3.eu-west-1.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "s3-external-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "s3-external-1.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "sa-east-1" : { + "hostname" : "s3.sa-east-1.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "us-east-1" : { + "hostname" : "s3.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "us-east-2" : { }, + "us-west-1" : { + "hostname" : "s3.us-west-1.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + }, + "us-west-2" : { + "hostname" : "s3.us-west-2.amazonaws.com", + "signatureVersions" : [ "s3", "s3v4" ] + } + }, + "isRegionalized" : true, + "partitionEndpoint" : "us-east-1" + }, + "s3-control" : { + "defaults" : { + "protocols" : [ "https" ], + "signatureVersions" : [ "s3v4" ] + }, + "endpoints" : { + "ap-northeast-1" : { + "credentialScope" : { + "region" : "ap-northeast-1" + }, + "hostname" : "s3-control.ap-northeast-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "ap-northeast-2" : { + "credentialScope" : { + "region" : "ap-northeast-2" + }, + "hostname" : "s3-control.ap-northeast-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "ap-south-1" : { + "credentialScope" : { + "region" : "ap-south-1" + }, + "hostname" : "s3-control.ap-south-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "ap-southeast-1" : { + "credentialScope" : { + "region" : "ap-southeast-1" + }, + "hostname" : "s3-control.ap-southeast-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "ap-southeast-2" : { + "credentialScope" : { + "region" : "ap-southeast-2" + }, + "hostname" : "s3-control.ap-southeast-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "ca-central-1" : { + "credentialScope" : { + "region" : "ca-central-1" + }, + "hostname" : "s3-control.ca-central-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "eu-central-1" : { + "credentialScope" : { + "region" : "eu-central-1" + }, + "hostname" : "s3-control.eu-central-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "eu-north-1" : { + "credentialScope" : { + "region" : "eu-north-1" + }, + "hostname" : "s3-control.eu-north-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "eu-west-1" : { + "credentialScope" : { + "region" : "eu-west-1" + }, + "hostname" : "s3-control.eu-west-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "eu-west-2" : { + "credentialScope" : { + "region" : "eu-west-2" + }, + "hostname" : "s3-control.eu-west-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "eu-west-3" : { + "credentialScope" : { + "region" : "eu-west-3" + }, + "hostname" : "s3-control.eu-west-3.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "sa-east-1" : { + "credentialScope" : { + "region" : "sa-east-1" + }, + "hostname" : "s3-control.sa-east-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-east-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "s3-control.us-east-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "s3-control-fips.us-east-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-east-2" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "s3-control.us-east-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "s3-control-fips.us-east-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-west-1" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "s3-control.us-west-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "s3-control-fips.us-west-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-west-2" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "s3-control.us-west-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "s3-control-fips.us-west-2.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + } + } + }, + "sdb" : { + "defaults" : { + "protocols" : [ "http", "https" ], + "signatureVersions" : [ "v2" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "sa-east-1" : { }, + "us-east-1" : { + "hostname" : "sdb.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "secretsmanager" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "secretsmanager-fips.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "secretsmanager-fips.us-east-2.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "secretsmanager-fips.us-west-1.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "secretsmanager-fips.us-west-2.amazonaws.com" + } + } + }, + "securityhub" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "serverlessrepo" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { + "protocols" : [ "https" ] + }, + "ap-northeast-2" : { + "protocols" : [ "https" ] + }, + "ap-south-1" : { + "protocols" : [ "https" ] + }, + "ap-southeast-1" : { + "protocols" : [ "https" ] + }, + "ap-southeast-2" : { + "protocols" : [ "https" ] + }, + "ca-central-1" : { + "protocols" : [ "https" ] + }, + "eu-central-1" : { + "protocols" : [ "https" ] + }, + "eu-west-1" : { + "protocols" : [ "https" ] + }, + "eu-west-2" : { + "protocols" : [ "https" ] + }, + "sa-east-1" : { + "protocols" : [ "https" ] + }, + "us-east-1" : { + "protocols" : [ "https" ] + }, + "us-east-2" : { + "protocols" : [ "https" ] + }, + "us-west-1" : { + "protocols" : [ "https" ] + }, + "us-west-2" : { + "protocols" : [ "https" ] + } + } + }, + "servicecatalog" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "servicecatalog-fips.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "servicecatalog-fips.us-east-2.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "servicecatalog-fips.us-west-1.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "servicecatalog-fips.us-west-2.amazonaws.com" + } + } + }, + "servicediscovery" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "shield" : { + "defaults" : { + "protocols" : [ "https" ], + "sslCommonName" : "shield.us-east-1.amazonaws.com" + }, + "endpoints" : { + "us-east-1" : { } + }, + "isRegionalized" : false + }, + "sms" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "snowball" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "sns" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "sqs" : { + "defaults" : { + "protocols" : [ "http", "https" ], + "sslCommonName" : "{region}.queue.{dnsSuffix}" + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "fips-us-east-1" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "sqs-fips.us-east-1.amazonaws.com" + }, + "fips-us-east-2" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "sqs-fips.us-east-2.amazonaws.com" + }, + "fips-us-west-1" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "sqs-fips.us-west-1.amazonaws.com" + }, + "fips-us-west-2" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "sqs-fips.us-west-2.amazonaws.com" + }, + "sa-east-1" : { }, + "us-east-1" : { + "sslCommonName" : "queue.{dnsSuffix}" + }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "ssm" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "states" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "storagegateway" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "streams.dynamodb" : { + "defaults" : { + "credentialScope" : { + "service" : "dynamodb" + }, + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "local" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "localhost:8000", + "protocols" : [ "http" ] + }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "sts" : { + "defaults" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "sts.amazonaws.com" + }, + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { + "credentialScope" : { + "region" : "ap-northeast-2" + }, + "hostname" : "sts.ap-northeast-2.amazonaws.com" + }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "aws-global" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "sts-fips.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "sts-fips.us-east-2.amazonaws.com" + }, + "us-west-1" : { }, + "us-west-1-fips" : { + "credentialScope" : { + "region" : "us-west-1" + }, + "hostname" : "sts-fips.us-west-1.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "sts-fips.us-west-2.amazonaws.com" + } + }, + "partitionEndpoint" : "aws-global" + }, + "support" : { + "endpoints" : { + "us-east-1" : { } + } + }, + "swf" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "tagging" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "transfer" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "translate" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-1-fips" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "translate-fips.us-east-1.amazonaws.com" + }, + "us-east-2" : { }, + "us-east-2-fips" : { + "credentialScope" : { + "region" : "us-east-2" + }, + "hostname" : "translate-fips.us-east-2.amazonaws.com" + }, + "us-west-2" : { }, + "us-west-2-fips" : { + "credentialScope" : { + "region" : "us-west-2" + }, + "hostname" : "translate-fips.us-west-2.amazonaws.com" + } + } + }, + "waf" : { + "endpoints" : { + "aws-global" : { + "credentialScope" : { + "region" : "us-east-1" + }, + "hostname" : "waf.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-global" + }, + "waf-regional" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-2" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + }, + "workdocs" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "workmail" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "eu-west-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "workspaces" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-west-2" : { } + } + }, + "xray" : { + "endpoints" : { + "ap-northeast-1" : { }, + "ap-northeast-2" : { }, + "ap-south-1" : { }, + "ap-southeast-1" : { }, + "ap-southeast-2" : { }, + "ca-central-1" : { }, + "eu-central-1" : { }, + "eu-north-1" : { }, + "eu-west-1" : { }, + "eu-west-2" : { }, + "eu-west-3" : { }, + "sa-east-1" : { }, + "us-east-1" : { }, + "us-east-2" : { }, + "us-west-1" : { }, + "us-west-2" : { } + } + } + } + }, { + "defaults" : { + "hostname" : "{service}.{region}.{dnsSuffix}", + "protocols" : [ "https" ], + "signatureVersions" : [ "v4" ] + }, + "dnsSuffix" : "amazonaws.com.cn", + "partition" : "aws-cn", + "partitionName" : "AWS China", + "regionRegex" : "^cn\\-\\w+\\-\\d+$", + "regions" : { + "cn-north-1" : { + "description" : "China (Beijing)" + }, + "cn-northwest-1" : { + "description" : "China (Ningxia)" + } + }, + "services" : { + "api.ecr" : { + "endpoints" : { + "cn-north-1" : { + "credentialScope" : { + "region" : "cn-north-1" + }, + "hostname" : "api.ecr.cn-north-1.amazonaws.com.cn" + }, + "cn-northwest-1" : { + "credentialScope" : { + "region" : "cn-northwest-1" + }, + "hostname" : "api.ecr.cn-northwest-1.amazonaws.com.cn" + } + } + }, + "apigateway" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "application-autoscaling" : { + "defaults" : { + "credentialScope" : { + "service" : "application-autoscaling" + }, + "hostname" : "autoscaling.{region}.amazonaws.com", + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "autoscaling" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "cloudformation" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "cloudtrail" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "codebuild" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "codedeploy" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "cognito-identity" : { + "endpoints" : { + "cn-north-1" : { } + } + }, + "config" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "data.iot" : { + "defaults" : { + "credentialScope" : { + "service" : "iotdata" + }, + "protocols" : [ "https" ] + }, + "endpoints" : { + "cn-north-1" : { } + } + }, + "directconnect" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "dms" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "ds" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "dynamodb" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "ec2" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "ecs" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "elasticache" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "elasticbeanstalk" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "elasticloadbalancing" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "elasticmapreduce" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "es" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "events" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "firehose" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "gamelift" : { + "endpoints" : { + "cn-north-1" : { } + } + }, + "glacier" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "iam" : { + "endpoints" : { + "aws-cn-global" : { + "credentialScope" : { + "region" : "cn-north-1" + }, + "hostname" : "iam.cn-north-1.amazonaws.com.cn" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-cn-global" + }, + "iot" : { + "defaults" : { + "credentialScope" : { + "service" : "execute-api" + } + }, + "endpoints" : { + "cn-north-1" : { } + } + }, + "kinesis" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "lambda" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "logs" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "monitoring" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "polly" : { + "endpoints" : { + "cn-northwest-1" : { } + } + }, + "rds" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "redshift" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "s3" : { + "defaults" : { + "protocols" : [ "http", "https" ], + "signatureVersions" : [ "s3v4" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "s3-control" : { + "defaults" : { + "protocols" : [ "https" ], + "signatureVersions" : [ "s3v4" ] + }, + "endpoints" : { + "cn-north-1" : { + "credentialScope" : { + "region" : "cn-north-1" + }, + "hostname" : "s3-control.cn-north-1.amazonaws.com.cn", + "signatureVersions" : [ "s3v4" ] + }, + "cn-northwest-1" : { + "credentialScope" : { + "region" : "cn-northwest-1" + }, + "hostname" : "s3-control.cn-northwest-1.amazonaws.com.cn", + "signatureVersions" : [ "s3v4" ] + } + } + }, + "sms" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "snowball" : { + "endpoints" : { + "cn-north-1" : { } + } + }, + "sns" : { + "defaults" : { + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "sqs" : { + "defaults" : { + "protocols" : [ "http", "https" ], + "sslCommonName" : "{region}.queue.{dnsSuffix}" + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "ssm" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "states" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "storagegateway" : { + "endpoints" : { + "cn-north-1" : { } + } + }, + "streams.dynamodb" : { + "defaults" : { + "credentialScope" : { + "service" : "dynamodb" + }, + "protocols" : [ "http", "https" ] + }, + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "sts" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "swf" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + }, + "tagging" : { + "endpoints" : { + "cn-north-1" : { }, + "cn-northwest-1" : { } + } + } + } + }, { + "defaults" : { + "hostname" : "{service}.{region}.{dnsSuffix}", + "protocols" : [ "https" ], + "signatureVersions" : [ "v4" ] + }, + "dnsSuffix" : "amazonaws.com", + "partition" : "aws-us-gov", + "partitionName" : "AWS GovCloud (US)", + "regionRegex" : "^us\\-gov\\-\\w+\\-\\d+$", + "regions" : { + "us-gov-east-1" : { + "description" : "AWS GovCloud (US-East)" + }, + "us-gov-west-1" : { + "description" : "AWS GovCloud (US)" + } + }, + "services" : { + "acm" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "api.ecr" : { + "endpoints" : { + "us-gov-east-1" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "hostname" : "api.ecr.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "api.ecr.us-gov-west-1.amazonaws.com" + } + } + }, + "api.sagemaker" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "apigateway" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "application-autoscaling" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "athena" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "autoscaling" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { + "protocols" : [ "http", "https" ] + } + } + }, + "clouddirectory" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "cloudformation" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "cloudhsm" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "cloudhsmv2" : { + "defaults" : { + "credentialScope" : { + "service" : "cloudhsm" + } + }, + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "cloudtrail" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "codedeploy" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-east-1-fips" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "hostname" : "codedeploy-fips.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1" : { }, + "us-gov-west-1-fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "codedeploy-fips.us-gov-west-1.amazonaws.com" + } + } + }, + "config" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "data.iot" : { + "defaults" : { + "credentialScope" : { + "service" : "iotdata" + }, + "protocols" : [ "https" ] + }, + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "directconnect" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "dms" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "ds" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "dynamodb" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { }, + "us-gov-west-1-fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "dynamodb.us-gov-west-1.amazonaws.com" + } + } + }, + "ec2" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "ecs" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "elasticache" : { + "endpoints" : { + "fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "elasticache-fips.us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "elasticbeanstalk" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "elasticfilesystem" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "elasticloadbalancing" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { + "protocols" : [ "http", "https" ] + } + } + }, + "elasticmapreduce" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { + "protocols" : [ "https" ] + } + } + }, + "es" : { + "endpoints" : { + "fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "es-fips.us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "events" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "firehose" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "glacier" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { + "protocols" : [ "http", "https" ] + } + } + }, + "glue" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "guardduty" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "us-gov-west-1" : { } + }, + "isRegionalized" : true + }, + "iam" : { + "endpoints" : { + "aws-us-gov-global" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "iam.us-gov.amazonaws.com" + } + }, + "isRegionalized" : false, + "partitionEndpoint" : "aws-us-gov-global" + }, + "inspector" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "iot" : { + "defaults" : { + "credentialScope" : { + "service" : "execute-api" + } + }, + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "kinesis" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "kms" : { + "endpoints" : { + "ProdFips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "kms-fips.us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "lambda" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "logs" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "mediaconvert" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "metering.marketplace" : { + "defaults" : { + "credentialScope" : { + "service" : "aws-marketplace" + } + }, + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "monitoring" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "polly" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "rds" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "redshift" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "rekognition" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "runtime.sagemaker" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "s3" : { + "defaults" : { + "signatureVersions" : [ "s3", "s3v4" ] + }, + "endpoints" : { + "fips-us-gov-west-1" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "s3-fips-us-gov-west-1.amazonaws.com" + }, + "us-gov-east-1" : { + "hostname" : "s3.us-gov-east-1.amazonaws.com", + "protocols" : [ "http", "https" ] + }, + "us-gov-west-1" : { + "hostname" : "s3.us-gov-west-1.amazonaws.com", + "protocols" : [ "http", "https" ] + } + } + }, + "s3-control" : { + "defaults" : { + "protocols" : [ "https" ], + "signatureVersions" : [ "s3v4" ] + }, + "endpoints" : { + "us-gov-east-1" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "hostname" : "s3-control.us-gov-east-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-gov-east-1-fips" : { + "credentialScope" : { + "region" : "us-gov-east-1" + }, + "hostname" : "s3-control-fips.us-gov-east-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-gov-west-1" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "s3-control.us-gov-west-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + }, + "us-gov-west-1-fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "s3-control-fips.us-gov-west-1.amazonaws.com", + "signatureVersions" : [ "s3v4" ] + } + } + }, + "sms" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "snowball" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "sns" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { + "protocols" : [ "http", "https" ] + } + } + }, + "sqs" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { + "protocols" : [ "http", "https" ], + "sslCommonName" : "{region}.queue.{dnsSuffix}" + } + } + }, + "ssm" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "states" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "storagegateway" : { + "endpoints" : { + "us-gov-west-1" : { } + } + }, + "streams.dynamodb" : { + "defaults" : { + "credentialScope" : { + "service" : "dynamodb" + } + }, + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { }, + "us-gov-west-1-fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "dynamodb.us-gov-west-1.amazonaws.com" + } + } + }, + "sts" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "swf" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "tagging" : { + "endpoints" : { + "us-gov-east-1" : { }, + "us-gov-west-1" : { } + } + }, + "translate" : { + "defaults" : { + "protocols" : [ "https" ] + }, + "endpoints" : { + "us-gov-west-1" : { }, + "us-gov-west-1-fips" : { + "credentialScope" : { + "region" : "us-gov-west-1" + }, + "hostname" : "translate-fips.us-gov-west-1.amazonaws.com" + } + } + }, + "workspaces" : { + "endpoints" : { + "us-gov-west-1" : { } + } + } + } + } ], + "version" : 3 +} diff --git a/input/sqs/latest b/input/sqs/latest new file mode 120000 index 000000000..0f3e2a3d2 --- /dev/null +++ b/input/sqs/latest @@ -0,0 +1 @@ +2012-11-05/ \ No newline at end of file diff --git a/lib/aws.ml b/lib/aws.ml index 583d4eaf4..562c714df 100644 --- a/lib/aws.ml +++ b/lib/aws.ml @@ -186,7 +186,7 @@ module type Call = sig type error val service : string - val to_http : input -> Request.t + val to_http : string -> string -> input -> Request.t val of_http : string -> [`Ok of output | `Error of error Error.error_response] val parse_error : int -> string -> error option end @@ -232,9 +232,9 @@ module Query = struct let i = ref 0 in List (List.map (fun v -> i := !i + 1; Pair (string_of_int !i, to_query v)) vals) - let to_query_hashtbl to_query tbl = + let to_query_hashtbl key_to_str to_query tbl = List (Hashtbl.fold - (fun k v acc -> (Pair (k, to_query v)) :: acc) tbl []) + (fun k v acc -> (Pair (key_to_str k, to_query v)) :: acc) tbl []) end @@ -254,14 +254,14 @@ module Json = struct | `List l -> List.map f l | t -> raise (Casting_error("list", t)) - let to_hashtbl f = function + let to_hashtbl key_f f = function | `Assoc m -> List.fold_left - (fun acc (k,v) -> Hashtbl.add acc k (f v); acc) + (fun acc (k,v) -> Hashtbl.add acc (key_f k) (f v); acc) (Hashtbl.create (List.length m)) m | t -> raise (Casting_error("map", t)) - + let lookup t s = try match t with | `Assoc l -> Some (List.assoc s l) @@ -279,6 +279,8 @@ module BaseTypes = struct val of_json : Json.t -> t val to_query : t -> Query.t val parse : Ezxmlm.nodes -> t option + val to_string : t -> string + val of_string : string -> t end module Unit = struct @@ -291,6 +293,8 @@ module BaseTypes = struct let to_query () = List [] let parse _ = Some () (* XXX(seliopou): Should never be used, maybe assert that? *) + let to_string _ = raise (Failure("unit")) + let of_string _ = raise (Failure("unit")) end module String = struct @@ -302,6 +306,8 @@ module BaseTypes = struct | t -> raise (Json.Casting_error("string", t)) let to_query s = Value (Some s) let parse s = Some (data_to_string s) + let to_string s = s + let of_string s = s end (* NOTE(dbp 2015-01-15): In EC2, Blobs seem to be used for Base64 @@ -328,6 +334,13 @@ module BaseTypes = struct | "true" -> Some true | _ -> None end + let to_string b = + if b then "true" else "false" + let of_string s = + match String.lowercase_ascii s with + | "false" -> false + | "true" -> true + | _ -> raise (Failure("Bad boolean string " ^ s)) end module Integer = struct @@ -342,6 +355,8 @@ module BaseTypes = struct match String.parse i with | None -> None | Some s -> try Some(int_of_string s) with Failure _ -> None + let to_string i = string_of_int i + let of_string s = int_of_string s end module Long = Integer @@ -358,6 +373,8 @@ module BaseTypes = struct match String.parse f with | None -> None | Some s -> try Some(float_of_string s) with Failure _ -> None + let to_string f = string_of_float f + let of_string s = float_of_string s end module Double = Float @@ -371,10 +388,14 @@ module BaseTypes = struct match String.parse c with | None -> None | Some s -> try Some(Time.parse s) with Invalid_argument _ -> None + let to_string c = Time.format c + let of_string s = Time.parse s end end +module Endpoints = Endpoints + module Signing = struct module Hash = struct @@ -417,7 +438,7 @@ module Signing = struct * http://docs.aws.amazon.com/general/latest/gr/sigv4-signed-request-examples.html *) let sign_request ~access_key ~secret_key ~service ~region (meth, uri, headers) = - let host = service ^ ".amazonaws.com" in + let host = Util.of_option_exn (Endpoints.endpoint_of service region) in let params = encode_query (Uri.query uri) in let sign key msg = Hash.sha256 ~key msg in let get_signature_key key date region service = @@ -427,9 +448,9 @@ module Signing = struct let datestamp = Time.date_yymmdd now in let canonical_uri = "/" in let canonical_querystring = params in - let canonical_headers = "host:" ^ host ^ "\n" ^ "x-amz-date:" ^ amzdate ^ "\n" in - let signed_headers = "host;x-amz-date" in let payload_hash = Hash.sha256_hex "" in + let canonical_headers = "host:" ^ host ^ "\n" ^ "x-amz-content-sha256:" ^ payload_hash ^ "\nx-amz-date:" ^ amzdate ^ "\n" in + let signed_headers = "host;x-amz-content-sha256;x-amz-date" in let canonical_request = Request.string_of_meth meth ^ "\n" ^ canonical_uri ^ "\n" ^ canonical_querystring ^ "\n" ^ canonical_headers ^ "\n" ^ signed_headers ^ "\n" ^ payload_hash in let algorithm = "AWS4-HMAC-SHA256" in let credential_scope = datestamp ^ "/" ^ region ^ "/" ^ service ^ "/" ^ "aws4_request" in @@ -437,6 +458,8 @@ module Signing = struct let signing_key = get_signature_key secret_key datestamp region service in let signature = Hash.sha256_hex ~key:signing_key string_to_sign in let authorization_header = String.concat "" [algorithm; " "; "Credential="; access_key; "/"; credential_scope; ", "; "SignedHeaders="; signed_headers; ", "; "Signature="; signature] in - let headers = ("x-amz-date",amzdate) :: ("Authorization", authorization_header) :: headers in + let headers = ("x-amz-date", amzdate) :: ("x-amz-content-sha256", payload_hash) :: ("Authorization", authorization_header) :: headers in (meth, uri, headers) end + + diff --git a/lib/aws.mli b/lib/aws.mli index 40d805108..b754f4c18 100644 --- a/lib/aws.mli +++ b/lib/aws.mli @@ -129,7 +129,7 @@ module type Call = sig 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 to_http : input -> Request.t + val to_http : string -> string -> input -> Request.t (** This function converts from a HTTP response body to an output or an error if the response could not be decoded. *) @@ -189,7 +189,7 @@ module Query : sig as [(0, val); (1, val)...]. *) val to_query_list : ('a -> t) -> 'a list -> t - val to_query_hashtbl : ('a -> t) -> (string, 'a) Hashtbl.t -> t + val to_query_hashtbl : ('a -> string) -> ('b -> t) -> ('a, 'b) Hashtbl.t -> t end (** This module contains helpers used for XML parsing. It wraps Ezxmlm @@ -239,8 +239,8 @@ module Json : sig (** This converts an `Assoc (string * t list) to ('a, 'b) Hashtbl.t, or throws a Casting_error in the case that the input is not an `Assoc. *) - val to_hashtbl: (t -> 'b) -> t -> (string, 'b) Hashtbl.t - + val to_hashtbl: (string -> 'a) -> (t -> 'b) -> t -> ('a, 'b) Hashtbl.t + (** If t is an `Assoc, this looks up the field specified. If it isn't found, or if the input is not an `Assoc, returns None. *) val lookup : t -> string -> t option @@ -314,6 +314,8 @@ module BaseTypes : sig val of_json : Json.t -> t val to_query : t -> Query.t val parse : Ezxmlm.nodes -> t option + val to_string : t -> string + val of_string : string -> t end module Unit : Base with type t = unit @@ -326,3 +328,5 @@ module BaseTypes : sig module Float : Base with type t = float module DateTime : Base with type t = CalendarLib.Calendar.t end + +module Endpoints = Endpoints diff --git a/lib/endpoints.ml b/lib/endpoints.ml new file mode 100644 index 000000000..b28c0d4d9 --- /dev/null +++ b/lib/endpoints.ml @@ -0,0 +1,2053 @@ +let endpoint_of svc_name region = + match svc_name with + | "a4b" -> + (match region with + | "us-east-1" -> Some "a4b.us-east-1.amazonaws.com" + | _ -> None) + | "acm" -> + (match region with + | "ap-northeast-1" -> Some "acm.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "acm.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "acm.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "acm.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "acm.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "acm.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "acm.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "acm.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "acm.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "acm.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "acm.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "acm.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "acm.us-east-1.amazonaws.com" + | "us-east-2" -> Some "acm.us-east-2.amazonaws.com" + | "us-west-1" -> Some "acm.us-west-1.amazonaws.com" + | "us-west-2" -> Some "acm.us-west-2.amazonaws.com" + | _ -> None) + | "acm-pca" -> + (match region with + | "ap-northeast-1" -> Some "acm-pca.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> Some "acm-pca.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "acm-pca.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "acm-pca.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "acm-pca.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "acm-pca.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "acm-pca.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "acm-pca.us-east-1.amazonaws.com" + | "us-east-2" -> Some "acm-pca.us-east-2.amazonaws.com" + | "us-west-2" -> Some "acm-pca.us-west-2.amazonaws.com" + | _ -> None) + | "api.ecr" -> + (match region with + | "ap-northeast-1" -> Some "api.ecr.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "api.ecr.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "api.ecr.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "api.ecr.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "api.ecr.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "api.ecr.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "api.ecr.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "api.ecr.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "api.ecr.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "api.ecr.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "api.ecr.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "api.ecr.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "api.ecr.us-east-1.amazonaws.com" + | "us-east-2" -> Some "api.ecr.us-east-2.amazonaws.com" + | "us-west-1" -> Some "api.ecr.us-west-1.amazonaws.com" + | "us-west-2" -> Some "api.ecr.us-west-2.amazonaws.com" + | _ -> None) + | "api.mediatailor" -> + (match region with + | "ap-northeast-1" -> + Some "api.mediatailor.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> + Some "api.mediatailor.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "api.mediatailor.ap-southeast-2.amazonaws.com" + | "eu-west-1" -> Some "api.mediatailor.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "api.mediatailor.us-east-1.amazonaws.com" + | "us-west-2" -> Some "api.mediatailor.us-west-2.amazonaws.com" + | _ -> None) + | "api.pricing" -> + (match region with + | "ap-south-1" -> Some "api.pricing.ap-south-1.amazonaws.com" + | "us-east-1" -> Some "api.pricing.us-east-1.amazonaws.com" + | _ -> None) + | "api.sagemaker" -> + (match region with + | "ap-northeast-1" -> + Some "api.sagemaker.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "api.sagemaker.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "api.sagemaker.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "api.sagemaker.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "api.sagemaker.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "api.sagemaker.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "api.sagemaker.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "api.sagemaker.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "api.sagemaker.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "api.sagemaker.us-east-1.amazonaws.com" + | "us-east-1-fips" -> + Some "api-fips.sagemaker.us-east-1.amazonaws.com" + | "us-east-2" -> Some "api.sagemaker.us-east-2.amazonaws.com" + | "us-east-2-fips" -> + Some "api-fips.sagemaker.us-east-2.amazonaws.com" + | "us-west-1" -> Some "api.sagemaker.us-west-1.amazonaws.com" + | "us-west-1-fips" -> + Some "api-fips.sagemaker.us-west-1.amazonaws.com" + | "us-west-2" -> Some "api.sagemaker.us-west-2.amazonaws.com" + | "us-west-2-fips" -> + Some "api-fips.sagemaker.us-west-2.amazonaws.com" + | _ -> None) + | "apigateway" -> + (match region with + | "ap-northeast-1" -> Some "apigateway.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "apigateway.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "apigateway.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "apigateway.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "apigateway.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "apigateway.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "apigateway.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "apigateway.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "apigateway.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "apigateway.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "apigateway.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "apigateway.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "apigateway.us-east-1.amazonaws.com" + | "us-east-2" -> Some "apigateway.us-east-2.amazonaws.com" + | "us-west-1" -> Some "apigateway.us-west-1.amazonaws.com" + | "us-west-2" -> Some "apigateway.us-west-2.amazonaws.com" + | _ -> None) + | "application-autoscaling" -> + (match region with + | "ap-northeast-1" -> + Some "application-autoscaling.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "application-autoscaling.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> + Some "application-autoscaling.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "application-autoscaling.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "application-autoscaling.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> + Some "application-autoscaling.ca-central-1.amazonaws.com" + | "eu-central-1" -> + Some "application-autoscaling.eu-central-1.amazonaws.com" + | "eu-north-1" -> + Some "application-autoscaling.eu-north-1.amazonaws.com" + | "eu-west-1" -> + Some "application-autoscaling.eu-west-1.amazonaws.com" + | "eu-west-2" -> + Some "application-autoscaling.eu-west-2.amazonaws.com" + | "eu-west-3" -> + Some "application-autoscaling.eu-west-3.amazonaws.com" + | "sa-east-1" -> + Some "application-autoscaling.sa-east-1.amazonaws.com" + | "us-east-1" -> + Some "application-autoscaling.us-east-1.amazonaws.com" + | "us-east-2" -> + Some "application-autoscaling.us-east-2.amazonaws.com" + | "us-west-1" -> + Some "application-autoscaling.us-west-1.amazonaws.com" + | "us-west-2" -> + Some "application-autoscaling.us-west-2.amazonaws.com" + | _ -> None) + | "appstream2" -> + (match region with + | "ap-northeast-1" -> Some "appstream2.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "appstream2.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> Some "appstream2.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "appstream2.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "appstream2.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "appstream2.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "appstream2.us-east-1.amazonaws.com" + | "us-west-2" -> Some "appstream2.us-west-2.amazonaws.com" + | _ -> None) + | "appsync" -> + (match region with + | "ap-northeast-1" -> Some "appsync.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "appsync.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "appsync.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "appsync.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "appsync.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "appsync.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "appsync.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "appsync.us-east-1.amazonaws.com" + | "us-east-2" -> Some "appsync.us-east-2.amazonaws.com" + | "us-west-2" -> Some "appsync.us-west-2.amazonaws.com" + | _ -> None) + | "athena" -> + (match region with + | "ap-northeast-1" -> Some "athena.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "athena.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "athena.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "athena.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "athena.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "athena.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "athena.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "athena.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "athena.us-east-1.amazonaws.com" + | "us-east-2" -> Some "athena.us-east-2.amazonaws.com" + | "us-west-2" -> Some "athena.us-west-2.amazonaws.com" + | _ -> None) + | "autoscaling" -> + (match region with + | "ap-northeast-1" -> Some "autoscaling.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "autoscaling.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "autoscaling.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "autoscaling.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "autoscaling.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "autoscaling.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "autoscaling.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "autoscaling.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "autoscaling.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "autoscaling.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "autoscaling.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "autoscaling.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "autoscaling.us-east-1.amazonaws.com" + | "us-east-2" -> Some "autoscaling.us-east-2.amazonaws.com" + | "us-west-1" -> Some "autoscaling.us-west-1.amazonaws.com" + | "us-west-2" -> Some "autoscaling.us-west-2.amazonaws.com" + | _ -> None) + | "autoscaling-plans" -> + (match region with + | "ap-northeast-1" -> + Some "autoscaling-plans.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "autoscaling-plans.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "autoscaling-plans.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "autoscaling-plans.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "autoscaling-plans.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> + Some "autoscaling-plans.ca-central-1.amazonaws.com" + | "eu-central-1" -> + Some "autoscaling-plans.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "autoscaling-plans.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "autoscaling-plans.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "autoscaling-plans.us-east-1.amazonaws.com" + | "us-east-2" -> Some "autoscaling-plans.us-east-2.amazonaws.com" + | "us-west-1" -> Some "autoscaling-plans.us-west-1.amazonaws.com" + | "us-west-2" -> Some "autoscaling-plans.us-west-2.amazonaws.com" + | _ -> None) + | "batch" -> + (match region with + | "ap-northeast-1" -> Some "batch.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "batch.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "batch.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "batch.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "batch.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "batch.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "batch.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "batch.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "batch.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "batch.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "batch.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "batch.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "batch.us-east-1.amazonaws.com" + | "us-east-2" -> Some "batch.us-east-2.amazonaws.com" + | "us-west-1" -> Some "batch.us-west-1.amazonaws.com" + | "us-west-2" -> Some "batch.us-west-2.amazonaws.com" + | _ -> None) + | "budgets" -> + (match region with + | "aws-global" -> Some "budgets.amazonaws.com" + | _ -> None) + | "ce" -> + (match region with + | "aws-global" -> Some "ce.us-east-1.amazonaws.com" + | _ -> None) + | "chime" -> + (match region with + | "aws-global" -> Some "service.chime.aws.amazon.com" + | _ -> None) + | "cloud9" -> + (match region with + | "ap-southeast-1" -> Some "cloud9.ap-southeast-1.amazonaws.com" + | "eu-west-1" -> Some "cloud9.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "cloud9.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cloud9.us-east-2.amazonaws.com" + | "us-west-2" -> Some "cloud9.us-west-2.amazonaws.com" + | _ -> None) + | "clouddirectory" -> + (match region with + | "ap-southeast-1" -> + Some "clouddirectory.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "clouddirectory.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "clouddirectory.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "clouddirectory.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "clouddirectory.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "clouddirectory.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "clouddirectory.us-east-1.amazonaws.com" + | "us-east-2" -> Some "clouddirectory.us-east-2.amazonaws.com" + | "us-west-2" -> Some "clouddirectory.us-west-2.amazonaws.com" + | _ -> None) + | "cloudformation" -> + (match region with + | "ap-northeast-1" -> + Some "cloudformation.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "cloudformation.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "cloudformation.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "cloudformation.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "cloudformation.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "cloudformation.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "cloudformation.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "cloudformation.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "cloudformation.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "cloudformation.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "cloudformation.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "cloudformation.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "cloudformation.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cloudformation.us-east-2.amazonaws.com" + | "us-west-1" -> Some "cloudformation.us-west-1.amazonaws.com" + | "us-west-2" -> Some "cloudformation.us-west-2.amazonaws.com" + | _ -> None) + | "cloudfront" -> + (match region with + | "aws-global" -> Some "cloudfront.amazonaws.com" + | _ -> None) + | "cloudhsm" -> + (match region with + | "ap-northeast-1" -> Some "cloudhsm.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> Some "cloudhsm.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "cloudhsm.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "cloudhsm.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "cloudhsm.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "cloudhsm.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "cloudhsm.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cloudhsm.us-east-2.amazonaws.com" + | "us-west-1" -> Some "cloudhsm.us-west-1.amazonaws.com" + | "us-west-2" -> Some "cloudhsm.us-west-2.amazonaws.com" + | _ -> None) + | "cloudhsmv2" -> + (match region with + | "ap-northeast-1" -> Some "cloudhsmv2.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "cloudhsmv2.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "cloudhsmv2.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "cloudhsmv2.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "cloudhsmv2.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "cloudhsmv2.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "cloudhsmv2.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "cloudhsmv2.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "cloudhsmv2.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "cloudhsmv2.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "cloudhsmv2.eu-west-3.amazonaws.com" + | "us-east-1" -> Some "cloudhsmv2.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cloudhsmv2.us-east-2.amazonaws.com" + | "us-west-1" -> Some "cloudhsmv2.us-west-1.amazonaws.com" + | "us-west-2" -> Some "cloudhsmv2.us-west-2.amazonaws.com" + | _ -> None) + | "cloudsearch" -> + (match region with + | "ap-northeast-1" -> Some "cloudsearch.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "cloudsearch.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> Some "cloudsearch.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "cloudsearch.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "cloudsearch.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "cloudsearch.eu-west-1.amazonaws.com" + | "sa-east-1" -> Some "cloudsearch.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "cloudsearch.us-east-1.amazonaws.com" + | "us-west-1" -> Some "cloudsearch.us-west-1.amazonaws.com" + | "us-west-2" -> Some "cloudsearch.us-west-2.amazonaws.com" + | _ -> None) + | "cloudtrail" -> + (match region with + | "ap-northeast-1" -> Some "cloudtrail.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "cloudtrail.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "cloudtrail.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "cloudtrail.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "cloudtrail.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "cloudtrail.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "cloudtrail.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "cloudtrail.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "cloudtrail.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "cloudtrail.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "cloudtrail.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "cloudtrail.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "cloudtrail.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cloudtrail.us-east-2.amazonaws.com" + | "us-west-1" -> Some "cloudtrail.us-west-1.amazonaws.com" + | "us-west-2" -> Some "cloudtrail.us-west-2.amazonaws.com" + | _ -> None) + | "codebuild" -> + (match region with + | "ap-northeast-1" -> Some "codebuild.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "codebuild.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "codebuild.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "codebuild.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "codebuild.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "codebuild.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "codebuild.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "codebuild.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "codebuild.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "codebuild.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "codebuild.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "codebuild.us-east-1.amazonaws.com" + | "us-east-1-fips" -> Some "codebuild-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "codebuild.us-east-2.amazonaws.com" + | "us-east-2-fips" -> Some "codebuild-fips.us-east-2.amazonaws.com" + | "us-west-1" -> Some "codebuild.us-west-1.amazonaws.com" + | "us-west-1-fips" -> Some "codebuild-fips.us-west-1.amazonaws.com" + | "us-west-2" -> Some "codebuild.us-west-2.amazonaws.com" + | "us-west-2-fips" -> Some "codebuild-fips.us-west-2.amazonaws.com" + | _ -> None) + | "codecommit" -> + (match region with + | "ap-northeast-1" -> Some "codecommit.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "codecommit.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "codecommit.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "codecommit.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "codecommit.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "codecommit.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "codecommit.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "codecommit.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "codecommit.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "codecommit.eu-west-3.amazonaws.com" + | "fips" -> Some "codecommit-fips.ca-central-1.amazonaws.com" + | "sa-east-1" -> Some "codecommit.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "codecommit.us-east-1.amazonaws.com" + | "us-east-2" -> Some "codecommit.us-east-2.amazonaws.com" + | "us-west-1" -> Some "codecommit.us-west-1.amazonaws.com" + | "us-west-2" -> Some "codecommit.us-west-2.amazonaws.com" + | _ -> None) + | "codedeploy" -> + (match region with + | "ap-northeast-1" -> Some "codedeploy.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "codedeploy.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "codedeploy.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "codedeploy.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "codedeploy.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "codedeploy.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "codedeploy.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "codedeploy.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "codedeploy.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "codedeploy.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "codedeploy.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "codedeploy.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "codedeploy.us-east-1.amazonaws.com" + | "us-east-1-fips" -> Some "codedeploy-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "codedeploy.us-east-2.amazonaws.com" + | "us-east-2-fips" -> Some "codedeploy-fips.us-east-2.amazonaws.com" + | "us-west-1" -> Some "codedeploy.us-west-1.amazonaws.com" + | "us-west-1-fips" -> Some "codedeploy-fips.us-west-1.amazonaws.com" + | "us-west-2" -> Some "codedeploy.us-west-2.amazonaws.com" + | "us-west-2-fips" -> Some "codedeploy-fips.us-west-2.amazonaws.com" + | _ -> None) + | "codepipeline" -> + (match region with + | "ap-northeast-1" -> Some "codepipeline.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "codepipeline.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "codepipeline.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "codepipeline.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "codepipeline.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "codepipeline.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "codepipeline.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "codepipeline.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "codepipeline.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "codepipeline.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "codepipeline.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "codepipeline.us-east-1.amazonaws.com" + | "us-east-2" -> Some "codepipeline.us-east-2.amazonaws.com" + | "us-west-1" -> Some "codepipeline.us-west-1.amazonaws.com" + | "us-west-2" -> Some "codepipeline.us-west-2.amazonaws.com" + | _ -> None) + | "codestar" -> + (match region with + | "ap-northeast-1" -> Some "codestar.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "codestar.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> Some "codestar.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "codestar.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "codestar.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "codestar.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "codestar.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "codestar.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "codestar.us-east-1.amazonaws.com" + | "us-east-2" -> Some "codestar.us-east-2.amazonaws.com" + | "us-west-1" -> Some "codestar.us-west-1.amazonaws.com" + | "us-west-2" -> Some "codestar.us-west-2.amazonaws.com" + | _ -> None) + | "cognito-identity" -> + (match region with + | "ap-northeast-1" -> + Some "cognito-identity.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "cognito-identity.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "cognito-identity.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "cognito-identity.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "cognito-identity.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "cognito-identity.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "cognito-identity.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "cognito-identity.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "cognito-identity.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "cognito-identity.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cognito-identity.us-east-2.amazonaws.com" + | "us-west-2" -> Some "cognito-identity.us-west-2.amazonaws.com" + | _ -> None) + | "cognito-idp" -> + (match region with + | "ap-northeast-1" -> Some "cognito-idp.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "cognito-idp.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "cognito-idp.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "cognito-idp.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "cognito-idp.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "cognito-idp.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "cognito-idp.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "cognito-idp.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "cognito-idp.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "cognito-idp.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cognito-idp.us-east-2.amazonaws.com" + | "us-west-2" -> Some "cognito-idp.us-west-2.amazonaws.com" + | _ -> None) + | "cognito-sync" -> + (match region with + | "ap-northeast-1" -> Some "cognito-sync.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "cognito-sync.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "cognito-sync.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "cognito-sync.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "cognito-sync.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "cognito-sync.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "cognito-sync.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "cognito-sync.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "cognito-sync.us-east-1.amazonaws.com" + | "us-east-2" -> Some "cognito-sync.us-east-2.amazonaws.com" + | "us-west-2" -> Some "cognito-sync.us-west-2.amazonaws.com" + | _ -> None) + | "comprehend" -> + (match region with + | "ap-southeast-1" -> Some "comprehend.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "comprehend.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "comprehend.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "comprehend.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "comprehend.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "comprehend.us-east-1.amazonaws.com" + | "us-east-2" -> Some "comprehend.us-east-2.amazonaws.com" + | "us-west-2" -> Some "comprehend.us-west-2.amazonaws.com" + | _ -> None) + | "config" -> + (match region with + | "ap-northeast-1" -> Some "config.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "config.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "config.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "config.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "config.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "config.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "config.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "config.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "config.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "config.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "config.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "config.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "config.us-east-1.amazonaws.com" + | "us-east-2" -> Some "config.us-east-2.amazonaws.com" + | "us-west-1" -> Some "config.us-west-1.amazonaws.com" + | "us-west-2" -> Some "config.us-west-2.amazonaws.com" + | _ -> None) + | "cur" -> + (match region with + | "us-east-1" -> Some "cur.us-east-1.amazonaws.com" + | _ -> None) + | "data.iot" -> + (match region with + | "ap-northeast-1" -> Some "data.iot.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "data.iot.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "data.iot.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "data.iot.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "data.iot.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "data.iot.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "data.iot.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "data.iot.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "data.iot.us-east-1.amazonaws.com" + | "us-east-2" -> Some "data.iot.us-east-2.amazonaws.com" + | "us-west-2" -> Some "data.iot.us-west-2.amazonaws.com" + | _ -> None) + | "datapipeline" -> + (match region with + | "ap-northeast-1" -> Some "datapipeline.ap-northeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "datapipeline.ap-southeast-2.amazonaws.com" + | "eu-west-1" -> Some "datapipeline.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "datapipeline.us-east-1.amazonaws.com" + | "us-west-2" -> Some "datapipeline.us-west-2.amazonaws.com" + | _ -> None) + | "datasync" -> + (match region with + | "ap-northeast-1" -> Some "datasync.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "datasync.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> Some "datasync.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "datasync.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "datasync.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "datasync.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "datasync.us-east-1.amazonaws.com" + | "us-east-2" -> Some "datasync.us-east-2.amazonaws.com" + | "us-west-1" -> Some "datasync.us-west-1.amazonaws.com" + | "us-west-2" -> Some "datasync.us-west-2.amazonaws.com" + | _ -> None) + | "dax" -> + (match region with + | "ap-northeast-1" -> Some "dax.ap-northeast-1.amazonaws.com" + | "ap-south-1" -> Some "dax.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "dax.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "dax.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "dax.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "dax.eu-west-1.amazonaws.com" + | "sa-east-1" -> Some "dax.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "dax.us-east-1.amazonaws.com" + | "us-east-2" -> Some "dax.us-east-2.amazonaws.com" + | "us-west-1" -> Some "dax.us-west-1.amazonaws.com" + | "us-west-2" -> Some "dax.us-west-2.amazonaws.com" + | _ -> None) + | "devicefarm" -> + (match region with + | "us-west-2" -> Some "devicefarm.us-west-2.amazonaws.com" + | _ -> None) + | "directconnect" -> + (match region with + | "ap-northeast-1" -> + Some "directconnect.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "directconnect.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "directconnect.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "directconnect.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "directconnect.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "directconnect.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "directconnect.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "directconnect.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "directconnect.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "directconnect.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "directconnect.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "directconnect.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "directconnect.us-east-1.amazonaws.com" + | "us-east-2" -> Some "directconnect.us-east-2.amazonaws.com" + | "us-west-1" -> Some "directconnect.us-west-1.amazonaws.com" + | "us-west-2" -> Some "directconnect.us-west-2.amazonaws.com" + | _ -> None) + | "discovery" -> + (match region with + | "us-west-2" -> Some "discovery.us-west-2.amazonaws.com" + | _ -> None) + | "dms" -> + (match region with + | "ap-northeast-1" -> Some "dms.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "dms.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "dms.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "dms.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "dms.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "dms.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "dms.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "dms.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "dms.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "dms.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "dms.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "dms.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "dms.us-east-1.amazonaws.com" + | "us-east-2" -> Some "dms.us-east-2.amazonaws.com" + | "us-west-1" -> Some "dms.us-west-1.amazonaws.com" + | "us-west-2" -> Some "dms.us-west-2.amazonaws.com" + | _ -> None) + | "docdb" -> + (match region with + | "eu-west-1" -> Some "rds.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "rds.us-east-1.amazonaws.com" + | "us-east-2" -> Some "rds.us-east-2.amazonaws.com" + | "us-west-2" -> Some "rds.us-west-2.amazonaws.com" + | _ -> None) + | "ds" -> + (match region with + | "ap-northeast-1" -> Some "ds.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "ds.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "ds.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "ds.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "ds.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "ds.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "ds.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "ds.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "ds.eu-west-2.amazonaws.com" + | "sa-east-1" -> Some "ds.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "ds.us-east-1.amazonaws.com" + | "us-east-2" -> Some "ds.us-east-2.amazonaws.com" + | "us-west-1" -> Some "ds.us-west-1.amazonaws.com" + | "us-west-2" -> Some "ds.us-west-2.amazonaws.com" + | _ -> None) + | "dynamodb" -> + (match region with + | "ap-northeast-1" -> Some "dynamodb.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "dynamodb.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "dynamodb.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "dynamodb.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "dynamodb.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "dynamodb.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "dynamodb.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "dynamodb.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "dynamodb.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "dynamodb.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "dynamodb.eu-west-3.amazonaws.com" + | "local" -> Some "localhost:8000" + | "sa-east-1" -> Some "dynamodb.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "dynamodb.us-east-1.amazonaws.com" + | "us-east-2" -> Some "dynamodb.us-east-2.amazonaws.com" + | "us-west-1" -> Some "dynamodb.us-west-1.amazonaws.com" + | "us-west-2" -> Some "dynamodb.us-west-2.amazonaws.com" + | _ -> None) + | "ec2" -> + (match region with + | "ap-northeast-1" -> Some "ec2.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "ec2.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "ec2.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "ec2.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "ec2.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "ec2.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "ec2.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "ec2.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "ec2.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "ec2.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "ec2.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "ec2.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "ec2.us-east-1.amazonaws.com" + | "us-east-2" -> Some "ec2.us-east-2.amazonaws.com" + | "us-west-1" -> Some "ec2.us-west-1.amazonaws.com" + | "us-west-2" -> Some "ec2.us-west-2.amazonaws.com" + | _ -> None) + | "ecs" -> + (match region with + | "ap-northeast-1" -> Some "ecs.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "ecs.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "ecs.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "ecs.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "ecs.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "ecs.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "ecs.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "ecs.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "ecs.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "ecs.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "ecs.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "ecs.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "ecs.us-east-1.amazonaws.com" + | "us-east-2" -> Some "ecs.us-east-2.amazonaws.com" + | "us-west-1" -> Some "ecs.us-west-1.amazonaws.com" + | "us-west-2" -> Some "ecs.us-west-2.amazonaws.com" + | _ -> None) + | "elasticache" -> + (match region with + | "ap-northeast-1" -> Some "elasticache.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "elasticache.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "elasticache.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "elasticache.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "elasticache.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "elasticache.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "elasticache.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "elasticache.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "elasticache.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "elasticache.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "elasticache.eu-west-3.amazonaws.com" + | "fips" -> Some "elasticache-fips.us-west-1.amazonaws.com" + | "sa-east-1" -> Some "elasticache.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "elasticache.us-east-1.amazonaws.com" + | "us-east-2" -> Some "elasticache.us-east-2.amazonaws.com" + | "us-west-1" -> Some "elasticache.us-west-1.amazonaws.com" + | "us-west-2" -> Some "elasticache.us-west-2.amazonaws.com" + | _ -> None) + | "elasticbeanstalk" -> + (match region with + | "ap-northeast-1" -> + Some "elasticbeanstalk.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "elasticbeanstalk.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "elasticbeanstalk.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "elasticbeanstalk.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "elasticbeanstalk.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "elasticbeanstalk.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "elasticbeanstalk.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "elasticbeanstalk.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "elasticbeanstalk.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "elasticbeanstalk.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "elasticbeanstalk.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "elasticbeanstalk.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "elasticbeanstalk.us-east-1.amazonaws.com" + | "us-east-2" -> Some "elasticbeanstalk.us-east-2.amazonaws.com" + | "us-west-1" -> Some "elasticbeanstalk.us-west-1.amazonaws.com" + | "us-west-2" -> Some "elasticbeanstalk.us-west-2.amazonaws.com" + | _ -> None) + | "elasticfilesystem" -> + (match region with + | "ap-northeast-1" -> + Some "elasticfilesystem.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "elasticfilesystem.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> + Some "elasticfilesystem.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "elasticfilesystem.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> + Some "elasticfilesystem.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "elasticfilesystem.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "elasticfilesystem.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "elasticfilesystem.us-east-1.amazonaws.com" + | "us-east-2" -> Some "elasticfilesystem.us-east-2.amazonaws.com" + | "us-west-1" -> Some "elasticfilesystem.us-west-1.amazonaws.com" + | "us-west-2" -> Some "elasticfilesystem.us-west-2.amazonaws.com" + | _ -> None) + | "elasticloadbalancing" -> + (match region with + | "ap-northeast-1" -> + Some "elasticloadbalancing.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "elasticloadbalancing.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "elasticloadbalancing.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "elasticloadbalancing.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "elasticloadbalancing.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> + Some "elasticloadbalancing.ca-central-1.amazonaws.com" + | "eu-central-1" -> + Some "elasticloadbalancing.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "elasticloadbalancing.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "elasticloadbalancing.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "elasticloadbalancing.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "elasticloadbalancing.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "elasticloadbalancing.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "elasticloadbalancing.us-east-1.amazonaws.com" + | "us-east-2" -> Some "elasticloadbalancing.us-east-2.amazonaws.com" + | "us-west-1" -> Some "elasticloadbalancing.us-west-1.amazonaws.com" + | "us-west-2" -> Some "elasticloadbalancing.us-west-2.amazonaws.com" + | _ -> None) + | "elasticmapreduce" -> + (match region with + | "ap-northeast-1" -> + Some "elasticmapreduce.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "elasticmapreduce.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "elasticmapreduce.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "elasticmapreduce.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "elasticmapreduce.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "elasticmapreduce.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "elasticmapreduce.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "elasticmapreduce.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "elasticmapreduce.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "elasticmapreduce.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "elasticmapreduce.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "elasticmapreduce.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "elasticmapreduce.us-east-1.amazonaws.com" + | "us-east-2" -> Some "elasticmapreduce.us-east-2.amazonaws.com" + | "us-west-1" -> Some "elasticmapreduce.us-west-1.amazonaws.com" + | "us-west-2" -> Some "elasticmapreduce.us-west-2.amazonaws.com" + | _ -> None) + | "elastictranscoder" -> + (match region with + | "ap-northeast-1" -> + Some "elastictranscoder.ap-northeast-1.amazonaws.com" + | "ap-south-1" -> Some "elastictranscoder.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "elastictranscoder.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "elastictranscoder.ap-southeast-2.amazonaws.com" + | "eu-west-1" -> Some "elastictranscoder.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "elastictranscoder.us-east-1.amazonaws.com" + | "us-west-1" -> Some "elastictranscoder.us-west-1.amazonaws.com" + | "us-west-2" -> Some "elastictranscoder.us-west-2.amazonaws.com" + | _ -> None) + | "email" -> + (match region with + | "eu-west-1" -> Some "email.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "email.us-east-1.amazonaws.com" + | "us-west-2" -> Some "email.us-west-2.amazonaws.com" + | _ -> None) + | "entitlement.marketplace" -> + (match region with + | "us-east-1" -> + Some "entitlement.marketplace.us-east-1.amazonaws.com" + | _ -> None) + | "es" -> + (match region with + | "ap-northeast-1" -> Some "es.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "es.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "es.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "es.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "es.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "es.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "es.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "es.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "es.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "es.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "es.eu-west-3.amazonaws.com" + | "fips" -> Some "es-fips.us-west-1.amazonaws.com" + | "sa-east-1" -> Some "es.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "es.us-east-1.amazonaws.com" + | "us-east-2" -> Some "es.us-east-2.amazonaws.com" + | "us-west-1" -> Some "es.us-west-1.amazonaws.com" + | "us-west-2" -> Some "es.us-west-2.amazonaws.com" + | _ -> None) + | "events" -> + (match region with + | "ap-northeast-1" -> Some "events.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "events.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "events.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "events.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "events.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "events.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "events.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "events.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "events.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "events.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "events.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "events.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "events.us-east-1.amazonaws.com" + | "us-east-2" -> Some "events.us-east-2.amazonaws.com" + | "us-west-1" -> Some "events.us-west-1.amazonaws.com" + | "us-west-2" -> Some "events.us-west-2.amazonaws.com" + | _ -> None) + | "firehose" -> + (match region with + | "ap-northeast-1" -> Some "firehose.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "firehose.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "firehose.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "firehose.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "firehose.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "firehose.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "firehose.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "firehose.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "firehose.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "firehose.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "firehose.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "firehose.us-east-1.amazonaws.com" + | "us-east-2" -> Some "firehose.us-east-2.amazonaws.com" + | "us-west-1" -> Some "firehose.us-west-1.amazonaws.com" + | "us-west-2" -> Some "firehose.us-west-2.amazonaws.com" + | _ -> None) + | "fms" -> + (match region with + | "ap-northeast-1" -> Some "fms.ap-northeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "fms.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "fms.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "fms.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "fms.us-east-1.amazonaws.com" + | "us-east-2" -> Some "fms.us-east-2.amazonaws.com" + | "us-west-2" -> Some "fms.us-west-2.amazonaws.com" + | _ -> None) + | "fsx" -> + (match region with + | "eu-west-1" -> Some "fsx.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "fsx.us-east-1.amazonaws.com" + | "us-east-2" -> Some "fsx.us-east-2.amazonaws.com" + | "us-west-2" -> Some "fsx.us-west-2.amazonaws.com" + | _ -> None) + | "gamelift" -> + (match region with + | "ap-northeast-1" -> Some "gamelift.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "gamelift.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "gamelift.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "gamelift.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "gamelift.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "gamelift.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "gamelift.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "gamelift.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "gamelift.eu-west-2.amazonaws.com" + | "sa-east-1" -> Some "gamelift.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "gamelift.us-east-1.amazonaws.com" + | "us-east-2" -> Some "gamelift.us-east-2.amazonaws.com" + | "us-west-1" -> Some "gamelift.us-west-1.amazonaws.com" + | "us-west-2" -> Some "gamelift.us-west-2.amazonaws.com" + | _ -> None) + | "glacier" -> + (match region with + | "ap-northeast-1" -> Some "glacier.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "glacier.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "glacier.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "glacier.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "glacier.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "glacier.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "glacier.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "glacier.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "glacier.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "glacier.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "glacier.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "glacier.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "glacier.us-east-1.amazonaws.com" + | "us-east-2" -> Some "glacier.us-east-2.amazonaws.com" + | "us-west-1" -> Some "glacier.us-west-1.amazonaws.com" + | "us-west-2" -> Some "glacier.us-west-2.amazonaws.com" + | _ -> None) + | "glue" -> + (match region with + | "ap-northeast-1" -> Some "glue.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "glue.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "glue.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "glue.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "glue.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "glue.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "glue.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "glue.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "glue.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "glue.eu-west-3.amazonaws.com" + | "us-east-1" -> Some "glue.us-east-1.amazonaws.com" + | "us-east-2" -> Some "glue.us-east-2.amazonaws.com" + | "us-west-1" -> Some "glue.us-west-1.amazonaws.com" + | "us-west-2" -> Some "glue.us-west-2.amazonaws.com" + | _ -> None) + | "greengrass" -> + (match region with + | "ap-northeast-1" -> Some "greengrass.ap-northeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "greengrass.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "greengrass.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "greengrass.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "greengrass.us-east-1.amazonaws.com" + | "us-west-2" -> Some "greengrass.us-west-2.amazonaws.com" + | _ -> None) + | "guardduty" -> + (match region with + | "ap-northeast-1" -> Some "guardduty.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "guardduty.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "guardduty.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "guardduty.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "guardduty.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "guardduty.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "guardduty.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "guardduty.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "guardduty.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "guardduty.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "guardduty.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "guardduty.us-east-1.amazonaws.com" + | "us-east-2" -> Some "guardduty.us-east-2.amazonaws.com" + | "us-west-1" -> Some "guardduty.us-west-1.amazonaws.com" + | "us-west-2" -> Some "guardduty.us-west-2.amazonaws.com" + | _ -> None) + | "health" -> + (match region with + | "us-east-1" -> Some "health.us-east-1.amazonaws.com" + | _ -> None) + | "iam" -> + (match region with + | "aws-global" -> Some "iam.amazonaws.com" + | _ -> None) + | "importexport" -> + (match region with + | "aws-global" -> Some "importexport.amazonaws.com" + | _ -> None) + | "inspector" -> + (match region with + | "ap-northeast-1" -> Some "inspector.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "inspector.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "inspector.ap-south-1.amazonaws.com" + | "ap-southeast-2" -> Some "inspector.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "inspector.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "inspector.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "inspector.us-east-1.amazonaws.com" + | "us-east-2" -> Some "inspector.us-east-2.amazonaws.com" + | "us-west-1" -> Some "inspector.us-west-1.amazonaws.com" + | "us-west-2" -> Some "inspector.us-west-2.amazonaws.com" + | _ -> None) + | "iot" -> + (match region with + | "ap-northeast-1" -> Some "iot.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "iot.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "iot.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "iot.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "iot.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "iot.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "iot.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "iot.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "iot.us-east-1.amazonaws.com" + | "us-east-2" -> Some "iot.us-east-2.amazonaws.com" + | "us-west-2" -> Some "iot.us-west-2.amazonaws.com" + | _ -> None) + | "iotanalytics" -> + (match region with + | "ap-northeast-1" -> Some "iotanalytics.ap-northeast-1.amazonaws.com" + | "eu-central-1" -> Some "iotanalytics.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "iotanalytics.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "iotanalytics.us-east-1.amazonaws.com" + | "us-east-2" -> Some "iotanalytics.us-east-2.amazonaws.com" + | "us-west-2" -> Some "iotanalytics.us-west-2.amazonaws.com" + | _ -> None) + | "kinesis" -> + (match region with + | "ap-northeast-1" -> Some "kinesis.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "kinesis.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "kinesis.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "kinesis.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "kinesis.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "kinesis.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "kinesis.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "kinesis.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "kinesis.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "kinesis.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "kinesis.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "kinesis.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "kinesis.us-east-1.amazonaws.com" + | "us-east-2" -> Some "kinesis.us-east-2.amazonaws.com" + | "us-west-1" -> Some "kinesis.us-west-1.amazonaws.com" + | "us-west-2" -> Some "kinesis.us-west-2.amazonaws.com" + | _ -> None) + | "kinesisanalytics" -> + (match region with + | "eu-central-1" -> Some "kinesisanalytics.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "kinesisanalytics.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "kinesisanalytics.us-east-1.amazonaws.com" + | "us-east-2" -> Some "kinesisanalytics.us-east-2.amazonaws.com" + | "us-west-2" -> Some "kinesisanalytics.us-west-2.amazonaws.com" + | _ -> None) + | "kinesisvideo" -> + (match region with + | "ap-northeast-1" -> Some "kinesisvideo.ap-northeast-1.amazonaws.com" + | "eu-central-1" -> Some "kinesisvideo.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "kinesisvideo.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "kinesisvideo.us-east-1.amazonaws.com" + | "us-west-2" -> Some "kinesisvideo.us-west-2.amazonaws.com" + | _ -> None) + | "kms" -> + (match region with + | "ProdFips" -> Some "kms-fips.ca-central-1.amazonaws.com" + | "ap-northeast-1" -> Some "kms.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "kms.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "kms.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "kms.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "kms.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "kms.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "kms.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "kms.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "kms.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "kms.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "kms.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "kms.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "kms.us-east-1.amazonaws.com" + | "us-east-2" -> Some "kms.us-east-2.amazonaws.com" + | "us-west-1" -> Some "kms.us-west-1.amazonaws.com" + | "us-west-2" -> Some "kms.us-west-2.amazonaws.com" + | _ -> None) + | "lambda" -> + (match region with + | "ap-northeast-1" -> Some "lambda.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "lambda.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "lambda.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "lambda.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "lambda.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "lambda.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "lambda.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "lambda.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "lambda.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "lambda.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "lambda.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "lambda.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "lambda.us-east-1.amazonaws.com" + | "us-east-2" -> Some "lambda.us-east-2.amazonaws.com" + | "us-west-1" -> Some "lambda.us-west-1.amazonaws.com" + | "us-west-2" -> Some "lambda.us-west-2.amazonaws.com" + | _ -> None) + | "license-manager" -> + (match region with + | "ap-northeast-1" -> + Some "license-manager.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "license-manager.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "license-manager.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "license-manager.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "license-manager.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "license-manager.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "license-manager.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "license-manager.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "license-manager.us-east-1.amazonaws.com" + | "us-east-2" -> Some "license-manager.us-east-2.amazonaws.com" + | "us-west-2" -> Some "license-manager.us-west-2.amazonaws.com" + | _ -> None) + | "lightsail" -> + (match region with + | "ap-northeast-1" -> Some "lightsail.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "lightsail.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "lightsail.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "lightsail.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "lightsail.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "lightsail.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "lightsail.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "lightsail.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "lightsail.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "lightsail.eu-west-3.amazonaws.com" + | "us-east-1" -> Some "lightsail.us-east-1.amazonaws.com" + | "us-east-2" -> Some "lightsail.us-east-2.amazonaws.com" + | "us-west-2" -> Some "lightsail.us-west-2.amazonaws.com" + | _ -> None) + | "logs" -> + (match region with + | "ap-northeast-1" -> Some "logs.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "logs.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "logs.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "logs.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "logs.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "logs.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "logs.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "logs.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "logs.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "logs.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "logs.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "logs.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "logs.us-east-1.amazonaws.com" + | "us-east-2" -> Some "logs.us-east-2.amazonaws.com" + | "us-west-1" -> Some "logs.us-west-1.amazonaws.com" + | "us-west-2" -> Some "logs.us-west-2.amazonaws.com" + | _ -> None) + | "machinelearning" -> + (match region with + | "eu-west-1" -> Some "machinelearning.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "machinelearning.us-east-1.amazonaws.com" + | _ -> None) + | "marketplacecommerceanalytics" -> + (match region with + | "us-east-1" -> + Some "marketplacecommerceanalytics.us-east-1.amazonaws.com" + | _ -> None) + | "mediaconvert" -> + (match region with + | "ap-northeast-1" -> Some "mediaconvert.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "mediaconvert.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "mediaconvert.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "mediaconvert.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "mediaconvert.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "mediaconvert.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "mediaconvert.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "mediaconvert.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "mediaconvert.eu-west-2.amazonaws.com" + | "sa-east-1" -> Some "mediaconvert.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "mediaconvert.us-east-1.amazonaws.com" + | "us-east-2" -> Some "mediaconvert.us-east-2.amazonaws.com" + | "us-west-1" -> Some "mediaconvert.us-west-1.amazonaws.com" + | "us-west-2" -> Some "mediaconvert.us-west-2.amazonaws.com" + | _ -> None) + | "medialive" -> + (match region with + | "ap-northeast-1" -> Some "medialive.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "medialive.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "medialive.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "medialive.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "medialive.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "medialive.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "medialive.eu-west-1.amazonaws.com" + | "sa-east-1" -> Some "medialive.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "medialive.us-east-1.amazonaws.com" + | "us-west-2" -> Some "medialive.us-west-2.amazonaws.com" + | _ -> None) + | "mediapackage" -> + (match region with + | "ap-northeast-1" -> Some "mediapackage.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "mediapackage.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "mediapackage.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "mediapackage.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "mediapackage.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "mediapackage.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "mediapackage.eu-west-1.amazonaws.com" + | "eu-west-3" -> Some "mediapackage.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "mediapackage.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "mediapackage.us-east-1.amazonaws.com" + | "us-west-1" -> Some "mediapackage.us-west-1.amazonaws.com" + | "us-west-2" -> Some "mediapackage.us-west-2.amazonaws.com" + | _ -> None) + | "mediastore" -> + (match region with + | "ap-northeast-1" -> Some "mediastore.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "mediastore.ap-northeast-2.amazonaws.com" + | "ap-southeast-2" -> Some "mediastore.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "mediastore.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "mediastore.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "mediastore.us-east-1.amazonaws.com" + | "us-west-2" -> Some "mediastore.us-west-2.amazonaws.com" + | _ -> None) + | "metering.marketplace" -> + (match region with + | "ap-northeast-1" -> + Some "metering.marketplace.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "metering.marketplace.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "metering.marketplace.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "metering.marketplace.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "metering.marketplace.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> + Some "metering.marketplace.ca-central-1.amazonaws.com" + | "eu-central-1" -> + Some "metering.marketplace.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "metering.marketplace.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "metering.marketplace.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "metering.marketplace.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "metering.marketplace.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "metering.marketplace.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "metering.marketplace.us-east-1.amazonaws.com" + | "us-east-2" -> Some "metering.marketplace.us-east-2.amazonaws.com" + | "us-west-1" -> Some "metering.marketplace.us-west-1.amazonaws.com" + | "us-west-2" -> Some "metering.marketplace.us-west-2.amazonaws.com" + | _ -> None) + | "mgh" -> + (match region with + | "us-west-2" -> Some "mgh.us-west-2.amazonaws.com" + | _ -> None) + | "mobileanalytics" -> + (match region with + | "us-east-1" -> Some "mobileanalytics.us-east-1.amazonaws.com" + | _ -> None) + | "models.lex" -> + (match region with + | "eu-west-1" -> Some "models.lex.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "models.lex.us-east-1.amazonaws.com" + | "us-west-2" -> Some "models.lex.us-west-2.amazonaws.com" + | _ -> None) + | "monitoring" -> + (match region with + | "ap-northeast-1" -> Some "monitoring.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "monitoring.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "monitoring.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "monitoring.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "monitoring.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "monitoring.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "monitoring.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "monitoring.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "monitoring.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "monitoring.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "monitoring.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "monitoring.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "monitoring.us-east-1.amazonaws.com" + | "us-east-2" -> Some "monitoring.us-east-2.amazonaws.com" + | "us-west-1" -> Some "monitoring.us-west-1.amazonaws.com" + | "us-west-2" -> Some "monitoring.us-west-2.amazonaws.com" + | _ -> None) + | "mq" -> + (match region with + | "ap-northeast-1" -> Some "mq.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "mq.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> Some "mq.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "mq.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "mq.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "mq.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "mq.us-east-1.amazonaws.com" + | "us-east-2" -> Some "mq.us-east-2.amazonaws.com" + | "us-west-1" -> Some "mq.us-west-1.amazonaws.com" + | "us-west-2" -> Some "mq.us-west-2.amazonaws.com" + | _ -> None) + | "mturk-requester" -> + (match region with + | "sandbox" -> Some "mturk-requester-sandbox.us-east-1.amazonaws.com" + | "us-east-1" -> Some "mturk-requester.us-east-1.amazonaws.com" + | _ -> None) + | "neptune" -> + (match region with + | "ap-northeast-1" -> Some "rds.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> Some "rds.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "rds.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "rds.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "rds.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "rds.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "rds.us-east-1.amazonaws.com" + | "us-east-2" -> Some "rds.us-east-2.amazonaws.com" + | "us-west-2" -> Some "rds.us-west-2.amazonaws.com" + | _ -> None) + | "opsworks" -> + (match region with + | "ap-northeast-1" -> Some "opsworks.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "opsworks.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "opsworks.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "opsworks.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "opsworks.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "opsworks.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "opsworks.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "opsworks.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "opsworks.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "opsworks.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "opsworks.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "opsworks.us-east-1.amazonaws.com" + | "us-east-2" -> Some "opsworks.us-east-2.amazonaws.com" + | "us-west-1" -> Some "opsworks.us-west-1.amazonaws.com" + | "us-west-2" -> Some "opsworks.us-west-2.amazonaws.com" + | _ -> None) + | "opsworks-cm" -> + (match region with + | "ap-northeast-1" -> Some "opsworks-cm.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> Some "opsworks-cm.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "opsworks-cm.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "opsworks-cm.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "opsworks-cm.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "opsworks-cm.us-east-1.amazonaws.com" + | "us-east-2" -> Some "opsworks-cm.us-east-2.amazonaws.com" + | "us-west-1" -> Some "opsworks-cm.us-west-1.amazonaws.com" + | "us-west-2" -> Some "opsworks-cm.us-west-2.amazonaws.com" + | _ -> None) + | "organizations" -> + (match region with + | "aws-global" -> Some "organizations.us-east-1.amazonaws.com" + | _ -> None) + | "pinpoint" -> + (match region with + | "eu-central-1" -> Some "pinpoint.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "pinpoint.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "pinpoint.us-east-1.amazonaws.com" + | "us-west-2" -> Some "pinpoint.us-west-2.amazonaws.com" + | _ -> None) + | "polly" -> + (match region with + | "ap-northeast-1" -> Some "polly.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "polly.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "polly.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "polly.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "polly.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "polly.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "polly.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "polly.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "polly.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "polly.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "polly.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "polly.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "polly.us-east-1.amazonaws.com" + | "us-east-2" -> Some "polly.us-east-2.amazonaws.com" + | "us-west-1" -> Some "polly.us-west-1.amazonaws.com" + | "us-west-2" -> Some "polly.us-west-2.amazonaws.com" + | _ -> None) + | "rds" -> + (match region with + | "ap-northeast-1" -> Some "rds.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "rds.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "rds.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "rds.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "rds.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "rds.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "rds.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "rds.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "rds.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "rds.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "rds.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "rds.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "rds.us-east-1.amazonaws.com" + | "us-east-2" -> Some "rds.us-east-2.amazonaws.com" + | "us-west-1" -> Some "rds.us-west-1.amazonaws.com" + | "us-west-2" -> Some "rds.us-west-2.amazonaws.com" + | _ -> None) + | "redshift" -> + (match region with + | "ap-northeast-1" -> Some "redshift.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "redshift.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "redshift.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "redshift.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "redshift.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "redshift.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "redshift.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "redshift.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "redshift.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "redshift.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "redshift.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "redshift.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "redshift.us-east-1.amazonaws.com" + | "us-east-2" -> Some "redshift.us-east-2.amazonaws.com" + | "us-west-1" -> Some "redshift.us-west-1.amazonaws.com" + | "us-west-2" -> Some "redshift.us-west-2.amazonaws.com" + | _ -> None) + | "rekognition" -> + (match region with + | "ap-northeast-1" -> Some "rekognition.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "rekognition.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "rekognition.ap-south-1.amazonaws.com" + | "ap-southeast-2" -> Some "rekognition.ap-southeast-2.amazonaws.com" + | "eu-west-1" -> Some "rekognition.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "rekognition.us-east-1.amazonaws.com" + | "us-east-2" -> Some "rekognition.us-east-2.amazonaws.com" + | "us-west-2" -> Some "rekognition.us-west-2.amazonaws.com" + | _ -> None) + | "resource-groups" -> + (match region with + | "ap-northeast-1" -> + Some "resource-groups.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "resource-groups.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "resource-groups.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "resource-groups.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "resource-groups.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "resource-groups.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "resource-groups.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "resource-groups.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "resource-groups.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "resource-groups.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "resource-groups.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "resource-groups.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "resource-groups.us-east-1.amazonaws.com" + | "us-east-2" -> Some "resource-groups.us-east-2.amazonaws.com" + | "us-west-1" -> Some "resource-groups.us-west-1.amazonaws.com" + | "us-west-2" -> Some "resource-groups.us-west-2.amazonaws.com" + | _ -> None) + | "robomaker" -> + (match region with + | "eu-west-1" -> Some "robomaker.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "robomaker.us-east-1.amazonaws.com" + | "us-west-2" -> Some "robomaker.us-west-2.amazonaws.com" + | _ -> None) + | "route53" -> + (match region with + | "aws-global" -> Some "route53.amazonaws.com" + | _ -> None) + | "route53domains" -> + (match region with + | "us-east-1" -> Some "route53domains.us-east-1.amazonaws.com" + | _ -> None) + | "route53resolver" -> + (match region with + | "ap-northeast-1" -> + Some "route53resolver.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "route53resolver.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "route53resolver.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "route53resolver.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "route53resolver.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "route53resolver.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "route53resolver.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "route53resolver.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "route53resolver.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "route53resolver.eu-west-3.amazonaws.com" + | "us-east-1" -> Some "route53resolver.us-east-1.amazonaws.com" + | "us-east-2" -> Some "route53resolver.us-east-2.amazonaws.com" + | "us-west-1" -> Some "route53resolver.us-west-1.amazonaws.com" + | "us-west-2" -> Some "route53resolver.us-west-2.amazonaws.com" + | _ -> None) + | "runtime.lex" -> + (match region with + | "eu-west-1" -> Some "runtime.lex.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "runtime.lex.us-east-1.amazonaws.com" + | "us-west-2" -> Some "runtime.lex.us-west-2.amazonaws.com" + | _ -> None) + | "runtime.sagemaker" -> + (match region with + | "ap-northeast-1" -> + Some "runtime.sagemaker.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "runtime.sagemaker.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "runtime.sagemaker.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "runtime.sagemaker.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "runtime.sagemaker.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> + Some "runtime.sagemaker.ca-central-1.amazonaws.com" + | "eu-central-1" -> + Some "runtime.sagemaker.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "runtime.sagemaker.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "runtime.sagemaker.eu-west-2.amazonaws.com" + | "us-east-1" -> Some "runtime.sagemaker.us-east-1.amazonaws.com" + | "us-east-2" -> Some "runtime.sagemaker.us-east-2.amazonaws.com" + | "us-west-1" -> Some "runtime.sagemaker.us-west-1.amazonaws.com" + | "us-west-2" -> Some "runtime.sagemaker.us-west-2.amazonaws.com" + | _ -> None) + | "s3" -> + (match region with + | "ap-northeast-1" -> Some "s3.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "s3.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "s3.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "s3.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "s3.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "s3.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "s3.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "s3.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "s3.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "s3.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "s3.eu-west-3.amazonaws.com" + | "s3-external-1" -> Some "s3-external-1.amazonaws.com" + | "sa-east-1" -> Some "s3.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "s3.amazonaws.com" + | "us-east-2" -> Some "s3.us-east-2.amazonaws.com" + | "us-west-1" -> Some "s3.us-west-1.amazonaws.com" + | "us-west-2" -> Some "s3.us-west-2.amazonaws.com" + | _ -> None) + | "s3-control" -> + (match region with + | "ap-northeast-1" -> Some "s3-control.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "s3-control.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "s3-control.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "s3-control.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "s3-control.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "s3-control.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "s3-control.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "s3-control.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "s3-control.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "s3-control.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "s3-control.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "s3-control.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "s3-control.us-east-1.amazonaws.com" + | "us-east-1-fips" -> Some "s3-control-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "s3-control.us-east-2.amazonaws.com" + | "us-east-2-fips" -> Some "s3-control-fips.us-east-2.amazonaws.com" + | "us-west-1" -> Some "s3-control.us-west-1.amazonaws.com" + | "us-west-1-fips" -> Some "s3-control-fips.us-west-1.amazonaws.com" + | "us-west-2" -> Some "s3-control.us-west-2.amazonaws.com" + | "us-west-2-fips" -> Some "s3-control-fips.us-west-2.amazonaws.com" + | _ -> None) + | "sdb" -> + (match region with + | "ap-northeast-1" -> Some "sdb.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> Some "sdb.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "sdb.ap-southeast-2.amazonaws.com" + | "eu-west-1" -> Some "sdb.eu-west-1.amazonaws.com" + | "sa-east-1" -> Some "sdb.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "sdb.amazonaws.com" + | "us-west-1" -> Some "sdb.us-west-1.amazonaws.com" + | "us-west-2" -> Some "sdb.us-west-2.amazonaws.com" + | _ -> None) + | "secretsmanager" -> + (match region with + | "ap-northeast-1" -> + Some "secretsmanager.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "secretsmanager.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "secretsmanager.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "secretsmanager.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "secretsmanager.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "secretsmanager.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "secretsmanager.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "secretsmanager.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "secretsmanager.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "secretsmanager.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "secretsmanager.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "secretsmanager.us-east-1.amazonaws.com" + | "us-east-1-fips" -> + Some "secretsmanager-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "secretsmanager.us-east-2.amazonaws.com" + | "us-east-2-fips" -> + Some "secretsmanager-fips.us-east-2.amazonaws.com" + | "us-west-1" -> Some "secretsmanager.us-west-1.amazonaws.com" + | "us-west-1-fips" -> + Some "secretsmanager-fips.us-west-1.amazonaws.com" + | "us-west-2" -> Some "secretsmanager.us-west-2.amazonaws.com" + | "us-west-2-fips" -> + Some "secretsmanager-fips.us-west-2.amazonaws.com" + | _ -> None) + | "securityhub" -> + (match region with + | "ap-northeast-1" -> Some "securityhub.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "securityhub.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "securityhub.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "securityhub.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "securityhub.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "securityhub.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "securityhub.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "securityhub.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "securityhub.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "securityhub.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "securityhub.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "securityhub.us-east-1.amazonaws.com" + | "us-east-2" -> Some "securityhub.us-east-2.amazonaws.com" + | "us-west-1" -> Some "securityhub.us-west-1.amazonaws.com" + | "us-west-2" -> Some "securityhub.us-west-2.amazonaws.com" + | _ -> None) + | "serverlessrepo" -> + (match region with + | "ap-northeast-1" -> + Some "serverlessrepo.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "serverlessrepo.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "serverlessrepo.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "serverlessrepo.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "serverlessrepo.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "serverlessrepo.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "serverlessrepo.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "serverlessrepo.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "serverlessrepo.eu-west-2.amazonaws.com" + | "sa-east-1" -> Some "serverlessrepo.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "serverlessrepo.us-east-1.amazonaws.com" + | "us-east-2" -> Some "serverlessrepo.us-east-2.amazonaws.com" + | "us-west-1" -> Some "serverlessrepo.us-west-1.amazonaws.com" + | "us-west-2" -> Some "serverlessrepo.us-west-2.amazonaws.com" + | _ -> None) + | "servicecatalog" -> + (match region with + | "ap-northeast-1" -> + Some "servicecatalog.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "servicecatalog.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "servicecatalog.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "servicecatalog.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "servicecatalog.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "servicecatalog.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "servicecatalog.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "servicecatalog.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "servicecatalog.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "servicecatalog.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "servicecatalog.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "servicecatalog.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "servicecatalog.us-east-1.amazonaws.com" + | "us-east-1-fips" -> + Some "servicecatalog-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "servicecatalog.us-east-2.amazonaws.com" + | "us-east-2-fips" -> + Some "servicecatalog-fips.us-east-2.amazonaws.com" + | "us-west-1" -> Some "servicecatalog.us-west-1.amazonaws.com" + | "us-west-1-fips" -> + Some "servicecatalog-fips.us-west-1.amazonaws.com" + | "us-west-2" -> Some "servicecatalog.us-west-2.amazonaws.com" + | "us-west-2-fips" -> + Some "servicecatalog-fips.us-west-2.amazonaws.com" + | _ -> None) + | "servicediscovery" -> + (match region with + | "ap-northeast-1" -> + Some "servicediscovery.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "servicediscovery.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "servicediscovery.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "servicediscovery.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "servicediscovery.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "servicediscovery.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "servicediscovery.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "servicediscovery.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "servicediscovery.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "servicediscovery.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "servicediscovery.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "servicediscovery.us-east-1.amazonaws.com" + | "us-east-2" -> Some "servicediscovery.us-east-2.amazonaws.com" + | "us-west-1" -> Some "servicediscovery.us-west-1.amazonaws.com" + | "us-west-2" -> Some "servicediscovery.us-west-2.amazonaws.com" + | _ -> None) + | "shield" -> + (match region with + | "us-east-1" -> Some "shield.us-east-1.amazonaws.com" + | _ -> None) + | "sms" -> + (match region with + | "ap-northeast-1" -> Some "sms.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "sms.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "sms.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "sms.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "sms.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "sms.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "sms.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "sms.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "sms.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "sms.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "sms.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "sms.us-east-1.amazonaws.com" + | "us-east-2" -> Some "sms.us-east-2.amazonaws.com" + | "us-west-1" -> Some "sms.us-west-1.amazonaws.com" + | "us-west-2" -> Some "sms.us-west-2.amazonaws.com" + | _ -> None) + | "snowball" -> + (match region with + | "ap-northeast-1" -> Some "snowball.ap-northeast-1.amazonaws.com" + | "ap-south-1" -> Some "snowball.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "snowball.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "snowball.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "snowball.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "snowball.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "snowball.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "snowball.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "snowball.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "snowball.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "snowball.us-east-1.amazonaws.com" + | "us-east-2" -> Some "snowball.us-east-2.amazonaws.com" + | "us-west-1" -> Some "snowball.us-west-1.amazonaws.com" + | "us-west-2" -> Some "snowball.us-west-2.amazonaws.com" + | _ -> None) + | "sns" -> + (match region with + | "ap-northeast-1" -> Some "sns.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "sns.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "sns.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "sns.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "sns.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "sns.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "sns.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "sns.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "sns.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "sns.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "sns.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "sns.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "sns.us-east-1.amazonaws.com" + | "us-east-2" -> Some "sns.us-east-2.amazonaws.com" + | "us-west-1" -> Some "sns.us-west-1.amazonaws.com" + | "us-west-2" -> Some "sns.us-west-2.amazonaws.com" + | _ -> None) + | "sqs" -> + (match region with + | "ap-northeast-1" -> Some "sqs.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "sqs.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "sqs.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "sqs.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "sqs.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "sqs.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "sqs.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "sqs.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "sqs.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "sqs.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "sqs.eu-west-3.amazonaws.com" + | "fips-us-east-1" -> Some "sqs-fips.us-east-1.amazonaws.com" + | "fips-us-east-2" -> Some "sqs-fips.us-east-2.amazonaws.com" + | "fips-us-west-1" -> Some "sqs-fips.us-west-1.amazonaws.com" + | "fips-us-west-2" -> Some "sqs-fips.us-west-2.amazonaws.com" + | "sa-east-1" -> Some "sqs.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "sqs.us-east-1.amazonaws.com" + | "us-east-2" -> Some "sqs.us-east-2.amazonaws.com" + | "us-west-1" -> Some "sqs.us-west-1.amazonaws.com" + | "us-west-2" -> Some "sqs.us-west-2.amazonaws.com" + | _ -> None) + | "ssm" -> + (match region with + | "ap-northeast-1" -> Some "ssm.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "ssm.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "ssm.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "ssm.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "ssm.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "ssm.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "ssm.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "ssm.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "ssm.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "ssm.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "ssm.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "ssm.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "ssm.us-east-1.amazonaws.com" + | "us-east-2" -> Some "ssm.us-east-2.amazonaws.com" + | "us-west-1" -> Some "ssm.us-west-1.amazonaws.com" + | "us-west-2" -> Some "ssm.us-west-2.amazonaws.com" + | _ -> None) + | "states" -> + (match region with + | "ap-northeast-1" -> Some "states.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "states.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "states.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "states.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "states.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "states.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "states.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "states.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "states.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "states.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "states.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "states.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "states.us-east-1.amazonaws.com" + | "us-east-2" -> Some "states.us-east-2.amazonaws.com" + | "us-west-1" -> Some "states.us-west-1.amazonaws.com" + | "us-west-2" -> Some "states.us-west-2.amazonaws.com" + | _ -> None) + | "storagegateway" -> + (match region with + | "ap-northeast-1" -> + Some "storagegateway.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "storagegateway.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "storagegateway.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "storagegateway.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "storagegateway.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "storagegateway.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "storagegateway.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "storagegateway.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "storagegateway.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "storagegateway.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "storagegateway.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "storagegateway.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "storagegateway.us-east-1.amazonaws.com" + | "us-east-2" -> Some "storagegateway.us-east-2.amazonaws.com" + | "us-west-1" -> Some "storagegateway.us-west-1.amazonaws.com" + | "us-west-2" -> Some "storagegateway.us-west-2.amazonaws.com" + | _ -> None) + | "streams.dynamodb" -> + (match region with + | "ap-northeast-1" -> + Some "streams.dynamodb.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> + Some "streams.dynamodb.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "streams.dynamodb.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> + Some "streams.dynamodb.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> + Some "streams.dynamodb.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "streams.dynamodb.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "streams.dynamodb.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "streams.dynamodb.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "streams.dynamodb.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "streams.dynamodb.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "streams.dynamodb.eu-west-3.amazonaws.com" + | "local" -> Some "localhost:8000" + | "sa-east-1" -> Some "streams.dynamodb.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "streams.dynamodb.us-east-1.amazonaws.com" + | "us-east-2" -> Some "streams.dynamodb.us-east-2.amazonaws.com" + | "us-west-1" -> Some "streams.dynamodb.us-west-1.amazonaws.com" + | "us-west-2" -> Some "streams.dynamodb.us-west-2.amazonaws.com" + | _ -> None) + | "sts" -> + (match region with + | "ap-northeast-1" -> Some "sts.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "sts.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "sts.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "sts.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "sts.ap-southeast-2.amazonaws.com" + | "aws-global" -> Some "sts.aws-global.amazonaws.com" + | "ca-central-1" -> Some "sts.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "sts.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "sts.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "sts.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "sts.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "sts.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "sts.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "sts.us-east-1.amazonaws.com" + | "us-east-1-fips" -> Some "sts-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "sts.us-east-2.amazonaws.com" + | "us-east-2-fips" -> Some "sts-fips.us-east-2.amazonaws.com" + | "us-west-1" -> Some "sts.us-west-1.amazonaws.com" + | "us-west-1-fips" -> Some "sts-fips.us-west-1.amazonaws.com" + | "us-west-2" -> Some "sts.us-west-2.amazonaws.com" + | "us-west-2-fips" -> Some "sts-fips.us-west-2.amazonaws.com" + | _ -> None) + | "support" -> + (match region with + | "us-east-1" -> Some "support.us-east-1.amazonaws.com" + | _ -> None) + | "swf" -> + (match region with + | "ap-northeast-1" -> Some "swf.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "swf.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "swf.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "swf.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "swf.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "swf.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "swf.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "swf.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "swf.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "swf.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "swf.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "swf.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "swf.us-east-1.amazonaws.com" + | "us-east-2" -> Some "swf.us-east-2.amazonaws.com" + | "us-west-1" -> Some "swf.us-west-1.amazonaws.com" + | "us-west-2" -> Some "swf.us-west-2.amazonaws.com" + | _ -> None) + | "tagging" -> + (match region with + | "ap-northeast-1" -> Some "tagging.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "tagging.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "tagging.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "tagging.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "tagging.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "tagging.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "tagging.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "tagging.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "tagging.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "tagging.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "tagging.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "tagging.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "tagging.us-east-1.amazonaws.com" + | "us-east-2" -> Some "tagging.us-east-2.amazonaws.com" + | "us-west-1" -> Some "tagging.us-west-1.amazonaws.com" + | "us-west-2" -> Some "tagging.us-west-2.amazonaws.com" + | _ -> None) + | "transfer" -> + (match region with + | "ap-northeast-1" -> Some "transfer.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "transfer.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "transfer.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "transfer.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "transfer.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "transfer.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "transfer.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "transfer.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "transfer.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "transfer.eu-west-3.amazonaws.com" + | "us-east-1" -> Some "transfer.us-east-1.amazonaws.com" + | "us-east-2" -> Some "transfer.us-east-2.amazonaws.com" + | "us-west-1" -> Some "transfer.us-west-1.amazonaws.com" + | "us-west-2" -> Some "transfer.us-west-2.amazonaws.com" + | _ -> None) + | "translate" -> + (match region with + | "eu-west-1" -> Some "translate.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "translate.us-east-1.amazonaws.com" + | "us-east-1-fips" -> Some "translate-fips.us-east-1.amazonaws.com" + | "us-east-2" -> Some "translate.us-east-2.amazonaws.com" + | "us-east-2-fips" -> Some "translate-fips.us-east-2.amazonaws.com" + | "us-west-2" -> Some "translate.us-west-2.amazonaws.com" + | "us-west-2-fips" -> Some "translate-fips.us-west-2.amazonaws.com" + | _ -> None) + | "waf" -> + (match region with + | "aws-global" -> Some "waf.amazonaws.com" + | _ -> None) + | "waf-regional" -> + (match region with + | "ap-northeast-1" -> Some "waf-regional.ap-northeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "waf-regional.ap-southeast-2.amazonaws.com" + | "eu-central-1" -> Some "waf-regional.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "waf-regional.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "waf-regional.us-east-1.amazonaws.com" + | "us-east-2" -> Some "waf-regional.us-east-2.amazonaws.com" + | "us-west-1" -> Some "waf-regional.us-west-1.amazonaws.com" + | "us-west-2" -> Some "waf-regional.us-west-2.amazonaws.com" + | _ -> None) + | "workdocs" -> + (match region with + | "ap-northeast-1" -> Some "workdocs.ap-northeast-1.amazonaws.com" + | "ap-southeast-1" -> Some "workdocs.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "workdocs.ap-southeast-2.amazonaws.com" + | "eu-west-1" -> Some "workdocs.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "workdocs.us-east-1.amazonaws.com" + | "us-west-2" -> Some "workdocs.us-west-2.amazonaws.com" + | _ -> None) + | "workmail" -> + (match region with + | "eu-west-1" -> Some "workmail.eu-west-1.amazonaws.com" + | "us-east-1" -> Some "workmail.us-east-1.amazonaws.com" + | "us-west-2" -> Some "workmail.us-west-2.amazonaws.com" + | _ -> None) + | "workspaces" -> + (match region with + | "ap-northeast-1" -> Some "workspaces.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "workspaces.ap-northeast-2.amazonaws.com" + | "ap-southeast-1" -> Some "workspaces.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "workspaces.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "workspaces.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "workspaces.eu-central-1.amazonaws.com" + | "eu-west-1" -> Some "workspaces.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "workspaces.eu-west-2.amazonaws.com" + | "sa-east-1" -> Some "workspaces.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "workspaces.us-east-1.amazonaws.com" + | "us-west-2" -> Some "workspaces.us-west-2.amazonaws.com" + | _ -> None) + | "xray" -> + (match region with + | "ap-northeast-1" -> Some "xray.ap-northeast-1.amazonaws.com" + | "ap-northeast-2" -> Some "xray.ap-northeast-2.amazonaws.com" + | "ap-south-1" -> Some "xray.ap-south-1.amazonaws.com" + | "ap-southeast-1" -> Some "xray.ap-southeast-1.amazonaws.com" + | "ap-southeast-2" -> Some "xray.ap-southeast-2.amazonaws.com" + | "ca-central-1" -> Some "xray.ca-central-1.amazonaws.com" + | "eu-central-1" -> Some "xray.eu-central-1.amazonaws.com" + | "eu-north-1" -> Some "xray.eu-north-1.amazonaws.com" + | "eu-west-1" -> Some "xray.eu-west-1.amazonaws.com" + | "eu-west-2" -> Some "xray.eu-west-2.amazonaws.com" + | "eu-west-3" -> Some "xray.eu-west-3.amazonaws.com" + | "sa-east-1" -> Some "xray.sa-east-1.amazonaws.com" + | "us-east-1" -> Some "xray.us-east-1.amazonaws.com" + | "us-east-2" -> Some "xray.us-east-2.amazonaws.com" + | "us-west-1" -> Some "xray.us-west-1.amazonaws.com" + | "us-west-2" -> Some "xray.us-west-2.amazonaws.com" + | _ -> None) + | _ -> None +let url_of svc_name region = + match endpoint_of svc_name region with + | Some var -> Some ("https://" ^ var) + | None -> None \ No newline at end of file diff --git a/libraries/autoscaling/lib/attachInstances.ml b/libraries/autoscaling/lib/attachInstances.ml index 9c3e1f8b7..1cc92672b 100644 --- a/libraries/autoscaling/lib/attachInstances.ml +++ b/libraries/autoscaling/lib/attachInstances.ml @@ -4,9 +4,11 @@ type input = AttachInstancesQuery.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["AttachInstances"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/attachLoadBalancers.ml b/libraries/autoscaling/lib/attachLoadBalancers.ml index a3f7eef18..b0eb691a3 100644 --- a/libraries/autoscaling/lib/attachLoadBalancers.ml +++ b/libraries/autoscaling/lib/attachLoadBalancers.ml @@ -4,9 +4,11 @@ type input = AttachLoadBalancersType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["AttachLoadBalancers"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/completeLifecycleAction.ml b/libraries/autoscaling/lib/completeLifecycleAction.ml index 665ec5701..c7bfecfe9 100644 --- a/libraries/autoscaling/lib/completeLifecycleAction.ml +++ b/libraries/autoscaling/lib/completeLifecycleAction.ml @@ -4,9 +4,11 @@ type input = CompleteLifecycleActionType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["CompleteLifecycleAction"])] diff --git a/libraries/autoscaling/lib/createAutoScalingGroup.ml b/libraries/autoscaling/lib/createAutoScalingGroup.ml index 588e32f2e..63ba51ebe 100644 --- a/libraries/autoscaling/lib/createAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/createAutoScalingGroup.ml @@ -4,9 +4,11 @@ type input = CreateAutoScalingGroupType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["CreateAutoScalingGroup"])] diff --git a/libraries/autoscaling/lib/createLaunchConfiguration.ml b/libraries/autoscaling/lib/createLaunchConfiguration.ml index f2f8f2612..e49b71654 100644 --- a/libraries/autoscaling/lib/createLaunchConfiguration.ml +++ b/libraries/autoscaling/lib/createLaunchConfiguration.ml @@ -4,9 +4,11 @@ type input = CreateLaunchConfigurationType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["CreateLaunchConfiguration"])] diff --git a/libraries/autoscaling/lib/createOrUpdateTags.ml b/libraries/autoscaling/lib/createOrUpdateTags.ml index eba52e79d..a0af14969 100644 --- a/libraries/autoscaling/lib/createOrUpdateTags.ml +++ b/libraries/autoscaling/lib/createOrUpdateTags.ml @@ -4,9 +4,11 @@ type input = CreateOrUpdateTagsType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["CreateOrUpdateTags"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/deleteAutoScalingGroup.ml b/libraries/autoscaling/lib/deleteAutoScalingGroup.ml index 7616e0260..b49977b4e 100644 --- a/libraries/autoscaling/lib/deleteAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/deleteAutoScalingGroup.ml @@ -4,9 +4,11 @@ type input = DeleteAutoScalingGroupType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteAutoScalingGroup"])] diff --git a/libraries/autoscaling/lib/deleteLaunchConfiguration.ml b/libraries/autoscaling/lib/deleteLaunchConfiguration.ml index 27b225233..c26680881 100644 --- a/libraries/autoscaling/lib/deleteLaunchConfiguration.ml +++ b/libraries/autoscaling/lib/deleteLaunchConfiguration.ml @@ -4,9 +4,11 @@ type input = LaunchConfigurationNameType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteLaunchConfiguration"])] diff --git a/libraries/autoscaling/lib/deleteLifecycleHook.ml b/libraries/autoscaling/lib/deleteLifecycleHook.ml index bb64ebcff..3f0cb48a0 100644 --- a/libraries/autoscaling/lib/deleteLifecycleHook.ml +++ b/libraries/autoscaling/lib/deleteLifecycleHook.ml @@ -4,9 +4,11 @@ type input = DeleteLifecycleHookType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteLifecycleHook"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/deleteNotificationConfiguration.ml b/libraries/autoscaling/lib/deleteNotificationConfiguration.ml index 8e6f81507..70fc52f04 100644 --- a/libraries/autoscaling/lib/deleteNotificationConfiguration.ml +++ b/libraries/autoscaling/lib/deleteNotificationConfiguration.ml @@ -4,9 +4,11 @@ type input = DeleteNotificationConfigurationType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteNotificationConfiguration"])] diff --git a/libraries/autoscaling/lib/deletePolicy.ml b/libraries/autoscaling/lib/deletePolicy.ml index 3856acf86..fb529bbd5 100644 --- a/libraries/autoscaling/lib/deletePolicy.ml +++ b/libraries/autoscaling/lib/deletePolicy.ml @@ -4,9 +4,11 @@ type input = DeletePolicyType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeletePolicy"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/deleteScheduledAction.ml b/libraries/autoscaling/lib/deleteScheduledAction.ml index 20324b3e9..e6dd7ca4e 100644 --- a/libraries/autoscaling/lib/deleteScheduledAction.ml +++ b/libraries/autoscaling/lib/deleteScheduledAction.ml @@ -4,9 +4,11 @@ type input = DeleteScheduledActionType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteScheduledAction"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/deleteTags.ml b/libraries/autoscaling/lib/deleteTags.ml index 192d1abb2..18de49e49 100644 --- a/libraries/autoscaling/lib/deleteTags.ml +++ b/libraries/autoscaling/lib/deleteTags.ml @@ -4,9 +4,11 @@ type input = DeleteTagsType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DeleteTags"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/autoscaling/lib/describeAccountLimits.ml b/libraries/autoscaling/lib/describeAccountLimits.ml index ead494b27..52dd4909b 100644 --- a/libraries/autoscaling/lib/describeAccountLimits.ml +++ b/libraries/autoscaling/lib/describeAccountLimits.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = DescribeAccountLimitsAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeAccountLimits"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/describeAdjustmentTypes.ml b/libraries/autoscaling/lib/describeAdjustmentTypes.ml index 4ef557022..6673c0816 100644 --- a/libraries/autoscaling/lib/describeAdjustmentTypes.ml +++ b/libraries/autoscaling/lib/describeAdjustmentTypes.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = DescribeAdjustmentTypesAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeAdjustmentTypes"])] diff --git a/libraries/autoscaling/lib/describeAutoScalingGroups.ml b/libraries/autoscaling/lib/describeAutoScalingGroups.ml index 94ff78c3d..6a0698214 100644 --- a/libraries/autoscaling/lib/describeAutoScalingGroups.ml +++ b/libraries/autoscaling/lib/describeAutoScalingGroups.ml @@ -4,9 +4,11 @@ type input = AutoScalingGroupNamesType.t type output = AutoScalingGroupsType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeAutoScalingGroups"])] diff --git a/libraries/autoscaling/lib/describeAutoScalingInstances.ml b/libraries/autoscaling/lib/describeAutoScalingInstances.ml index 50f9e793b..6dae2a7d6 100644 --- a/libraries/autoscaling/lib/describeAutoScalingInstances.ml +++ b/libraries/autoscaling/lib/describeAutoScalingInstances.ml @@ -4,9 +4,11 @@ type input = DescribeAutoScalingInstancesType.t type output = AutoScalingInstancesType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeAutoScalingInstances"])] diff --git a/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml b/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml index 023411728..2cffaa4ec 100644 --- a/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml +++ b/libraries/autoscaling/lib/describeAutoScalingNotificationTypes.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = DescribeAutoScalingNotificationTypesAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeAutoScalingNotificationTypes"])] diff --git a/libraries/autoscaling/lib/describeLaunchConfigurations.ml b/libraries/autoscaling/lib/describeLaunchConfigurations.ml index e3c58b1f4..3c2e147be 100644 --- a/libraries/autoscaling/lib/describeLaunchConfigurations.ml +++ b/libraries/autoscaling/lib/describeLaunchConfigurations.ml @@ -4,9 +4,11 @@ type input = LaunchConfigurationNamesType.t type output = LaunchConfigurationsType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeLaunchConfigurations"])] diff --git a/libraries/autoscaling/lib/describeLifecycleHookTypes.ml b/libraries/autoscaling/lib/describeLifecycleHookTypes.ml index a932d529c..22b86f5bf 100644 --- a/libraries/autoscaling/lib/describeLifecycleHookTypes.ml +++ b/libraries/autoscaling/lib/describeLifecycleHookTypes.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = DescribeLifecycleHookTypesAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeLifecycleHookTypes"])] diff --git a/libraries/autoscaling/lib/describeLifecycleHooks.ml b/libraries/autoscaling/lib/describeLifecycleHooks.ml index 159e1a8df..ef228adc0 100644 --- a/libraries/autoscaling/lib/describeLifecycleHooks.ml +++ b/libraries/autoscaling/lib/describeLifecycleHooks.ml @@ -4,9 +4,11 @@ type input = DescribeLifecycleHooksType.t type output = DescribeLifecycleHooksAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeLifecycleHooks"])] diff --git a/libraries/autoscaling/lib/describeLoadBalancers.ml b/libraries/autoscaling/lib/describeLoadBalancers.ml index 1e7e3f396..473f4a86b 100644 --- a/libraries/autoscaling/lib/describeLoadBalancers.ml +++ b/libraries/autoscaling/lib/describeLoadBalancers.ml @@ -4,9 +4,11 @@ type input = DescribeLoadBalancersRequest.t type output = DescribeLoadBalancersResponse.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeLoadBalancers"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/describeMetricCollectionTypes.ml b/libraries/autoscaling/lib/describeMetricCollectionTypes.ml index 9351f4ca3..cff1b4d60 100644 --- a/libraries/autoscaling/lib/describeMetricCollectionTypes.ml +++ b/libraries/autoscaling/lib/describeMetricCollectionTypes.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = DescribeMetricCollectionTypesAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeMetricCollectionTypes"])] diff --git a/libraries/autoscaling/lib/describeNotificationConfigurations.ml b/libraries/autoscaling/lib/describeNotificationConfigurations.ml index 94da33828..708db4c01 100644 --- a/libraries/autoscaling/lib/describeNotificationConfigurations.ml +++ b/libraries/autoscaling/lib/describeNotificationConfigurations.ml @@ -4,9 +4,11 @@ type input = DescribeNotificationConfigurationsType.t type output = DescribeNotificationConfigurationsAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeNotificationConfigurations"])] diff --git a/libraries/autoscaling/lib/describePolicies.ml b/libraries/autoscaling/lib/describePolicies.ml index 092e03f66..1c6b225e4 100644 --- a/libraries/autoscaling/lib/describePolicies.ml +++ b/libraries/autoscaling/lib/describePolicies.ml @@ -4,9 +4,11 @@ type input = DescribePoliciesType.t type output = PoliciesType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribePolicies"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/describeScalingActivities.ml b/libraries/autoscaling/lib/describeScalingActivities.ml index df0a261be..005881bed 100644 --- a/libraries/autoscaling/lib/describeScalingActivities.ml +++ b/libraries/autoscaling/lib/describeScalingActivities.ml @@ -4,9 +4,11 @@ type input = DescribeScalingActivitiesType.t type output = ActivitiesType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeScalingActivities"])] diff --git a/libraries/autoscaling/lib/describeScalingProcessTypes.ml b/libraries/autoscaling/lib/describeScalingProcessTypes.ml index 11dacbac0..12713b3cd 100644 --- a/libraries/autoscaling/lib/describeScalingProcessTypes.ml +++ b/libraries/autoscaling/lib/describeScalingProcessTypes.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = ProcessesType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeScalingProcessTypes"])] diff --git a/libraries/autoscaling/lib/describeScheduledActions.ml b/libraries/autoscaling/lib/describeScheduledActions.ml index f94ffff94..60280d769 100644 --- a/libraries/autoscaling/lib/describeScheduledActions.ml +++ b/libraries/autoscaling/lib/describeScheduledActions.ml @@ -4,9 +4,11 @@ type input = DescribeScheduledActionsType.t type output = ScheduledActionsType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeScheduledActions"])] diff --git a/libraries/autoscaling/lib/describeTags.ml b/libraries/autoscaling/lib/describeTags.ml index f71703667..fd8fc6274 100644 --- a/libraries/autoscaling/lib/describeTags.ml +++ b/libraries/autoscaling/lib/describeTags.ml @@ -4,9 +4,11 @@ type input = DescribeTagsType.t type output = TagsType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeTags"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml b/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml index bea70eab0..29efa5024 100644 --- a/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml +++ b/libraries/autoscaling/lib/describeTerminationPolicyTypes.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = DescribeTerminationPolicyTypesAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DescribeTerminationPolicyTypes"])] diff --git a/libraries/autoscaling/lib/detachInstances.ml b/libraries/autoscaling/lib/detachInstances.ml index 4ae169466..e28ccd339 100644 --- a/libraries/autoscaling/lib/detachInstances.ml +++ b/libraries/autoscaling/lib/detachInstances.ml @@ -4,9 +4,11 @@ type input = DetachInstancesQuery.t type output = DetachInstancesAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DetachInstances"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/detachLoadBalancers.ml b/libraries/autoscaling/lib/detachLoadBalancers.ml index 6af7822d4..a51eda97e 100644 --- a/libraries/autoscaling/lib/detachLoadBalancers.ml +++ b/libraries/autoscaling/lib/detachLoadBalancers.ml @@ -4,9 +4,11 @@ type input = DetachLoadBalancersType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DetachLoadBalancers"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/disableMetricsCollection.ml b/libraries/autoscaling/lib/disableMetricsCollection.ml index 45a77cf07..03b25a48b 100644 --- a/libraries/autoscaling/lib/disableMetricsCollection.ml +++ b/libraries/autoscaling/lib/disableMetricsCollection.ml @@ -4,9 +4,11 @@ type input = DisableMetricsCollectionQuery.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["DisableMetricsCollection"])] diff --git a/libraries/autoscaling/lib/enableMetricsCollection.ml b/libraries/autoscaling/lib/enableMetricsCollection.ml index 778bf0030..54b064654 100644 --- a/libraries/autoscaling/lib/enableMetricsCollection.ml +++ b/libraries/autoscaling/lib/enableMetricsCollection.ml @@ -4,9 +4,11 @@ type input = EnableMetricsCollectionQuery.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["EnableMetricsCollection"])] diff --git a/libraries/autoscaling/lib/enterStandby.ml b/libraries/autoscaling/lib/enterStandby.ml index 42c0aca21..2abbbe93a 100644 --- a/libraries/autoscaling/lib/enterStandby.ml +++ b/libraries/autoscaling/lib/enterStandby.ml @@ -4,9 +4,11 @@ type input = EnterStandbyQuery.t type output = EnterStandbyAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["EnterStandby"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/executePolicy.ml b/libraries/autoscaling/lib/executePolicy.ml index fbb046460..cfcc2b73c 100644 --- a/libraries/autoscaling/lib/executePolicy.ml +++ b/libraries/autoscaling/lib/executePolicy.ml @@ -4,9 +4,11 @@ type input = ExecutePolicyType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["ExecutePolicy"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/exitStandby.ml b/libraries/autoscaling/lib/exitStandby.ml index 159b97c87..130d61d4d 100644 --- a/libraries/autoscaling/lib/exitStandby.ml +++ b/libraries/autoscaling/lib/exitStandby.ml @@ -4,9 +4,11 @@ type input = ExitStandbyQuery.t type output = ExitStandbyAnswer.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["ExitStandby"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/autoscaling/lib/putLifecycleHook.ml b/libraries/autoscaling/lib/putLifecycleHook.ml index bd6fe31df..8d202543e 100644 --- a/libraries/autoscaling/lib/putLifecycleHook.ml +++ b/libraries/autoscaling/lib/putLifecycleHook.ml @@ -4,9 +4,11 @@ type input = PutLifecycleHookType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["PutLifecycleHook"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/putNotificationConfiguration.ml b/libraries/autoscaling/lib/putNotificationConfiguration.ml index 058360ff0..53ea5468b 100644 --- a/libraries/autoscaling/lib/putNotificationConfiguration.ml +++ b/libraries/autoscaling/lib/putNotificationConfiguration.ml @@ -4,9 +4,11 @@ type input = PutNotificationConfigurationType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["PutNotificationConfiguration"])] diff --git a/libraries/autoscaling/lib/putScalingPolicy.ml b/libraries/autoscaling/lib/putScalingPolicy.ml index d4bf7fa10..b4002cc6a 100644 --- a/libraries/autoscaling/lib/putScalingPolicy.ml +++ b/libraries/autoscaling/lib/putScalingPolicy.ml @@ -4,9 +4,11 @@ type input = PutScalingPolicyType.t type output = PolicyARNType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["PutScalingPolicy"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml b/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml index 0f7fd74a7..de01072a3 100644 --- a/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml +++ b/libraries/autoscaling/lib/putScheduledUpdateGroupAction.ml @@ -4,9 +4,11 @@ type input = PutScheduledUpdateGroupActionType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["PutScheduledUpdateGroupAction"])] diff --git a/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml b/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml index 4b8bd5824..4cb2e7762 100644 --- a/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml +++ b/libraries/autoscaling/lib/recordLifecycleActionHeartbeat.ml @@ -4,9 +4,11 @@ type input = RecordLifecycleActionHeartbeatType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["RecordLifecycleActionHeartbeat"])] diff --git a/libraries/autoscaling/lib/resumeProcesses.ml b/libraries/autoscaling/lib/resumeProcesses.ml index fdd68e148..debb619ce 100644 --- a/libraries/autoscaling/lib/resumeProcesses.ml +++ b/libraries/autoscaling/lib/resumeProcesses.ml @@ -4,9 +4,11 @@ type input = ScalingProcessQuery.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["ResumeProcesses"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/setDesiredCapacity.ml b/libraries/autoscaling/lib/setDesiredCapacity.ml index df144af71..167b4d7f7 100644 --- a/libraries/autoscaling/lib/setDesiredCapacity.ml +++ b/libraries/autoscaling/lib/setDesiredCapacity.ml @@ -4,9 +4,11 @@ type input = SetDesiredCapacityType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["SetDesiredCapacity"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/setInstanceHealth.ml b/libraries/autoscaling/lib/setInstanceHealth.ml index c2b9648bd..d85df9b2e 100644 --- a/libraries/autoscaling/lib/setInstanceHealth.ml +++ b/libraries/autoscaling/lib/setInstanceHealth.ml @@ -4,9 +4,11 @@ type input = SetInstanceHealthQuery.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["SetInstanceHealth"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/suspendProcesses.ml b/libraries/autoscaling/lib/suspendProcesses.ml index da4aaf12a..4680e2450 100644 --- a/libraries/autoscaling/lib/suspendProcesses.ml +++ b/libraries/autoscaling/lib/suspendProcesses.ml @@ -4,9 +4,11 @@ type input = ScalingProcessQuery.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["SuspendProcesses"])] (Util.drop_empty diff --git a/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml b/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml index 74a70e228..2fd418f2d 100644 --- a/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/terminateInstanceInAutoScalingGroup.ml @@ -4,9 +4,11 @@ type input = TerminateInstanceInAutoScalingGroupType.t type output = ActivityType.t type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["TerminateInstanceInAutoScalingGroup"])] diff --git a/libraries/autoscaling/lib/types.ml b/libraries/autoscaling/lib/types.ml index e399f66e7..d9a8a7042 100644 --- a/libraries/autoscaling/lib/types.ml +++ b/libraries/autoscaling/lib/types.ml @@ -46,6 +46,8 @@ module LifecycleState = (Pending_Proceed, "Pending:Proceed"); (Pending_Wait, "Pending:Wait"); (Pending, "Pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -565,6 +567,8 @@ module ScalingActivityStatusCode = (WaitingForInstanceId, "WaitingForInstanceId"); (WaitingForSpotInstanceId, "WaitingForSpotInstanceId"); (WaitingForSpotInstanceRequestId, "WaitingForSpotInstanceRequestId")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/autoscaling/lib/updateAutoScalingGroup.ml b/libraries/autoscaling/lib/updateAutoScalingGroup.ml index 9cdd59bff..59f503909 100644 --- a/libraries/autoscaling/lib/updateAutoScalingGroup.ml +++ b/libraries/autoscaling/lib/updateAutoScalingGroup.ml @@ -4,9 +4,11 @@ type input = UpdateAutoScalingGroupType.t type output = unit type error = Errors_internal.t let service = "autoscaling" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://autoscaling.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-01-01"]); ("Action", ["UpdateAutoScalingGroup"])] diff --git a/libraries/autoscaling/lib_test/aws_autoscaling_test.ml b/libraries/autoscaling/lib_test/aws_autoscaling_test.ml index a3df108d6..a8e6500c7 100644 --- a/libraries/autoscaling/lib_test/aws_autoscaling_test.ml +++ b/libraries/autoscaling/lib_test/aws_autoscaling_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop AUTOSCALING test succeeds" - @?false + @?true let test_cases = [ "AUTOSCALING noop" >:: noop_test ] diff --git a/libraries/cloudformation/lib/cancelUpdateStack.ml b/libraries/cloudformation/lib/cancelUpdateStack.ml index 7f88a854d..ecea8b34c 100644 --- a/libraries/cloudformation/lib/cancelUpdateStack.ml +++ b/libraries/cloudformation/lib/cancelUpdateStack.ml @@ -4,10 +4,11 @@ type input = CancelUpdateStackInput.t type output = unit type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["CancelUpdateStack"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/createStack.ml b/libraries/cloudformation/lib/createStack.ml index d4d732579..eeeb6f888 100644 --- a/libraries/cloudformation/lib/createStack.ml +++ b/libraries/cloudformation/lib/createStack.ml @@ -4,10 +4,11 @@ type input = CreateStackInput.t type output = CreateStackOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["CreateStack"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudformation/lib/deleteStack.ml b/libraries/cloudformation/lib/deleteStack.ml index 5992e3ef4..95ea1fe29 100644 --- a/libraries/cloudformation/lib/deleteStack.ml +++ b/libraries/cloudformation/lib/deleteStack.ml @@ -4,10 +4,11 @@ type input = DeleteStackInput.t type output = unit type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["DeleteStack"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudformation/lib/describeStackEvents.ml b/libraries/cloudformation/lib/describeStackEvents.ml index 4ff857308..6c451dc96 100644 --- a/libraries/cloudformation/lib/describeStackEvents.ml +++ b/libraries/cloudformation/lib/describeStackEvents.ml @@ -4,10 +4,11 @@ type input = DescribeStackEventsInput.t type output = DescribeStackEventsOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["DescribeStackEvents"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/describeStackResource.ml b/libraries/cloudformation/lib/describeStackResource.ml index 2569e98ad..d2de062ca 100644 --- a/libraries/cloudformation/lib/describeStackResource.ml +++ b/libraries/cloudformation/lib/describeStackResource.ml @@ -4,10 +4,11 @@ type input = DescribeStackResourceInput.t type output = DescribeStackResourceOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["DescribeStackResource"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/describeStackResources.ml b/libraries/cloudformation/lib/describeStackResources.ml index 280efd3f5..3d9338267 100644 --- a/libraries/cloudformation/lib/describeStackResources.ml +++ b/libraries/cloudformation/lib/describeStackResources.ml @@ -4,10 +4,11 @@ type input = DescribeStackResourcesInput.t type output = DescribeStackResourcesOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["DescribeStackResources"])] diff --git a/libraries/cloudformation/lib/describeStacks.ml b/libraries/cloudformation/lib/describeStacks.ml index 783e63443..9d7b6d906 100644 --- a/libraries/cloudformation/lib/describeStacks.ml +++ b/libraries/cloudformation/lib/describeStacks.ml @@ -4,10 +4,11 @@ type input = DescribeStacksInput.t type output = DescribeStacksOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["DescribeStacks"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/estimateTemplateCost.ml b/libraries/cloudformation/lib/estimateTemplateCost.ml index e6c91a8a8..0203b0ccc 100644 --- a/libraries/cloudformation/lib/estimateTemplateCost.ml +++ b/libraries/cloudformation/lib/estimateTemplateCost.ml @@ -4,10 +4,11 @@ type input = EstimateTemplateCostInput.t type output = EstimateTemplateCostOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["EstimateTemplateCost"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/getStackPolicy.ml b/libraries/cloudformation/lib/getStackPolicy.ml index 638c44425..1e2bf77f4 100644 --- a/libraries/cloudformation/lib/getStackPolicy.ml +++ b/libraries/cloudformation/lib/getStackPolicy.ml @@ -4,10 +4,11 @@ type input = GetStackPolicyInput.t type output = GetStackPolicyOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["GetStackPolicy"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/getTemplate.ml b/libraries/cloudformation/lib/getTemplate.ml index 70d7bf490..e7588740d 100644 --- a/libraries/cloudformation/lib/getTemplate.ml +++ b/libraries/cloudformation/lib/getTemplate.ml @@ -4,10 +4,11 @@ type input = GetTemplateInput.t type output = GetTemplateOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["GetTemplate"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudformation/lib/getTemplateSummary.ml b/libraries/cloudformation/lib/getTemplateSummary.ml index 6f7b57061..644beef3c 100644 --- a/libraries/cloudformation/lib/getTemplateSummary.ml +++ b/libraries/cloudformation/lib/getTemplateSummary.ml @@ -4,10 +4,11 @@ type input = GetTemplateSummaryInput.t type output = GetTemplateSummaryOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["GetTemplateSummary"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/listStackResources.ml b/libraries/cloudformation/lib/listStackResources.ml index 5f0b47b60..a3aa04fc5 100644 --- a/libraries/cloudformation/lib/listStackResources.ml +++ b/libraries/cloudformation/lib/listStackResources.ml @@ -4,10 +4,11 @@ type input = ListStackResourcesInput.t type output = ListStackResourcesOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["ListStackResources"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/listStacks.ml b/libraries/cloudformation/lib/listStacks.ml index ed06a6c4e..01180cd17 100644 --- a/libraries/cloudformation/lib/listStacks.ml +++ b/libraries/cloudformation/lib/listStacks.ml @@ -4,10 +4,11 @@ type input = ListStacksInput.t type output = ListStacksOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["ListStacks"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudformation/lib/setStackPolicy.ml b/libraries/cloudformation/lib/setStackPolicy.ml index dbe290381..716f3ad46 100644 --- a/libraries/cloudformation/lib/setStackPolicy.ml +++ b/libraries/cloudformation/lib/setStackPolicy.ml @@ -4,10 +4,11 @@ type input = SetStackPolicyInput.t type output = unit type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["SetStackPolicy"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/signalResource.ml b/libraries/cloudformation/lib/signalResource.ml index f7b6e6797..a8b725476 100644 --- a/libraries/cloudformation/lib/signalResource.ml +++ b/libraries/cloudformation/lib/signalResource.ml @@ -4,10 +4,11 @@ type input = SignalResourceInput.t type output = unit type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["SignalResource"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib/types.ml b/libraries/cloudformation/lib/types.ml index b5aa510d3..6a396d3cf 100644 --- a/libraries/cloudformation/lib/types.ml +++ b/libraries/cloudformation/lib/types.ml @@ -18,6 +18,8 @@ module Capability = | CAPABILITY_IAM let str_to_t = [("CAPABILITY_IAM", CAPABILITY_IAM)] let t_to_str = [(CAPABILITY_IAM, "CAPABILITY_IAM")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -190,6 +192,8 @@ module ResourceStatus = (CREATE_COMPLETE, "CREATE_COMPLETE"); (CREATE_FAILED, "CREATE_FAILED"); (CREATE_IN_PROGRESS, "CREATE_IN_PROGRESS")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -258,6 +262,8 @@ module StackStatus = (CREATE_COMPLETE, "CREATE_COMPLETE"); (CREATE_FAILED, "CREATE_FAILED"); (CREATE_IN_PROGRESS, "CREATE_IN_PROGRESS")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1197,6 +1203,8 @@ module ResourceSignalStatus = | FAILURE let str_to_t = [("FAILURE", FAILURE); ("SUCCESS", SUCCESS)] let t_to_str = [(FAILURE, "FAILURE"); (SUCCESS, "SUCCESS")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1400,6 +1408,8 @@ module OnFailure = [(DELETE, "DELETE"); (ROLLBACK, "ROLLBACK"); (DO_NOTHING, "DO_NOTHING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/cloudformation/lib/updateStack.ml b/libraries/cloudformation/lib/updateStack.ml index 6edb1eec4..7375dbd02 100644 --- a/libraries/cloudformation/lib/updateStack.ml +++ b/libraries/cloudformation/lib/updateStack.ml @@ -4,10 +4,11 @@ type input = UpdateStackInput.t type output = UpdateStackOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["UpdateStack"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudformation/lib/validateTemplate.ml b/libraries/cloudformation/lib/validateTemplate.ml index 65b9f5c49..cf087afeb 100644 --- a/libraries/cloudformation/lib/validateTemplate.ml +++ b/libraries/cloudformation/lib/validateTemplate.ml @@ -4,10 +4,11 @@ type input = ValidateTemplateInput.t type output = ValidateTemplateOutput.t type error = Errors_internal.t let service = "cloudformation" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://cloudformation.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-05-15"]); ("Action", ["ValidateTemplate"])] (Util.drop_empty diff --git a/libraries/cloudformation/lib_test/aws_cloudformation_test.ml b/libraries/cloudformation/lib_test/aws_cloudformation_test.ml index dfdb0f5e8..d179c827c 100644 --- a/libraries/cloudformation/lib_test/aws_cloudformation_test.ml +++ b/libraries/cloudformation/lib_test/aws_cloudformation_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop CLOUDFORMATION test succeeds" - @?false + @?true let test_cases = [ "CLOUDFORMATION noop" >:: noop_test ] diff --git a/libraries/cloudtrail/lib/createTrail.ml b/libraries/cloudtrail/lib/createTrail.ml index 2c51b04b3..1bde58868 100644 --- a/libraries/cloudtrail/lib/createTrail.ml +++ b/libraries/cloudtrail/lib/createTrail.ml @@ -4,9 +4,11 @@ type input = CreateTrailRequest.t type output = CreateTrailResponse.t type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["CreateTrail"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudtrail/lib/deleteTrail.ml b/libraries/cloudtrail/lib/deleteTrail.ml index ab7074bec..cb46482ec 100644 --- a/libraries/cloudtrail/lib/deleteTrail.ml +++ b/libraries/cloudtrail/lib/deleteTrail.ml @@ -4,9 +4,11 @@ type input = DeleteTrailRequest.t type output = unit type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["DeleteTrail"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudtrail/lib/describeTrails.ml b/libraries/cloudtrail/lib/describeTrails.ml index 3b3b288f7..30c3942a7 100644 --- a/libraries/cloudtrail/lib/describeTrails.ml +++ b/libraries/cloudtrail/lib/describeTrails.ml @@ -4,9 +4,11 @@ type input = DescribeTrailsRequest.t type output = DescribeTrailsResponse.t type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["DescribeTrails"])] (Util.drop_empty diff --git a/libraries/cloudtrail/lib/getTrailStatus.ml b/libraries/cloudtrail/lib/getTrailStatus.ml index 507809d31..9a8980499 100644 --- a/libraries/cloudtrail/lib/getTrailStatus.ml +++ b/libraries/cloudtrail/lib/getTrailStatus.ml @@ -4,9 +4,11 @@ type input = GetTrailStatusRequest.t type output = GetTrailStatusResponse.t type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["GetTrailStatus"])] (Util.drop_empty diff --git a/libraries/cloudtrail/lib/lookupEvents.ml b/libraries/cloudtrail/lib/lookupEvents.ml index 58186d75c..3206e037c 100644 --- a/libraries/cloudtrail/lib/lookupEvents.ml +++ b/libraries/cloudtrail/lib/lookupEvents.ml @@ -4,9 +4,11 @@ type input = LookupEventsRequest.t type output = LookupEventsResponse.t type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["LookupEvents"])] (Util.drop_empty diff --git a/libraries/cloudtrail/lib/startLogging.ml b/libraries/cloudtrail/lib/startLogging.ml index 4eb6b2c4c..67ef3c55e 100644 --- a/libraries/cloudtrail/lib/startLogging.ml +++ b/libraries/cloudtrail/lib/startLogging.ml @@ -4,9 +4,11 @@ type input = StartLoggingRequest.t type output = unit type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["StartLogging"])] (Util.drop_empty diff --git a/libraries/cloudtrail/lib/stopLogging.ml b/libraries/cloudtrail/lib/stopLogging.ml index a2aef7927..67be9a4b4 100644 --- a/libraries/cloudtrail/lib/stopLogging.ml +++ b/libraries/cloudtrail/lib/stopLogging.ml @@ -4,9 +4,11 @@ type input = StopLoggingRequest.t type output = unit type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["StopLogging"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudtrail/lib/types.ml b/libraries/cloudtrail/lib/types.ml index 0e38bb8fa..0324bdec1 100644 --- a/libraries/cloudtrail/lib/types.ml +++ b/libraries/cloudtrail/lib/types.ml @@ -60,6 +60,8 @@ module LookupAttributeKey = (Username, "Username"); (EventName, "EventName"); (EventId, "EventId")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/cloudtrail/lib/updateTrail.ml b/libraries/cloudtrail/lib/updateTrail.ml index c3a654f49..0ab46dda5 100644 --- a/libraries/cloudtrail/lib/updateTrail.ml +++ b/libraries/cloudtrail/lib/updateTrail.ml @@ -4,9 +4,11 @@ type input = UpdateTrailRequest.t type output = UpdateTrailResponse.t type error = Errors_internal.t let service = "cloudtrail" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://cloudtrail.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-11-01"]); ("Action", ["UpdateTrail"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudtrail/lib_test/aws_cloudtrail_test.ml b/libraries/cloudtrail/lib_test/aws_cloudtrail_test.ml index f9dd40229..34315482f 100644 --- a/libraries/cloudtrail/lib_test/aws_cloudtrail_test.ml +++ b/libraries/cloudtrail/lib_test/aws_cloudtrail_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop CLOUDTRAIL test succeeds" - @?false + @?true let test_cases = [ "CLOUDTRAIL noop" >:: noop_test ] diff --git a/libraries/cloudwatch/lib/deleteAlarms.ml b/libraries/cloudwatch/lib/deleteAlarms.ml index 0d893fffd..277505ec0 100644 --- a/libraries/cloudwatch/lib/deleteAlarms.ml +++ b/libraries/cloudwatch/lib/deleteAlarms.ml @@ -4,9 +4,11 @@ type input = DeleteAlarmsInput.t type output = unit type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["DeleteAlarms"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/describeAlarmHistory.ml b/libraries/cloudwatch/lib/describeAlarmHistory.ml index 5b03558e8..9c4072381 100644 --- a/libraries/cloudwatch/lib/describeAlarmHistory.ml +++ b/libraries/cloudwatch/lib/describeAlarmHistory.ml @@ -4,9 +4,11 @@ type input = DescribeAlarmHistoryInput.t type output = DescribeAlarmHistoryOutput.t type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["DescribeAlarmHistory"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/describeAlarms.ml b/libraries/cloudwatch/lib/describeAlarms.ml index 0d0729051..544599645 100644 --- a/libraries/cloudwatch/lib/describeAlarms.ml +++ b/libraries/cloudwatch/lib/describeAlarms.ml @@ -4,9 +4,11 @@ type input = DescribeAlarmsInput.t type output = DescribeAlarmsOutput.t type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["DescribeAlarms"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/describeAlarmsForMetric.ml b/libraries/cloudwatch/lib/describeAlarmsForMetric.ml index 2d735f337..1c5bf873a 100644 --- a/libraries/cloudwatch/lib/describeAlarmsForMetric.ml +++ b/libraries/cloudwatch/lib/describeAlarmsForMetric.ml @@ -4,9 +4,11 @@ type input = DescribeAlarmsForMetricInput.t type output = DescribeAlarmsForMetricOutput.t type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["DescribeAlarmsForMetric"])] diff --git a/libraries/cloudwatch/lib/disableAlarmActions.ml b/libraries/cloudwatch/lib/disableAlarmActions.ml index f23e8c5f7..8f25b3d26 100644 --- a/libraries/cloudwatch/lib/disableAlarmActions.ml +++ b/libraries/cloudwatch/lib/disableAlarmActions.ml @@ -4,9 +4,11 @@ type input = DisableAlarmActionsInput.t type output = unit type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["DisableAlarmActions"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/enableAlarmActions.ml b/libraries/cloudwatch/lib/enableAlarmActions.ml index ae8663845..d9c2c589e 100644 --- a/libraries/cloudwatch/lib/enableAlarmActions.ml +++ b/libraries/cloudwatch/lib/enableAlarmActions.ml @@ -4,9 +4,11 @@ type input = EnableAlarmActionsInput.t type output = unit type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["EnableAlarmActions"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/getMetricStatistics.ml b/libraries/cloudwatch/lib/getMetricStatistics.ml index b72c32384..6b3b65bdd 100644 --- a/libraries/cloudwatch/lib/getMetricStatistics.ml +++ b/libraries/cloudwatch/lib/getMetricStatistics.ml @@ -4,9 +4,11 @@ type input = GetMetricStatisticsInput.t type output = GetMetricStatisticsOutput.t type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["GetMetricStatistics"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/listMetrics.ml b/libraries/cloudwatch/lib/listMetrics.ml index 281344ff8..28d8e3a7f 100644 --- a/libraries/cloudwatch/lib/listMetrics.ml +++ b/libraries/cloudwatch/lib/listMetrics.ml @@ -4,9 +4,11 @@ type input = ListMetricsInput.t type output = ListMetricsOutput.t type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["ListMetrics"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/cloudwatch/lib/putMetricAlarm.ml b/libraries/cloudwatch/lib/putMetricAlarm.ml index 8d67bc6a7..92ca4680b 100644 --- a/libraries/cloudwatch/lib/putMetricAlarm.ml +++ b/libraries/cloudwatch/lib/putMetricAlarm.ml @@ -4,9 +4,11 @@ type input = PutMetricAlarmInput.t type output = unit type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["PutMetricAlarm"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/putMetricData.ml b/libraries/cloudwatch/lib/putMetricData.ml index 79ecb14d2..fb091169c 100644 --- a/libraries/cloudwatch/lib/putMetricData.ml +++ b/libraries/cloudwatch/lib/putMetricData.ml @@ -4,9 +4,11 @@ type input = PutMetricDataInput.t type output = unit type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["PutMetricData"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/setAlarmState.ml b/libraries/cloudwatch/lib/setAlarmState.ml index 35989a078..31b33f42b 100644 --- a/libraries/cloudwatch/lib/setAlarmState.ml +++ b/libraries/cloudwatch/lib/setAlarmState.ml @@ -4,9 +4,11 @@ type input = SetAlarmStateInput.t type output = unit type error = Errors_internal.t let service = "monitoring" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://monitoring.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2010-08-01"]); ("Action", ["SetAlarmState"])] (Util.drop_empty diff --git a/libraries/cloudwatch/lib/types.ml b/libraries/cloudwatch/lib/types.ml index c29ef8fb6..1e87a6c38 100644 --- a/libraries/cloudwatch/lib/types.ml +++ b/libraries/cloudwatch/lib/types.ml @@ -48,6 +48,8 @@ module HistoryItemType = [(Action, "Action"); (StateUpdate, "StateUpdate"); (ConfigurationUpdate, "ConfigurationUpdate")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -76,6 +78,8 @@ module ComparisonOperator = (LessThanThreshold, "LessThanThreshold"); (GreaterThanThreshold, "GreaterThanThreshold"); (GreaterThanOrEqualToThreshold, "GreaterThanOrEqualToThreshold")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -193,6 +197,8 @@ module StandardUnit = (Milliseconds, "Milliseconds"); (Microseconds, "Microseconds"); (Seconds, "Seconds")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -218,6 +224,8 @@ module StateValue = [(INSUFFICIENT_DATA, "INSUFFICIENT_DATA"); (ALARM, "ALARM"); (OK, "OK")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -249,6 +257,8 @@ module Statistic = (Sum, "Sum"); (Average, "Average"); (SampleCount, "SampleCount")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/cloudwatch/lib_test/aws_cloudwatch_test.ml b/libraries/cloudwatch/lib_test/aws_cloudwatch_test.ml index d26230342..7f025e911 100644 --- a/libraries/cloudwatch/lib_test/aws_cloudwatch_test.ml +++ b/libraries/cloudwatch/lib_test/aws_cloudwatch_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop CLOUDWATCH test succeeds" - @?false + @?true let test_cases = [ "CLOUDWATCH noop" >:: noop_test ] diff --git a/libraries/ec2/lib/acceptVpcPeeringConnection.ml b/libraries/ec2/lib/acceptVpcPeeringConnection.ml index 819213ebe..e108e3bb2 100644 --- a/libraries/ec2/lib/acceptVpcPeeringConnection.ml +++ b/libraries/ec2/lib/acceptVpcPeeringConnection.ml @@ -4,9 +4,11 @@ type input = AcceptVpcPeeringConnectionRequest.t type output = AcceptVpcPeeringConnectionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AcceptVpcPeeringConnection"])] diff --git a/libraries/ec2/lib/allocateAddress.ml b/libraries/ec2/lib/allocateAddress.ml index b3b84db83..d5b3f1660 100644 --- a/libraries/ec2/lib/allocateAddress.ml +++ b/libraries/ec2/lib/allocateAddress.ml @@ -4,9 +4,11 @@ type input = AllocateAddressRequest.t type output = AllocateAddressResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AllocateAddress"])] (Util.drop_empty diff --git a/libraries/ec2/lib/assignPrivateIpAddresses.ml b/libraries/ec2/lib/assignPrivateIpAddresses.ml index e669cad2b..c644281bd 100644 --- a/libraries/ec2/lib/assignPrivateIpAddresses.ml +++ b/libraries/ec2/lib/assignPrivateIpAddresses.ml @@ -4,9 +4,11 @@ type input = AssignPrivateIpAddressesRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AssignPrivateIpAddresses"])] diff --git a/libraries/ec2/lib/associateAddress.ml b/libraries/ec2/lib/associateAddress.ml index a86d367b7..df234e9ad 100644 --- a/libraries/ec2/lib/associateAddress.ml +++ b/libraries/ec2/lib/associateAddress.ml @@ -4,9 +4,11 @@ type input = AssociateAddressRequest.t type output = AssociateAddressResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AssociateAddress"])] (Util.drop_empty diff --git a/libraries/ec2/lib/associateDhcpOptions.ml b/libraries/ec2/lib/associateDhcpOptions.ml index 5d6cf4987..8aa2151f3 100644 --- a/libraries/ec2/lib/associateDhcpOptions.ml +++ b/libraries/ec2/lib/associateDhcpOptions.ml @@ -4,9 +4,11 @@ type input = AssociateDhcpOptionsRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AssociateDhcpOptions"])] (Util.drop_empty diff --git a/libraries/ec2/lib/associateRouteTable.ml b/libraries/ec2/lib/associateRouteTable.ml index 5d9391396..5dc44a8b6 100644 --- a/libraries/ec2/lib/associateRouteTable.ml +++ b/libraries/ec2/lib/associateRouteTable.ml @@ -4,9 +4,11 @@ type input = AssociateRouteTableRequest.t type output = AssociateRouteTableResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AssociateRouteTable"])] (Util.drop_empty diff --git a/libraries/ec2/lib/attachClassicLinkVpc.ml b/libraries/ec2/lib/attachClassicLinkVpc.ml index 9871fe48e..2673c3c9e 100644 --- a/libraries/ec2/lib/attachClassicLinkVpc.ml +++ b/libraries/ec2/lib/attachClassicLinkVpc.ml @@ -4,9 +4,11 @@ type input = AttachClassicLinkVpcRequest.t type output = AttachClassicLinkVpcResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AttachClassicLinkVpc"])] (Util.drop_empty diff --git a/libraries/ec2/lib/attachInternetGateway.ml b/libraries/ec2/lib/attachInternetGateway.ml index 4dd279e91..d42179cc8 100644 --- a/libraries/ec2/lib/attachInternetGateway.ml +++ b/libraries/ec2/lib/attachInternetGateway.ml @@ -4,9 +4,11 @@ type input = AttachInternetGatewayRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AttachInternetGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/attachNetworkInterface.ml b/libraries/ec2/lib/attachNetworkInterface.ml index b66055c5c..38d22aec6 100644 --- a/libraries/ec2/lib/attachNetworkInterface.ml +++ b/libraries/ec2/lib/attachNetworkInterface.ml @@ -4,9 +4,11 @@ type input = AttachNetworkInterfaceRequest.t type output = AttachNetworkInterfaceResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AttachNetworkInterface"])] diff --git a/libraries/ec2/lib/attachVolume.ml b/libraries/ec2/lib/attachVolume.ml index 195cf06ac..05fb74e32 100644 --- a/libraries/ec2/lib/attachVolume.ml +++ b/libraries/ec2/lib/attachVolume.ml @@ -4,9 +4,11 @@ type input = AttachVolumeRequest.t type output = VolumeAttachment.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AttachVolume"])] (Util.drop_empty diff --git a/libraries/ec2/lib/attachVpnGateway.ml b/libraries/ec2/lib/attachVpnGateway.ml index 2aadc3d90..eebab35cc 100644 --- a/libraries/ec2/lib/attachVpnGateway.ml +++ b/libraries/ec2/lib/attachVpnGateway.ml @@ -4,9 +4,11 @@ type input = AttachVpnGatewayRequest.t type output = AttachVpnGatewayResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AttachVpnGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/authorizeSecurityGroupEgress.ml b/libraries/ec2/lib/authorizeSecurityGroupEgress.ml index 85809deac..d00dd798f 100644 --- a/libraries/ec2/lib/authorizeSecurityGroupEgress.ml +++ b/libraries/ec2/lib/authorizeSecurityGroupEgress.ml @@ -4,9 +4,11 @@ type input = AuthorizeSecurityGroupEgressRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AuthorizeSecurityGroupEgress"])] diff --git a/libraries/ec2/lib/authorizeSecurityGroupIngress.ml b/libraries/ec2/lib/authorizeSecurityGroupIngress.ml index 368a8e603..26939f118 100644 --- a/libraries/ec2/lib/authorizeSecurityGroupIngress.ml +++ b/libraries/ec2/lib/authorizeSecurityGroupIngress.ml @@ -4,9 +4,11 @@ type input = AuthorizeSecurityGroupIngressRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["AuthorizeSecurityGroupIngress"])] diff --git a/libraries/ec2/lib/bundleInstance.ml b/libraries/ec2/lib/bundleInstance.ml index b53ed806b..d571ca574 100644 --- a/libraries/ec2/lib/bundleInstance.ml +++ b/libraries/ec2/lib/bundleInstance.ml @@ -4,9 +4,11 @@ type input = BundleInstanceRequest.t type output = BundleInstanceResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["BundleInstance"])] (Util.drop_empty diff --git a/libraries/ec2/lib/cancelBundleTask.ml b/libraries/ec2/lib/cancelBundleTask.ml index 58ebf18f7..b0f2ae0b3 100644 --- a/libraries/ec2/lib/cancelBundleTask.ml +++ b/libraries/ec2/lib/cancelBundleTask.ml @@ -4,9 +4,11 @@ type input = CancelBundleTaskRequest.t type output = CancelBundleTaskResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelBundleTask"])] (Util.drop_empty diff --git a/libraries/ec2/lib/cancelConversionTask.ml b/libraries/ec2/lib/cancelConversionTask.ml index f0039d1fe..8430c4a56 100644 --- a/libraries/ec2/lib/cancelConversionTask.ml +++ b/libraries/ec2/lib/cancelConversionTask.ml @@ -4,9 +4,11 @@ type input = CancelConversionRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelConversionTask"])] (Util.drop_empty diff --git a/libraries/ec2/lib/cancelExportTask.ml b/libraries/ec2/lib/cancelExportTask.ml index 7a0f49c54..cd58a0ffe 100644 --- a/libraries/ec2/lib/cancelExportTask.ml +++ b/libraries/ec2/lib/cancelExportTask.ml @@ -4,9 +4,11 @@ type input = CancelExportTaskRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelExportTask"])] (Util.drop_empty diff --git a/libraries/ec2/lib/cancelImportTask.ml b/libraries/ec2/lib/cancelImportTask.ml index fd5ff5835..e92151a14 100644 --- a/libraries/ec2/lib/cancelImportTask.ml +++ b/libraries/ec2/lib/cancelImportTask.ml @@ -4,9 +4,11 @@ type input = CancelImportTaskRequest.t type output = CancelImportTaskResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelImportTask"])] (Util.drop_empty diff --git a/libraries/ec2/lib/cancelReservedInstancesListing.ml b/libraries/ec2/lib/cancelReservedInstancesListing.ml index ff8d166e6..3b6aaea37 100644 --- a/libraries/ec2/lib/cancelReservedInstancesListing.ml +++ b/libraries/ec2/lib/cancelReservedInstancesListing.ml @@ -4,9 +4,11 @@ type input = CancelReservedInstancesListingRequest.t type output = CancelReservedInstancesListingResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelReservedInstancesListing"])] diff --git a/libraries/ec2/lib/cancelSpotFleetRequests.ml b/libraries/ec2/lib/cancelSpotFleetRequests.ml index d76b2e113..4bb0ad251 100644 --- a/libraries/ec2/lib/cancelSpotFleetRequests.ml +++ b/libraries/ec2/lib/cancelSpotFleetRequests.ml @@ -4,9 +4,11 @@ type input = CancelSpotFleetRequestsRequest.t type output = CancelSpotFleetRequestsResponse.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelSpotFleetRequests"])] diff --git a/libraries/ec2/lib/cancelSpotInstanceRequests.ml b/libraries/ec2/lib/cancelSpotInstanceRequests.ml index faf3d42ee..106c87a87 100644 --- a/libraries/ec2/lib/cancelSpotInstanceRequests.ml +++ b/libraries/ec2/lib/cancelSpotInstanceRequests.ml @@ -4,9 +4,11 @@ type input = CancelSpotInstanceRequestsRequest.t type output = CancelSpotInstanceRequestsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CancelSpotInstanceRequests"])] diff --git a/libraries/ec2/lib/confirmProductInstance.ml b/libraries/ec2/lib/confirmProductInstance.ml index c0546308c..22ee73424 100644 --- a/libraries/ec2/lib/confirmProductInstance.ml +++ b/libraries/ec2/lib/confirmProductInstance.ml @@ -4,9 +4,11 @@ type input = ConfirmProductInstanceRequest.t type output = ConfirmProductInstanceResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ConfirmProductInstance"])] diff --git a/libraries/ec2/lib/copyImage.ml b/libraries/ec2/lib/copyImage.ml index 72ff601a8..9dcd6c1e4 100644 --- a/libraries/ec2/lib/copyImage.ml +++ b/libraries/ec2/lib/copyImage.ml @@ -4,9 +4,11 @@ type input = CopyImageRequest.t type output = CopyImageResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CopyImage"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/copySnapshot.ml b/libraries/ec2/lib/copySnapshot.ml index 88d375516..345d4c6e8 100644 --- a/libraries/ec2/lib/copySnapshot.ml +++ b/libraries/ec2/lib/copySnapshot.ml @@ -4,9 +4,11 @@ type input = CopySnapshotRequest.t type output = CopySnapshotResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CopySnapshot"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createCustomerGateway.ml b/libraries/ec2/lib/createCustomerGateway.ml index 3a1070f6a..ae55c12b5 100644 --- a/libraries/ec2/lib/createCustomerGateway.ml +++ b/libraries/ec2/lib/createCustomerGateway.ml @@ -4,9 +4,11 @@ type input = CreateCustomerGatewayRequest.t type output = CreateCustomerGatewayResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateCustomerGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createDhcpOptions.ml b/libraries/ec2/lib/createDhcpOptions.ml index ea2d1278b..6096a7464 100644 --- a/libraries/ec2/lib/createDhcpOptions.ml +++ b/libraries/ec2/lib/createDhcpOptions.ml @@ -4,9 +4,11 @@ type input = CreateDhcpOptionsRequest.t type output = CreateDhcpOptionsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateDhcpOptions"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createFlowLogs.ml b/libraries/ec2/lib/createFlowLogs.ml index 86851e47b..10cacca52 100644 --- a/libraries/ec2/lib/createFlowLogs.ml +++ b/libraries/ec2/lib/createFlowLogs.ml @@ -4,9 +4,11 @@ type input = CreateFlowLogsRequest.t type output = CreateFlowLogsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateFlowLogs"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createImage.ml b/libraries/ec2/lib/createImage.ml index d1f69fbdc..81bfb21fe 100644 --- a/libraries/ec2/lib/createImage.ml +++ b/libraries/ec2/lib/createImage.ml @@ -4,9 +4,11 @@ type input = CreateImageRequest.t type output = CreateImageResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateImage"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/createInstanceExportTask.ml b/libraries/ec2/lib/createInstanceExportTask.ml index 2b3056c2c..d673e6623 100644 --- a/libraries/ec2/lib/createInstanceExportTask.ml +++ b/libraries/ec2/lib/createInstanceExportTask.ml @@ -4,9 +4,11 @@ type input = CreateInstanceExportTaskRequest.t type output = CreateInstanceExportTaskResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateInstanceExportTask"])] diff --git a/libraries/ec2/lib/createInternetGateway.ml b/libraries/ec2/lib/createInternetGateway.ml index 71a600980..b824ce569 100644 --- a/libraries/ec2/lib/createInternetGateway.ml +++ b/libraries/ec2/lib/createInternetGateway.ml @@ -4,9 +4,11 @@ type input = CreateInternetGatewayRequest.t type output = CreateInternetGatewayResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateInternetGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createKeyPair.ml b/libraries/ec2/lib/createKeyPair.ml index b246ebfb3..5c9fb2d86 100644 --- a/libraries/ec2/lib/createKeyPair.ml +++ b/libraries/ec2/lib/createKeyPair.ml @@ -4,9 +4,11 @@ type input = CreateKeyPairRequest.t type output = KeyPair.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateKeyPair"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createNetworkAcl.ml b/libraries/ec2/lib/createNetworkAcl.ml index ea9303487..796941d2a 100644 --- a/libraries/ec2/lib/createNetworkAcl.ml +++ b/libraries/ec2/lib/createNetworkAcl.ml @@ -4,9 +4,11 @@ type input = CreateNetworkAclRequest.t type output = CreateNetworkAclResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateNetworkAcl"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createNetworkAclEntry.ml b/libraries/ec2/lib/createNetworkAclEntry.ml index 8254cd383..b38b92297 100644 --- a/libraries/ec2/lib/createNetworkAclEntry.ml +++ b/libraries/ec2/lib/createNetworkAclEntry.ml @@ -4,9 +4,11 @@ type input = CreateNetworkAclEntryRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateNetworkAclEntry"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createNetworkInterface.ml b/libraries/ec2/lib/createNetworkInterface.ml index 3a5c4a1e9..339fedc56 100644 --- a/libraries/ec2/lib/createNetworkInterface.ml +++ b/libraries/ec2/lib/createNetworkInterface.ml @@ -4,9 +4,11 @@ type input = CreateNetworkInterfaceRequest.t type output = CreateNetworkInterfaceResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateNetworkInterface"])] diff --git a/libraries/ec2/lib/createPlacementGroup.ml b/libraries/ec2/lib/createPlacementGroup.ml index 0cb79d332..84846c6c4 100644 --- a/libraries/ec2/lib/createPlacementGroup.ml +++ b/libraries/ec2/lib/createPlacementGroup.ml @@ -4,9 +4,11 @@ type input = CreatePlacementGroupRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreatePlacementGroup"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createReservedInstancesListing.ml b/libraries/ec2/lib/createReservedInstancesListing.ml index 090beaf4f..3fd13b2e6 100644 --- a/libraries/ec2/lib/createReservedInstancesListing.ml +++ b/libraries/ec2/lib/createReservedInstancesListing.ml @@ -4,9 +4,11 @@ type input = CreateReservedInstancesListingRequest.t type output = CreateReservedInstancesListingResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateReservedInstancesListing"])] diff --git a/libraries/ec2/lib/createRoute.ml b/libraries/ec2/lib/createRoute.ml index 7c4a74b61..b272efe11 100644 --- a/libraries/ec2/lib/createRoute.ml +++ b/libraries/ec2/lib/createRoute.ml @@ -4,9 +4,11 @@ type input = CreateRouteRequest.t type output = CreateRouteResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateRoute"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/createRouteTable.ml b/libraries/ec2/lib/createRouteTable.ml index 99be667fa..f67c33d2f 100644 --- a/libraries/ec2/lib/createRouteTable.ml +++ b/libraries/ec2/lib/createRouteTable.ml @@ -4,9 +4,11 @@ type input = CreateRouteTableRequest.t type output = CreateRouteTableResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateRouteTable"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createSecurityGroup.ml b/libraries/ec2/lib/createSecurityGroup.ml index 14e9ded7b..4431ac55d 100644 --- a/libraries/ec2/lib/createSecurityGroup.ml +++ b/libraries/ec2/lib/createSecurityGroup.ml @@ -4,9 +4,11 @@ type input = CreateSecurityGroupRequest.t type output = CreateSecurityGroupResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateSecurityGroup"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createSnapshot.ml b/libraries/ec2/lib/createSnapshot.ml index 86f4ba905..852136e50 100644 --- a/libraries/ec2/lib/createSnapshot.ml +++ b/libraries/ec2/lib/createSnapshot.ml @@ -4,9 +4,11 @@ type input = CreateSnapshotRequest.t type output = Snapshot.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateSnapshot"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createSpotDatafeedSubscription.ml b/libraries/ec2/lib/createSpotDatafeedSubscription.ml index 4f64e7d0e..1ab6ddba1 100644 --- a/libraries/ec2/lib/createSpotDatafeedSubscription.ml +++ b/libraries/ec2/lib/createSpotDatafeedSubscription.ml @@ -4,9 +4,11 @@ type input = CreateSpotDatafeedSubscriptionRequest.t type output = CreateSpotDatafeedSubscriptionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateSpotDatafeedSubscription"])] diff --git a/libraries/ec2/lib/createSubnet.ml b/libraries/ec2/lib/createSubnet.ml index 3355c6103..8b1cd3091 100644 --- a/libraries/ec2/lib/createSubnet.ml +++ b/libraries/ec2/lib/createSubnet.ml @@ -4,9 +4,11 @@ type input = CreateSubnetRequest.t type output = CreateSubnetResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateSubnet"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createTags.ml b/libraries/ec2/lib/createTags.ml index 1bf7abb10..7a43aae97 100644 --- a/libraries/ec2/lib/createTags.ml +++ b/libraries/ec2/lib/createTags.ml @@ -4,9 +4,11 @@ type input = CreateTagsRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateTags"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/createVolume.ml b/libraries/ec2/lib/createVolume.ml index 15d7aa252..e5c579390 100644 --- a/libraries/ec2/lib/createVolume.ml +++ b/libraries/ec2/lib/createVolume.ml @@ -4,9 +4,11 @@ type input = CreateVolumeRequest.t type output = Volume.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVolume"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createVpc.ml b/libraries/ec2/lib/createVpc.ml index 406b11fb4..188503393 100644 --- a/libraries/ec2/lib/createVpc.ml +++ b/libraries/ec2/lib/createVpc.ml @@ -4,9 +4,11 @@ type input = CreateVpcRequest.t type output = CreateVpcResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpc"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/createVpcEndpoint.ml b/libraries/ec2/lib/createVpcEndpoint.ml index ee0e57c35..d7d52ff62 100644 --- a/libraries/ec2/lib/createVpcEndpoint.ml +++ b/libraries/ec2/lib/createVpcEndpoint.ml @@ -4,9 +4,11 @@ type input = CreateVpcEndpointRequest.t type output = CreateVpcEndpointResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpcEndpoint"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createVpcPeeringConnection.ml b/libraries/ec2/lib/createVpcPeeringConnection.ml index a8ec69594..9b00c84c5 100644 --- a/libraries/ec2/lib/createVpcPeeringConnection.ml +++ b/libraries/ec2/lib/createVpcPeeringConnection.ml @@ -4,9 +4,11 @@ type input = CreateVpcPeeringConnectionRequest.t type output = CreateVpcPeeringConnectionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpcPeeringConnection"])] diff --git a/libraries/ec2/lib/createVpnConnection.ml b/libraries/ec2/lib/createVpnConnection.ml index f38bb5adf..2e74a791e 100644 --- a/libraries/ec2/lib/createVpnConnection.ml +++ b/libraries/ec2/lib/createVpnConnection.ml @@ -4,9 +4,11 @@ type input = CreateVpnConnectionRequest.t type output = CreateVpnConnectionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpnConnection"])] (Util.drop_empty diff --git a/libraries/ec2/lib/createVpnConnectionRoute.ml b/libraries/ec2/lib/createVpnConnectionRoute.ml index 044bf1411..307dd0e55 100644 --- a/libraries/ec2/lib/createVpnConnectionRoute.ml +++ b/libraries/ec2/lib/createVpnConnectionRoute.ml @@ -4,9 +4,11 @@ type input = CreateVpnConnectionRouteRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpnConnectionRoute"])] diff --git a/libraries/ec2/lib/createVpnGateway.ml b/libraries/ec2/lib/createVpnGateway.ml index 24a6ab137..e713ae127 100644 --- a/libraries/ec2/lib/createVpnGateway.ml +++ b/libraries/ec2/lib/createVpnGateway.ml @@ -4,9 +4,11 @@ type input = CreateVpnGatewayRequest.t type output = CreateVpnGatewayResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["CreateVpnGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteCustomerGateway.ml b/libraries/ec2/lib/deleteCustomerGateway.ml index b1132a4ff..8f3ca8aa3 100644 --- a/libraries/ec2/lib/deleteCustomerGateway.ml +++ b/libraries/ec2/lib/deleteCustomerGateway.ml @@ -4,9 +4,11 @@ type input = DeleteCustomerGatewayRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteCustomerGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteDhcpOptions.ml b/libraries/ec2/lib/deleteDhcpOptions.ml index 8983ddebd..2c9f8cb23 100644 --- a/libraries/ec2/lib/deleteDhcpOptions.ml +++ b/libraries/ec2/lib/deleteDhcpOptions.ml @@ -4,9 +4,11 @@ type input = DeleteDhcpOptionsRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteDhcpOptions"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteFlowLogs.ml b/libraries/ec2/lib/deleteFlowLogs.ml index 385875466..61507be46 100644 --- a/libraries/ec2/lib/deleteFlowLogs.ml +++ b/libraries/ec2/lib/deleteFlowLogs.ml @@ -4,9 +4,11 @@ type input = DeleteFlowLogsRequest.t type output = DeleteFlowLogsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteFlowLogs"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteInternetGateway.ml b/libraries/ec2/lib/deleteInternetGateway.ml index f50151995..272023508 100644 --- a/libraries/ec2/lib/deleteInternetGateway.ml +++ b/libraries/ec2/lib/deleteInternetGateway.ml @@ -4,9 +4,11 @@ type input = DeleteInternetGatewayRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteInternetGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteKeyPair.ml b/libraries/ec2/lib/deleteKeyPair.ml index 6cf7b2501..f8a51d2cb 100644 --- a/libraries/ec2/lib/deleteKeyPair.ml +++ b/libraries/ec2/lib/deleteKeyPair.ml @@ -4,9 +4,11 @@ type input = DeleteKeyPairRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteKeyPair"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteNetworkAcl.ml b/libraries/ec2/lib/deleteNetworkAcl.ml index d26331f72..794be04e2 100644 --- a/libraries/ec2/lib/deleteNetworkAcl.ml +++ b/libraries/ec2/lib/deleteNetworkAcl.ml @@ -4,9 +4,11 @@ type input = DeleteNetworkAclRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteNetworkAcl"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteNetworkAclEntry.ml b/libraries/ec2/lib/deleteNetworkAclEntry.ml index 54fc212f3..5eaac576b 100644 --- a/libraries/ec2/lib/deleteNetworkAclEntry.ml +++ b/libraries/ec2/lib/deleteNetworkAclEntry.ml @@ -4,9 +4,11 @@ type input = DeleteNetworkAclEntryRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteNetworkAclEntry"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteNetworkInterface.ml b/libraries/ec2/lib/deleteNetworkInterface.ml index 06f105d50..15c00ec6f 100644 --- a/libraries/ec2/lib/deleteNetworkInterface.ml +++ b/libraries/ec2/lib/deleteNetworkInterface.ml @@ -4,9 +4,11 @@ type input = DeleteNetworkInterfaceRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteNetworkInterface"])] diff --git a/libraries/ec2/lib/deletePlacementGroup.ml b/libraries/ec2/lib/deletePlacementGroup.ml index 2314f58f6..9fd413ad4 100644 --- a/libraries/ec2/lib/deletePlacementGroup.ml +++ b/libraries/ec2/lib/deletePlacementGroup.ml @@ -4,9 +4,11 @@ type input = DeletePlacementGroupRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeletePlacementGroup"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteRoute.ml b/libraries/ec2/lib/deleteRoute.ml index 5df76888b..4fd0ad97b 100644 --- a/libraries/ec2/lib/deleteRoute.ml +++ b/libraries/ec2/lib/deleteRoute.ml @@ -4,9 +4,11 @@ type input = DeleteRouteRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteRoute"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/deleteRouteTable.ml b/libraries/ec2/lib/deleteRouteTable.ml index 7a343ecf6..dfc5bcfe4 100644 --- a/libraries/ec2/lib/deleteRouteTable.ml +++ b/libraries/ec2/lib/deleteRouteTable.ml @@ -4,9 +4,11 @@ type input = DeleteRouteTableRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteRouteTable"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteSecurityGroup.ml b/libraries/ec2/lib/deleteSecurityGroup.ml index 8e3e27d94..c451c62f8 100644 --- a/libraries/ec2/lib/deleteSecurityGroup.ml +++ b/libraries/ec2/lib/deleteSecurityGroup.ml @@ -4,9 +4,11 @@ type input = DeleteSecurityGroupRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteSecurityGroup"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteSnapshot.ml b/libraries/ec2/lib/deleteSnapshot.ml index 22119809f..c47dbdd78 100644 --- a/libraries/ec2/lib/deleteSnapshot.ml +++ b/libraries/ec2/lib/deleteSnapshot.ml @@ -4,9 +4,11 @@ type input = DeleteSnapshotRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteSnapshot"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml b/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml index 7a2a28b60..82de60a6a 100644 --- a/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml +++ b/libraries/ec2/lib/deleteSpotDatafeedSubscription.ml @@ -4,9 +4,11 @@ type input = DeleteSpotDatafeedSubscriptionRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteSpotDatafeedSubscription"])] diff --git a/libraries/ec2/lib/deleteSubnet.ml b/libraries/ec2/lib/deleteSubnet.ml index 783cae1a8..a1e5a3e32 100644 --- a/libraries/ec2/lib/deleteSubnet.ml +++ b/libraries/ec2/lib/deleteSubnet.ml @@ -4,9 +4,11 @@ type input = DeleteSubnetRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteSubnet"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteTags.ml b/libraries/ec2/lib/deleteTags.ml index 15ca59892..340185d51 100644 --- a/libraries/ec2/lib/deleteTags.ml +++ b/libraries/ec2/lib/deleteTags.ml @@ -4,9 +4,11 @@ type input = DeleteTagsRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteTags"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/deleteVolume.ml b/libraries/ec2/lib/deleteVolume.ml index ed17c662c..2ea49d05f 100644 --- a/libraries/ec2/lib/deleteVolume.ml +++ b/libraries/ec2/lib/deleteVolume.ml @@ -4,9 +4,11 @@ type input = DeleteVolumeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVolume"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteVpc.ml b/libraries/ec2/lib/deleteVpc.ml index 77fd46861..931ebd127 100644 --- a/libraries/ec2/lib/deleteVpc.ml +++ b/libraries/ec2/lib/deleteVpc.ml @@ -4,9 +4,11 @@ type input = DeleteVpcRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpc"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/deleteVpcEndpoints.ml b/libraries/ec2/lib/deleteVpcEndpoints.ml index 821a8c250..8a266e4b6 100644 --- a/libraries/ec2/lib/deleteVpcEndpoints.ml +++ b/libraries/ec2/lib/deleteVpcEndpoints.ml @@ -4,9 +4,11 @@ type input = DeleteVpcEndpointsRequest.t type output = DeleteVpcEndpointsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpcEndpoints"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteVpcPeeringConnection.ml b/libraries/ec2/lib/deleteVpcPeeringConnection.ml index 2114b9ed8..564c7da66 100644 --- a/libraries/ec2/lib/deleteVpcPeeringConnection.ml +++ b/libraries/ec2/lib/deleteVpcPeeringConnection.ml @@ -4,9 +4,11 @@ type input = DeleteVpcPeeringConnectionRequest.t type output = DeleteVpcPeeringConnectionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpcPeeringConnection"])] diff --git a/libraries/ec2/lib/deleteVpnConnection.ml b/libraries/ec2/lib/deleteVpnConnection.ml index d79a585a5..ed6521252 100644 --- a/libraries/ec2/lib/deleteVpnConnection.ml +++ b/libraries/ec2/lib/deleteVpnConnection.ml @@ -4,9 +4,11 @@ type input = DeleteVpnConnectionRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpnConnection"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deleteVpnConnectionRoute.ml b/libraries/ec2/lib/deleteVpnConnectionRoute.ml index 1ccde6e10..38a9fda20 100644 --- a/libraries/ec2/lib/deleteVpnConnectionRoute.ml +++ b/libraries/ec2/lib/deleteVpnConnectionRoute.ml @@ -4,9 +4,11 @@ type input = DeleteVpnConnectionRouteRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpnConnectionRoute"])] diff --git a/libraries/ec2/lib/deleteVpnGateway.ml b/libraries/ec2/lib/deleteVpnGateway.ml index f40625436..d9d91e567 100644 --- a/libraries/ec2/lib/deleteVpnGateway.ml +++ b/libraries/ec2/lib/deleteVpnGateway.ml @@ -4,9 +4,11 @@ type input = DeleteVpnGatewayRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeleteVpnGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/deregisterImage.ml b/libraries/ec2/lib/deregisterImage.ml index b94b7b050..209fd28c1 100644 --- a/libraries/ec2/lib/deregisterImage.ml +++ b/libraries/ec2/lib/deregisterImage.ml @@ -4,9 +4,11 @@ type input = DeregisterImageRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DeregisterImage"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeAccountAttributes.ml b/libraries/ec2/lib/describeAccountAttributes.ml index 2eb2bd88b..2dbeff97e 100644 --- a/libraries/ec2/lib/describeAccountAttributes.ml +++ b/libraries/ec2/lib/describeAccountAttributes.ml @@ -4,9 +4,11 @@ type input = DescribeAccountAttributesRequest.t type output = DescribeAccountAttributesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeAccountAttributes"])] diff --git a/libraries/ec2/lib/describeAddresses.ml b/libraries/ec2/lib/describeAddresses.ml index a84033a03..a2c87511d 100644 --- a/libraries/ec2/lib/describeAddresses.ml +++ b/libraries/ec2/lib/describeAddresses.ml @@ -4,9 +4,11 @@ type input = DescribeAddressesRequest.t type output = DescribeAddressesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeAddresses"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeAvailabilityZones.ml b/libraries/ec2/lib/describeAvailabilityZones.ml index 1bf4247b6..a4e6fa743 100644 --- a/libraries/ec2/lib/describeAvailabilityZones.ml +++ b/libraries/ec2/lib/describeAvailabilityZones.ml @@ -4,9 +4,11 @@ type input = DescribeAvailabilityZonesRequest.t type output = DescribeAvailabilityZonesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeAvailabilityZones"])] diff --git a/libraries/ec2/lib/describeBundleTasks.ml b/libraries/ec2/lib/describeBundleTasks.ml index bbe942f4f..7e00a10cf 100644 --- a/libraries/ec2/lib/describeBundleTasks.ml +++ b/libraries/ec2/lib/describeBundleTasks.ml @@ -4,9 +4,11 @@ type input = DescribeBundleTasksRequest.t type output = DescribeBundleTasksResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeBundleTasks"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeClassicLinkInstances.ml b/libraries/ec2/lib/describeClassicLinkInstances.ml index 21ceb69e5..99bc0e300 100644 --- a/libraries/ec2/lib/describeClassicLinkInstances.ml +++ b/libraries/ec2/lib/describeClassicLinkInstances.ml @@ -4,9 +4,11 @@ type input = DescribeClassicLinkInstancesRequest.t type output = DescribeClassicLinkInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeClassicLinkInstances"])] diff --git a/libraries/ec2/lib/describeConversionTasks.ml b/libraries/ec2/lib/describeConversionTasks.ml index 84d06f049..dc40506e9 100644 --- a/libraries/ec2/lib/describeConversionTasks.ml +++ b/libraries/ec2/lib/describeConversionTasks.ml @@ -4,9 +4,11 @@ type input = DescribeConversionTasksRequest.t type output = DescribeConversionTasksResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeConversionTasks"])] diff --git a/libraries/ec2/lib/describeCustomerGateways.ml b/libraries/ec2/lib/describeCustomerGateways.ml index 311457cc0..01cea0af3 100644 --- a/libraries/ec2/lib/describeCustomerGateways.ml +++ b/libraries/ec2/lib/describeCustomerGateways.ml @@ -4,9 +4,11 @@ type input = DescribeCustomerGatewaysRequest.t type output = DescribeCustomerGatewaysResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeCustomerGateways"])] diff --git a/libraries/ec2/lib/describeDhcpOptions.ml b/libraries/ec2/lib/describeDhcpOptions.ml index fad2e0f6b..c8c6bd715 100644 --- a/libraries/ec2/lib/describeDhcpOptions.ml +++ b/libraries/ec2/lib/describeDhcpOptions.ml @@ -4,9 +4,11 @@ type input = DescribeDhcpOptionsRequest.t type output = DescribeDhcpOptionsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeDhcpOptions"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeExportTasks.ml b/libraries/ec2/lib/describeExportTasks.ml index a955ce851..d714b50c4 100644 --- a/libraries/ec2/lib/describeExportTasks.ml +++ b/libraries/ec2/lib/describeExportTasks.ml @@ -4,9 +4,11 @@ type input = DescribeExportTasksRequest.t type output = DescribeExportTasksResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeExportTasks"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeFlowLogs.ml b/libraries/ec2/lib/describeFlowLogs.ml index 9836d5803..1b6c887ef 100644 --- a/libraries/ec2/lib/describeFlowLogs.ml +++ b/libraries/ec2/lib/describeFlowLogs.ml @@ -4,9 +4,11 @@ type input = DescribeFlowLogsRequest.t type output = DescribeFlowLogsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeFlowLogs"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeImageAttribute.ml b/libraries/ec2/lib/describeImageAttribute.ml index 496e3d4bc..6ede1ae81 100644 --- a/libraries/ec2/lib/describeImageAttribute.ml +++ b/libraries/ec2/lib/describeImageAttribute.ml @@ -4,9 +4,11 @@ type input = DescribeImageAttributeRequest.t type output = ImageAttribute.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeImageAttribute"])] diff --git a/libraries/ec2/lib/describeImages.ml b/libraries/ec2/lib/describeImages.ml index cf9819570..f0db82ba6 100644 --- a/libraries/ec2/lib/describeImages.ml +++ b/libraries/ec2/lib/describeImages.ml @@ -4,9 +4,11 @@ type input = DescribeImagesRequest.t type output = DescribeImagesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeImages"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeImportImageTasks.ml b/libraries/ec2/lib/describeImportImageTasks.ml index 1c1ef0b06..adb6bcef2 100644 --- a/libraries/ec2/lib/describeImportImageTasks.ml +++ b/libraries/ec2/lib/describeImportImageTasks.ml @@ -4,9 +4,11 @@ type input = DescribeImportImageTasksRequest.t type output = DescribeImportImageTasksResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeImportImageTasks"])] diff --git a/libraries/ec2/lib/describeImportSnapshotTasks.ml b/libraries/ec2/lib/describeImportSnapshotTasks.ml index bf9d98d2a..8f13ba0a1 100644 --- a/libraries/ec2/lib/describeImportSnapshotTasks.ml +++ b/libraries/ec2/lib/describeImportSnapshotTasks.ml @@ -4,9 +4,11 @@ type input = DescribeImportSnapshotTasksRequest.t type output = DescribeImportSnapshotTasksResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeImportSnapshotTasks"])] diff --git a/libraries/ec2/lib/describeInstanceAttribute.ml b/libraries/ec2/lib/describeInstanceAttribute.ml index 3b190fd43..e3ae08de8 100644 --- a/libraries/ec2/lib/describeInstanceAttribute.ml +++ b/libraries/ec2/lib/describeInstanceAttribute.ml @@ -4,9 +4,11 @@ type input = DescribeInstanceAttributeRequest.t type output = InstanceAttribute.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeInstanceAttribute"])] diff --git a/libraries/ec2/lib/describeInstanceStatus.ml b/libraries/ec2/lib/describeInstanceStatus.ml index 012d5f046..2917bc5ec 100644 --- a/libraries/ec2/lib/describeInstanceStatus.ml +++ b/libraries/ec2/lib/describeInstanceStatus.ml @@ -4,9 +4,11 @@ type input = DescribeInstanceStatusRequest.t type output = DescribeInstanceStatusResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeInstanceStatus"])] diff --git a/libraries/ec2/lib/describeInstances.ml b/libraries/ec2/lib/describeInstances.ml index ac5141daf..f5afdecf4 100644 --- a/libraries/ec2/lib/describeInstances.ml +++ b/libraries/ec2/lib/describeInstances.ml @@ -4,9 +4,11 @@ type input = DescribeInstancesRequest.t type output = DescribeInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeInternetGateways.ml b/libraries/ec2/lib/describeInternetGateways.ml index 2af3ba168..ce4a5edd3 100644 --- a/libraries/ec2/lib/describeInternetGateways.ml +++ b/libraries/ec2/lib/describeInternetGateways.ml @@ -4,9 +4,11 @@ type input = DescribeInternetGatewaysRequest.t type output = DescribeInternetGatewaysResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeInternetGateways"])] diff --git a/libraries/ec2/lib/describeKeyPairs.ml b/libraries/ec2/lib/describeKeyPairs.ml index ef83506ae..0b7f43604 100644 --- a/libraries/ec2/lib/describeKeyPairs.ml +++ b/libraries/ec2/lib/describeKeyPairs.ml @@ -4,9 +4,11 @@ type input = DescribeKeyPairsRequest.t type output = DescribeKeyPairsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeKeyPairs"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeMovingAddresses.ml b/libraries/ec2/lib/describeMovingAddresses.ml index ccb3511c0..d3dda9749 100644 --- a/libraries/ec2/lib/describeMovingAddresses.ml +++ b/libraries/ec2/lib/describeMovingAddresses.ml @@ -4,9 +4,11 @@ type input = DescribeMovingAddressesRequest.t type output = DescribeMovingAddressesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeMovingAddresses"])] diff --git a/libraries/ec2/lib/describeNetworkAcls.ml b/libraries/ec2/lib/describeNetworkAcls.ml index 63d25810d..f8205811b 100644 --- a/libraries/ec2/lib/describeNetworkAcls.ml +++ b/libraries/ec2/lib/describeNetworkAcls.ml @@ -4,9 +4,11 @@ type input = DescribeNetworkAclsRequest.t type output = DescribeNetworkAclsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeNetworkAcls"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml b/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml index 03f6268b4..297616794 100644 --- a/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml +++ b/libraries/ec2/lib/describeNetworkInterfaceAttribute.ml @@ -4,9 +4,11 @@ type input = DescribeNetworkInterfaceAttributeRequest.t type output = DescribeNetworkInterfaceAttributeResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeNetworkInterfaceAttribute"])] diff --git a/libraries/ec2/lib/describeNetworkInterfaces.ml b/libraries/ec2/lib/describeNetworkInterfaces.ml index b30302bbe..3033c3c6a 100644 --- a/libraries/ec2/lib/describeNetworkInterfaces.ml +++ b/libraries/ec2/lib/describeNetworkInterfaces.ml @@ -4,9 +4,11 @@ type input = DescribeNetworkInterfacesRequest.t type output = DescribeNetworkInterfacesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeNetworkInterfaces"])] diff --git a/libraries/ec2/lib/describePlacementGroups.ml b/libraries/ec2/lib/describePlacementGroups.ml index 44e82f8d9..ded15ab1d 100644 --- a/libraries/ec2/lib/describePlacementGroups.ml +++ b/libraries/ec2/lib/describePlacementGroups.ml @@ -4,9 +4,11 @@ type input = DescribePlacementGroupsRequest.t type output = DescribePlacementGroupsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribePlacementGroups"])] diff --git a/libraries/ec2/lib/describePrefixLists.ml b/libraries/ec2/lib/describePrefixLists.ml index 061020f95..bc42ed158 100644 --- a/libraries/ec2/lib/describePrefixLists.ml +++ b/libraries/ec2/lib/describePrefixLists.ml @@ -4,9 +4,11 @@ type input = DescribePrefixListsRequest.t type output = DescribePrefixListsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribePrefixLists"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeRegions.ml b/libraries/ec2/lib/describeRegions.ml index 67db76140..7c85f870b 100644 --- a/libraries/ec2/lib/describeRegions.ml +++ b/libraries/ec2/lib/describeRegions.ml @@ -4,9 +4,11 @@ type input = DescribeRegionsRequest.t type output = DescribeRegionsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeRegions"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeReservedInstances.ml b/libraries/ec2/lib/describeReservedInstances.ml index c4ad2c3ab..16052843b 100644 --- a/libraries/ec2/lib/describeReservedInstances.ml +++ b/libraries/ec2/lib/describeReservedInstances.ml @@ -4,9 +4,11 @@ type input = DescribeReservedInstancesRequest.t type output = DescribeReservedInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeReservedInstances"])] diff --git a/libraries/ec2/lib/describeReservedInstancesListings.ml b/libraries/ec2/lib/describeReservedInstancesListings.ml index 396bda23b..86326511d 100644 --- a/libraries/ec2/lib/describeReservedInstancesListings.ml +++ b/libraries/ec2/lib/describeReservedInstancesListings.ml @@ -4,9 +4,11 @@ type input = DescribeReservedInstancesListingsRequest.t type output = DescribeReservedInstancesListingsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeReservedInstancesListings"])] diff --git a/libraries/ec2/lib/describeReservedInstancesModifications.ml b/libraries/ec2/lib/describeReservedInstancesModifications.ml index faae70c17..f97c85419 100644 --- a/libraries/ec2/lib/describeReservedInstancesModifications.ml +++ b/libraries/ec2/lib/describeReservedInstancesModifications.ml @@ -4,9 +4,11 @@ type input = DescribeReservedInstancesModificationsRequest.t type output = DescribeReservedInstancesModificationsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeReservedInstancesModifications"])] diff --git a/libraries/ec2/lib/describeReservedInstancesOfferings.ml b/libraries/ec2/lib/describeReservedInstancesOfferings.ml index bdca11bd7..28778e806 100644 --- a/libraries/ec2/lib/describeReservedInstancesOfferings.ml +++ b/libraries/ec2/lib/describeReservedInstancesOfferings.ml @@ -4,9 +4,11 @@ type input = DescribeReservedInstancesOfferingsRequest.t type output = DescribeReservedInstancesOfferingsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeReservedInstancesOfferings"])] diff --git a/libraries/ec2/lib/describeRouteTables.ml b/libraries/ec2/lib/describeRouteTables.ml index 20bf16195..4715ebca2 100644 --- a/libraries/ec2/lib/describeRouteTables.ml +++ b/libraries/ec2/lib/describeRouteTables.ml @@ -4,9 +4,11 @@ type input = DescribeRouteTablesRequest.t type output = DescribeRouteTablesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeRouteTables"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeSecurityGroups.ml b/libraries/ec2/lib/describeSecurityGroups.ml index 76c23c5cd..72ee8d445 100644 --- a/libraries/ec2/lib/describeSecurityGroups.ml +++ b/libraries/ec2/lib/describeSecurityGroups.ml @@ -4,9 +4,11 @@ type input = DescribeSecurityGroupsRequest.t type output = DescribeSecurityGroupsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSecurityGroups"])] diff --git a/libraries/ec2/lib/describeSnapshotAttribute.ml b/libraries/ec2/lib/describeSnapshotAttribute.ml index 4c681466c..c16e881b1 100644 --- a/libraries/ec2/lib/describeSnapshotAttribute.ml +++ b/libraries/ec2/lib/describeSnapshotAttribute.ml @@ -4,9 +4,11 @@ type input = DescribeSnapshotAttributeRequest.t type output = DescribeSnapshotAttributeResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSnapshotAttribute"])] diff --git a/libraries/ec2/lib/describeSnapshots.ml b/libraries/ec2/lib/describeSnapshots.ml index ec6a4f8a4..f3242ea37 100644 --- a/libraries/ec2/lib/describeSnapshots.ml +++ b/libraries/ec2/lib/describeSnapshots.ml @@ -4,9 +4,11 @@ type input = DescribeSnapshotsRequest.t type output = DescribeSnapshotsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSnapshots"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeSpotDatafeedSubscription.ml b/libraries/ec2/lib/describeSpotDatafeedSubscription.ml index 954c2e9c6..39da7fb56 100644 --- a/libraries/ec2/lib/describeSpotDatafeedSubscription.ml +++ b/libraries/ec2/lib/describeSpotDatafeedSubscription.ml @@ -4,9 +4,11 @@ type input = DescribeSpotDatafeedSubscriptionRequest.t type output = DescribeSpotDatafeedSubscriptionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSpotDatafeedSubscription"])] diff --git a/libraries/ec2/lib/describeSpotFleetInstances.ml b/libraries/ec2/lib/describeSpotFleetInstances.ml index a6a21f423..855d7ecee 100644 --- a/libraries/ec2/lib/describeSpotFleetInstances.ml +++ b/libraries/ec2/lib/describeSpotFleetInstances.ml @@ -4,9 +4,11 @@ type input = DescribeSpotFleetInstancesRequest.t type output = DescribeSpotFleetInstancesResponse.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSpotFleetInstances"])] diff --git a/libraries/ec2/lib/describeSpotFleetRequestHistory.ml b/libraries/ec2/lib/describeSpotFleetRequestHistory.ml index cb34d1a50..6e88c4f40 100644 --- a/libraries/ec2/lib/describeSpotFleetRequestHistory.ml +++ b/libraries/ec2/lib/describeSpotFleetRequestHistory.ml @@ -4,9 +4,11 @@ type input = DescribeSpotFleetRequestHistoryRequest.t type output = DescribeSpotFleetRequestHistoryResponse.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSpotFleetRequestHistory"])] diff --git a/libraries/ec2/lib/describeSpotFleetRequests.ml b/libraries/ec2/lib/describeSpotFleetRequests.ml index c0b66de9e..c74020a4f 100644 --- a/libraries/ec2/lib/describeSpotFleetRequests.ml +++ b/libraries/ec2/lib/describeSpotFleetRequests.ml @@ -4,9 +4,11 @@ type input = DescribeSpotFleetRequestsRequest.t type output = DescribeSpotFleetRequestsResponse.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSpotFleetRequests"])] diff --git a/libraries/ec2/lib/describeSpotInstanceRequests.ml b/libraries/ec2/lib/describeSpotInstanceRequests.ml index f242581b3..155c5570e 100644 --- a/libraries/ec2/lib/describeSpotInstanceRequests.ml +++ b/libraries/ec2/lib/describeSpotInstanceRequests.ml @@ -4,9 +4,11 @@ type input = DescribeSpotInstanceRequestsRequest.t type output = DescribeSpotInstanceRequestsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSpotInstanceRequests"])] diff --git a/libraries/ec2/lib/describeSpotPriceHistory.ml b/libraries/ec2/lib/describeSpotPriceHistory.ml index 17a65555f..d149e737a 100644 --- a/libraries/ec2/lib/describeSpotPriceHistory.ml +++ b/libraries/ec2/lib/describeSpotPriceHistory.ml @@ -4,9 +4,11 @@ type input = DescribeSpotPriceHistoryRequest.t type output = DescribeSpotPriceHistoryResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSpotPriceHistory"])] diff --git a/libraries/ec2/lib/describeSubnets.ml b/libraries/ec2/lib/describeSubnets.ml index 36c9424f8..6ce879499 100644 --- a/libraries/ec2/lib/describeSubnets.ml +++ b/libraries/ec2/lib/describeSubnets.ml @@ -4,9 +4,11 @@ type input = DescribeSubnetsRequest.t type output = DescribeSubnetsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeSubnets"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeTags.ml b/libraries/ec2/lib/describeTags.ml index 2455b04e7..7496c40cb 100644 --- a/libraries/ec2/lib/describeTags.ml +++ b/libraries/ec2/lib/describeTags.ml @@ -4,9 +4,11 @@ type input = DescribeTagsRequest.t type output = DescribeTagsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeTags"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeVolumeAttribute.ml b/libraries/ec2/lib/describeVolumeAttribute.ml index d05baaa16..fbca3162d 100644 --- a/libraries/ec2/lib/describeVolumeAttribute.ml +++ b/libraries/ec2/lib/describeVolumeAttribute.ml @@ -4,9 +4,11 @@ type input = DescribeVolumeAttributeRequest.t type output = DescribeVolumeAttributeResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVolumeAttribute"])] diff --git a/libraries/ec2/lib/describeVolumeStatus.ml b/libraries/ec2/lib/describeVolumeStatus.ml index 155cf9c9a..9735c9160 100644 --- a/libraries/ec2/lib/describeVolumeStatus.ml +++ b/libraries/ec2/lib/describeVolumeStatus.ml @@ -4,9 +4,11 @@ type input = DescribeVolumeStatusRequest.t type output = DescribeVolumeStatusResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVolumeStatus"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeVolumes.ml b/libraries/ec2/lib/describeVolumes.ml index 2425c8988..4a9cf3639 100644 --- a/libraries/ec2/lib/describeVolumes.ml +++ b/libraries/ec2/lib/describeVolumes.ml @@ -4,9 +4,11 @@ type input = DescribeVolumesRequest.t type output = DescribeVolumesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVolumes"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeVpcAttribute.ml b/libraries/ec2/lib/describeVpcAttribute.ml index ef9db723d..527121b55 100644 --- a/libraries/ec2/lib/describeVpcAttribute.ml +++ b/libraries/ec2/lib/describeVpcAttribute.ml @@ -4,9 +4,11 @@ type input = DescribeVpcAttributeRequest.t type output = DescribeVpcAttributeResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcAttribute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeVpcClassicLink.ml b/libraries/ec2/lib/describeVpcClassicLink.ml index 6a761a45d..b679e986f 100644 --- a/libraries/ec2/lib/describeVpcClassicLink.ml +++ b/libraries/ec2/lib/describeVpcClassicLink.ml @@ -4,9 +4,11 @@ type input = DescribeVpcClassicLinkRequest.t type output = DescribeVpcClassicLinkResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcClassicLink"])] diff --git a/libraries/ec2/lib/describeVpcEndpointServices.ml b/libraries/ec2/lib/describeVpcEndpointServices.ml index 5b45eb6d2..e11bcd693 100644 --- a/libraries/ec2/lib/describeVpcEndpointServices.ml +++ b/libraries/ec2/lib/describeVpcEndpointServices.ml @@ -4,9 +4,11 @@ type input = DescribeVpcEndpointServicesRequest.t type output = DescribeVpcEndpointServicesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcEndpointServices"])] diff --git a/libraries/ec2/lib/describeVpcEndpoints.ml b/libraries/ec2/lib/describeVpcEndpoints.ml index b8fe6a056..0a51355e3 100644 --- a/libraries/ec2/lib/describeVpcEndpoints.ml +++ b/libraries/ec2/lib/describeVpcEndpoints.ml @@ -4,9 +4,11 @@ type input = DescribeVpcEndpointsRequest.t type output = DescribeVpcEndpointsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcEndpoints"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeVpcPeeringConnections.ml b/libraries/ec2/lib/describeVpcPeeringConnections.ml index de5a2c98c..f55664591 100644 --- a/libraries/ec2/lib/describeVpcPeeringConnections.ml +++ b/libraries/ec2/lib/describeVpcPeeringConnections.ml @@ -4,9 +4,11 @@ type input = DescribeVpcPeeringConnectionsRequest.t type output = DescribeVpcPeeringConnectionsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcPeeringConnections"])] diff --git a/libraries/ec2/lib/describeVpcs.ml b/libraries/ec2/lib/describeVpcs.ml index dc028bd72..f1d5f4b6f 100644 --- a/libraries/ec2/lib/describeVpcs.ml +++ b/libraries/ec2/lib/describeVpcs.ml @@ -4,9 +4,11 @@ type input = DescribeVpcsRequest.t type output = DescribeVpcsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpcs"])] (Util.drop_empty diff --git a/libraries/ec2/lib/describeVpnConnections.ml b/libraries/ec2/lib/describeVpnConnections.ml index 0167b2f61..54790dee3 100644 --- a/libraries/ec2/lib/describeVpnConnections.ml +++ b/libraries/ec2/lib/describeVpnConnections.ml @@ -4,9 +4,11 @@ type input = DescribeVpnConnectionsRequest.t type output = DescribeVpnConnectionsResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpnConnections"])] diff --git a/libraries/ec2/lib/describeVpnGateways.ml b/libraries/ec2/lib/describeVpnGateways.ml index e648b0c40..2d4e99941 100644 --- a/libraries/ec2/lib/describeVpnGateways.ml +++ b/libraries/ec2/lib/describeVpnGateways.ml @@ -4,9 +4,11 @@ type input = DescribeVpnGatewaysRequest.t type output = DescribeVpnGatewaysResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DescribeVpnGateways"])] (Util.drop_empty diff --git a/libraries/ec2/lib/detachClassicLinkVpc.ml b/libraries/ec2/lib/detachClassicLinkVpc.ml index 1fd3a800a..daf6bef34 100644 --- a/libraries/ec2/lib/detachClassicLinkVpc.ml +++ b/libraries/ec2/lib/detachClassicLinkVpc.ml @@ -4,9 +4,11 @@ type input = DetachClassicLinkVpcRequest.t type output = DetachClassicLinkVpcResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DetachClassicLinkVpc"])] (Util.drop_empty diff --git a/libraries/ec2/lib/detachInternetGateway.ml b/libraries/ec2/lib/detachInternetGateway.ml index 3a3967161..94f75f704 100644 --- a/libraries/ec2/lib/detachInternetGateway.ml +++ b/libraries/ec2/lib/detachInternetGateway.ml @@ -4,9 +4,11 @@ type input = DetachInternetGatewayRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DetachInternetGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/detachNetworkInterface.ml b/libraries/ec2/lib/detachNetworkInterface.ml index f757396be..17c5fd155 100644 --- a/libraries/ec2/lib/detachNetworkInterface.ml +++ b/libraries/ec2/lib/detachNetworkInterface.ml @@ -4,9 +4,11 @@ type input = DetachNetworkInterfaceRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DetachNetworkInterface"])] diff --git a/libraries/ec2/lib/detachVolume.ml b/libraries/ec2/lib/detachVolume.ml index 53f3db8e0..5eeba994a 100644 --- a/libraries/ec2/lib/detachVolume.ml +++ b/libraries/ec2/lib/detachVolume.ml @@ -4,9 +4,11 @@ type input = DetachVolumeRequest.t type output = VolumeAttachment.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DetachVolume"])] (Util.drop_empty diff --git a/libraries/ec2/lib/detachVpnGateway.ml b/libraries/ec2/lib/detachVpnGateway.ml index f34489cf1..ce4bf1e11 100644 --- a/libraries/ec2/lib/detachVpnGateway.ml +++ b/libraries/ec2/lib/detachVpnGateway.ml @@ -4,9 +4,11 @@ type input = DetachVpnGatewayRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DetachVpnGateway"])] (Util.drop_empty diff --git a/libraries/ec2/lib/disableVgwRoutePropagation.ml b/libraries/ec2/lib/disableVgwRoutePropagation.ml index 772873aef..e241df55e 100644 --- a/libraries/ec2/lib/disableVgwRoutePropagation.ml +++ b/libraries/ec2/lib/disableVgwRoutePropagation.ml @@ -4,9 +4,11 @@ type input = DisableVgwRoutePropagationRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DisableVgwRoutePropagation"])] diff --git a/libraries/ec2/lib/disableVpcClassicLink.ml b/libraries/ec2/lib/disableVpcClassicLink.ml index 013924b5c..6e281b991 100644 --- a/libraries/ec2/lib/disableVpcClassicLink.ml +++ b/libraries/ec2/lib/disableVpcClassicLink.ml @@ -4,9 +4,11 @@ type input = DisableVpcClassicLinkRequest.t type output = DisableVpcClassicLinkResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DisableVpcClassicLink"])] (Util.drop_empty diff --git a/libraries/ec2/lib/disassociateAddress.ml b/libraries/ec2/lib/disassociateAddress.ml index a709c6aae..968258ef3 100644 --- a/libraries/ec2/lib/disassociateAddress.ml +++ b/libraries/ec2/lib/disassociateAddress.ml @@ -4,9 +4,11 @@ type input = DisassociateAddressRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DisassociateAddress"])] (Util.drop_empty diff --git a/libraries/ec2/lib/disassociateRouteTable.ml b/libraries/ec2/lib/disassociateRouteTable.ml index 70038b469..a8c692715 100644 --- a/libraries/ec2/lib/disassociateRouteTable.ml +++ b/libraries/ec2/lib/disassociateRouteTable.ml @@ -4,9 +4,11 @@ type input = DisassociateRouteTableRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["DisassociateRouteTable"])] diff --git a/libraries/ec2/lib/enableVgwRoutePropagation.ml b/libraries/ec2/lib/enableVgwRoutePropagation.ml index 0b6453618..4f2e77f18 100644 --- a/libraries/ec2/lib/enableVgwRoutePropagation.ml +++ b/libraries/ec2/lib/enableVgwRoutePropagation.ml @@ -4,9 +4,11 @@ type input = EnableVgwRoutePropagationRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["EnableVgwRoutePropagation"])] diff --git a/libraries/ec2/lib/enableVolumeIO.ml b/libraries/ec2/lib/enableVolumeIO.ml index 13f352e9c..0d416c943 100644 --- a/libraries/ec2/lib/enableVolumeIO.ml +++ b/libraries/ec2/lib/enableVolumeIO.ml @@ -4,9 +4,11 @@ type input = EnableVolumeIORequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["EnableVolumeIO"])] (Util.drop_empty diff --git a/libraries/ec2/lib/enableVpcClassicLink.ml b/libraries/ec2/lib/enableVpcClassicLink.ml index 1411f553a..3e904a408 100644 --- a/libraries/ec2/lib/enableVpcClassicLink.ml +++ b/libraries/ec2/lib/enableVpcClassicLink.ml @@ -4,9 +4,11 @@ type input = EnableVpcClassicLinkRequest.t type output = EnableVpcClassicLinkResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["EnableVpcClassicLink"])] (Util.drop_empty diff --git a/libraries/ec2/lib/getConsoleOutput.ml b/libraries/ec2/lib/getConsoleOutput.ml index 482dcf740..a2eb51c96 100644 --- a/libraries/ec2/lib/getConsoleOutput.ml +++ b/libraries/ec2/lib/getConsoleOutput.ml @@ -4,9 +4,11 @@ type input = GetConsoleOutputRequest.t type output = GetConsoleOutputResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["GetConsoleOutput"])] (Util.drop_empty diff --git a/libraries/ec2/lib/getPasswordData.ml b/libraries/ec2/lib/getPasswordData.ml index f3083dc3f..ae74b9892 100644 --- a/libraries/ec2/lib/getPasswordData.ml +++ b/libraries/ec2/lib/getPasswordData.ml @@ -4,9 +4,11 @@ type input = GetPasswordDataRequest.t type output = GetPasswordDataResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["GetPasswordData"])] (Util.drop_empty diff --git a/libraries/ec2/lib/importImage.ml b/libraries/ec2/lib/importImage.ml index 62752a682..ae8209ac5 100644 --- a/libraries/ec2/lib/importImage.ml +++ b/libraries/ec2/lib/importImage.ml @@ -4,9 +4,11 @@ type input = ImportImageRequest.t type output = ImportImageResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ImportImage"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ec2/lib/importInstance.ml b/libraries/ec2/lib/importInstance.ml index e7960a1df..bb88a6d23 100644 --- a/libraries/ec2/lib/importInstance.ml +++ b/libraries/ec2/lib/importInstance.ml @@ -4,9 +4,11 @@ type input = ImportInstanceRequest.t type output = ImportInstanceResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ImportInstance"])] (Util.drop_empty diff --git a/libraries/ec2/lib/importKeyPair.ml b/libraries/ec2/lib/importKeyPair.ml index bd34a7adf..72c39c3d6 100644 --- a/libraries/ec2/lib/importKeyPair.ml +++ b/libraries/ec2/lib/importKeyPair.ml @@ -4,9 +4,11 @@ type input = ImportKeyPairRequest.t type output = ImportKeyPairResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ImportKeyPair"])] (Util.drop_empty diff --git a/libraries/ec2/lib/importSnapshot.ml b/libraries/ec2/lib/importSnapshot.ml index 2680db91f..833cf123f 100644 --- a/libraries/ec2/lib/importSnapshot.ml +++ b/libraries/ec2/lib/importSnapshot.ml @@ -4,9 +4,11 @@ type input = ImportSnapshotRequest.t type output = ImportSnapshotResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ImportSnapshot"])] (Util.drop_empty diff --git a/libraries/ec2/lib/importVolume.ml b/libraries/ec2/lib/importVolume.ml index 4d2cd95ec..6b04c59ed 100644 --- a/libraries/ec2/lib/importVolume.ml +++ b/libraries/ec2/lib/importVolume.ml @@ -4,9 +4,11 @@ type input = ImportVolumeRequest.t type output = ImportVolumeResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ImportVolume"])] (Util.drop_empty diff --git a/libraries/ec2/lib/modifyImageAttribute.ml b/libraries/ec2/lib/modifyImageAttribute.ml index 2dca03fa6..fac38a3ad 100644 --- a/libraries/ec2/lib/modifyImageAttribute.ml +++ b/libraries/ec2/lib/modifyImageAttribute.ml @@ -4,9 +4,11 @@ type input = ModifyImageAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyImageAttribute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/modifyInstanceAttribute.ml b/libraries/ec2/lib/modifyInstanceAttribute.ml index f40df1656..9d7e9dd56 100644 --- a/libraries/ec2/lib/modifyInstanceAttribute.ml +++ b/libraries/ec2/lib/modifyInstanceAttribute.ml @@ -4,9 +4,11 @@ type input = ModifyInstanceAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyInstanceAttribute"])] diff --git a/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml b/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml index a35a6a547..ad1f6bc10 100644 --- a/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml +++ b/libraries/ec2/lib/modifyNetworkInterfaceAttribute.ml @@ -4,9 +4,11 @@ type input = ModifyNetworkInterfaceAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyNetworkInterfaceAttribute"])] diff --git a/libraries/ec2/lib/modifyReservedInstances.ml b/libraries/ec2/lib/modifyReservedInstances.ml index 9cef467bd..376487523 100644 --- a/libraries/ec2/lib/modifyReservedInstances.ml +++ b/libraries/ec2/lib/modifyReservedInstances.ml @@ -4,9 +4,11 @@ type input = ModifyReservedInstancesRequest.t type output = ModifyReservedInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyReservedInstances"])] diff --git a/libraries/ec2/lib/modifySnapshotAttribute.ml b/libraries/ec2/lib/modifySnapshotAttribute.ml index bad350241..052582ca9 100644 --- a/libraries/ec2/lib/modifySnapshotAttribute.ml +++ b/libraries/ec2/lib/modifySnapshotAttribute.ml @@ -4,9 +4,11 @@ type input = ModifySnapshotAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifySnapshotAttribute"])] diff --git a/libraries/ec2/lib/modifySubnetAttribute.ml b/libraries/ec2/lib/modifySubnetAttribute.ml index dc4908909..edf610a91 100644 --- a/libraries/ec2/lib/modifySubnetAttribute.ml +++ b/libraries/ec2/lib/modifySubnetAttribute.ml @@ -4,9 +4,11 @@ type input = ModifySubnetAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifySubnetAttribute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/modifyVolumeAttribute.ml b/libraries/ec2/lib/modifyVolumeAttribute.ml index 658ac7703..355d37428 100644 --- a/libraries/ec2/lib/modifyVolumeAttribute.ml +++ b/libraries/ec2/lib/modifyVolumeAttribute.ml @@ -4,9 +4,11 @@ type input = ModifyVolumeAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyVolumeAttribute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/modifyVpcAttribute.ml b/libraries/ec2/lib/modifyVpcAttribute.ml index 5856a2dd6..81eb4ccdb 100644 --- a/libraries/ec2/lib/modifyVpcAttribute.ml +++ b/libraries/ec2/lib/modifyVpcAttribute.ml @@ -4,9 +4,11 @@ type input = ModifyVpcAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyVpcAttribute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/modifyVpcEndpoint.ml b/libraries/ec2/lib/modifyVpcEndpoint.ml index d010ad1cc..ddecb465a 100644 --- a/libraries/ec2/lib/modifyVpcEndpoint.ml +++ b/libraries/ec2/lib/modifyVpcEndpoint.ml @@ -4,9 +4,11 @@ type input = ModifyVpcEndpointRequest.t type output = ModifyVpcEndpointResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ModifyVpcEndpoint"])] (Util.drop_empty diff --git a/libraries/ec2/lib/monitorInstances.ml b/libraries/ec2/lib/monitorInstances.ml index 9868afaaf..be411dee9 100644 --- a/libraries/ec2/lib/monitorInstances.ml +++ b/libraries/ec2/lib/monitorInstances.ml @@ -4,9 +4,11 @@ type input = MonitorInstancesRequest.t type output = MonitorInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["MonitorInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/moveAddressToVpc.ml b/libraries/ec2/lib/moveAddressToVpc.ml index 7139f791c..32cfc1b32 100644 --- a/libraries/ec2/lib/moveAddressToVpc.ml +++ b/libraries/ec2/lib/moveAddressToVpc.ml @@ -4,9 +4,11 @@ type input = MoveAddressToVpcRequest.t type output = MoveAddressToVpcResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["MoveAddressToVpc"])] (Util.drop_empty diff --git a/libraries/ec2/lib/purchaseReservedInstancesOffering.ml b/libraries/ec2/lib/purchaseReservedInstancesOffering.ml index 308cdcf37..8846faafb 100644 --- a/libraries/ec2/lib/purchaseReservedInstancesOffering.ml +++ b/libraries/ec2/lib/purchaseReservedInstancesOffering.ml @@ -4,9 +4,11 @@ type input = PurchaseReservedInstancesOfferingRequest.t type output = PurchaseReservedInstancesOfferingResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["PurchaseReservedInstancesOffering"])] diff --git a/libraries/ec2/lib/rebootInstances.ml b/libraries/ec2/lib/rebootInstances.ml index 9dc17cce2..846ca18c8 100644 --- a/libraries/ec2/lib/rebootInstances.ml +++ b/libraries/ec2/lib/rebootInstances.ml @@ -4,9 +4,11 @@ type input = RebootInstancesRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RebootInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/registerImage.ml b/libraries/ec2/lib/registerImage.ml index 7b1037e6a..442fe2cf9 100644 --- a/libraries/ec2/lib/registerImage.ml +++ b/libraries/ec2/lib/registerImage.ml @@ -4,9 +4,11 @@ type input = RegisterImageRequest.t type output = RegisterImageResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RegisterImage"])] (Util.drop_empty diff --git a/libraries/ec2/lib/rejectVpcPeeringConnection.ml b/libraries/ec2/lib/rejectVpcPeeringConnection.ml index 672970a67..785d9fa13 100644 --- a/libraries/ec2/lib/rejectVpcPeeringConnection.ml +++ b/libraries/ec2/lib/rejectVpcPeeringConnection.ml @@ -4,9 +4,11 @@ type input = RejectVpcPeeringConnectionRequest.t type output = RejectVpcPeeringConnectionResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RejectVpcPeeringConnection"])] diff --git a/libraries/ec2/lib/releaseAddress.ml b/libraries/ec2/lib/releaseAddress.ml index 4f5d336a1..de4fea142 100644 --- a/libraries/ec2/lib/releaseAddress.ml +++ b/libraries/ec2/lib/releaseAddress.ml @@ -4,9 +4,11 @@ type input = ReleaseAddressRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ReleaseAddress"])] (Util.drop_empty diff --git a/libraries/ec2/lib/replaceNetworkAclAssociation.ml b/libraries/ec2/lib/replaceNetworkAclAssociation.ml index ba73f737b..e05d0a0fb 100644 --- a/libraries/ec2/lib/replaceNetworkAclAssociation.ml +++ b/libraries/ec2/lib/replaceNetworkAclAssociation.ml @@ -4,9 +4,11 @@ type input = ReplaceNetworkAclAssociationRequest.t type output = ReplaceNetworkAclAssociationResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ReplaceNetworkAclAssociation"])] diff --git a/libraries/ec2/lib/replaceNetworkAclEntry.ml b/libraries/ec2/lib/replaceNetworkAclEntry.ml index 00d137b4b..021d435d9 100644 --- a/libraries/ec2/lib/replaceNetworkAclEntry.ml +++ b/libraries/ec2/lib/replaceNetworkAclEntry.ml @@ -4,9 +4,11 @@ type input = ReplaceNetworkAclEntryRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ReplaceNetworkAclEntry"])] diff --git a/libraries/ec2/lib/replaceRoute.ml b/libraries/ec2/lib/replaceRoute.ml index 83b67b0c0..161761224 100644 --- a/libraries/ec2/lib/replaceRoute.ml +++ b/libraries/ec2/lib/replaceRoute.ml @@ -4,9 +4,11 @@ type input = ReplaceRouteRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ReplaceRoute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/replaceRouteTableAssociation.ml b/libraries/ec2/lib/replaceRouteTableAssociation.ml index 52669b355..99ce855ae 100644 --- a/libraries/ec2/lib/replaceRouteTableAssociation.ml +++ b/libraries/ec2/lib/replaceRouteTableAssociation.ml @@ -4,9 +4,11 @@ type input = ReplaceRouteTableAssociationRequest.t type output = ReplaceRouteTableAssociationResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ReplaceRouteTableAssociation"])] diff --git a/libraries/ec2/lib/reportInstanceStatus.ml b/libraries/ec2/lib/reportInstanceStatus.ml index 820788ff6..037081392 100644 --- a/libraries/ec2/lib/reportInstanceStatus.ml +++ b/libraries/ec2/lib/reportInstanceStatus.ml @@ -4,9 +4,11 @@ type input = ReportInstanceStatusRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ReportInstanceStatus"])] (Util.drop_empty diff --git a/libraries/ec2/lib/requestSpotFleet.ml b/libraries/ec2/lib/requestSpotFleet.ml index 5d474c99d..1589175bb 100644 --- a/libraries/ec2/lib/requestSpotFleet.ml +++ b/libraries/ec2/lib/requestSpotFleet.ml @@ -4,9 +4,11 @@ type input = RequestSpotFleetRequest.t type output = RequestSpotFleetResponse.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RequestSpotFleet"])] (Util.drop_empty diff --git a/libraries/ec2/lib/requestSpotInstances.ml b/libraries/ec2/lib/requestSpotInstances.ml index 9118180e8..94e81c2f9 100644 --- a/libraries/ec2/lib/requestSpotInstances.ml +++ b/libraries/ec2/lib/requestSpotInstances.ml @@ -4,9 +4,11 @@ type input = RequestSpotInstancesRequest.t type output = RequestSpotInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RequestSpotInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/resetImageAttribute.ml b/libraries/ec2/lib/resetImageAttribute.ml index 8ecab2f9b..054cf94ae 100644 --- a/libraries/ec2/lib/resetImageAttribute.ml +++ b/libraries/ec2/lib/resetImageAttribute.ml @@ -4,9 +4,11 @@ type input = ResetImageAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ResetImageAttribute"])] (Util.drop_empty diff --git a/libraries/ec2/lib/resetInstanceAttribute.ml b/libraries/ec2/lib/resetInstanceAttribute.ml index 4a299d30b..e3054d51e 100644 --- a/libraries/ec2/lib/resetInstanceAttribute.ml +++ b/libraries/ec2/lib/resetInstanceAttribute.ml @@ -4,9 +4,11 @@ type input = ResetInstanceAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ResetInstanceAttribute"])] diff --git a/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml b/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml index 8def63c09..e2175ae27 100644 --- a/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml +++ b/libraries/ec2/lib/resetNetworkInterfaceAttribute.ml @@ -4,9 +4,11 @@ type input = ResetNetworkInterfaceAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ResetNetworkInterfaceAttribute"])] diff --git a/libraries/ec2/lib/resetSnapshotAttribute.ml b/libraries/ec2/lib/resetSnapshotAttribute.ml index 5cf9b8104..c9b1c80f9 100644 --- a/libraries/ec2/lib/resetSnapshotAttribute.ml +++ b/libraries/ec2/lib/resetSnapshotAttribute.ml @@ -4,9 +4,11 @@ type input = ResetSnapshotAttributeRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["ResetSnapshotAttribute"])] diff --git a/libraries/ec2/lib/restoreAddressToClassic.ml b/libraries/ec2/lib/restoreAddressToClassic.ml index 496493467..2f967e374 100644 --- a/libraries/ec2/lib/restoreAddressToClassic.ml +++ b/libraries/ec2/lib/restoreAddressToClassic.ml @@ -4,9 +4,11 @@ type input = RestoreAddressToClassicRequest.t type output = RestoreAddressToClassicResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RestoreAddressToClassic"])] diff --git a/libraries/ec2/lib/revokeSecurityGroupEgress.ml b/libraries/ec2/lib/revokeSecurityGroupEgress.ml index 8c521c8ee..af6c5e4bc 100644 --- a/libraries/ec2/lib/revokeSecurityGroupEgress.ml +++ b/libraries/ec2/lib/revokeSecurityGroupEgress.ml @@ -4,9 +4,11 @@ type input = RevokeSecurityGroupEgressRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RevokeSecurityGroupEgress"])] diff --git a/libraries/ec2/lib/revokeSecurityGroupIngress.ml b/libraries/ec2/lib/revokeSecurityGroupIngress.ml index baf1b8998..eeb2176c4 100644 --- a/libraries/ec2/lib/revokeSecurityGroupIngress.ml +++ b/libraries/ec2/lib/revokeSecurityGroupIngress.ml @@ -4,9 +4,11 @@ type input = RevokeSecurityGroupIngressRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RevokeSecurityGroupIngress"])] diff --git a/libraries/ec2/lib/runInstances.ml b/libraries/ec2/lib/runInstances.ml index aeacb3163..9abe1d949 100644 --- a/libraries/ec2/lib/runInstances.ml +++ b/libraries/ec2/lib/runInstances.ml @@ -4,9 +4,11 @@ type input = RunInstancesRequest.t type output = Reservation.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["RunInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/startInstances.ml b/libraries/ec2/lib/startInstances.ml index 1c862cead..c111c0e37 100644 --- a/libraries/ec2/lib/startInstances.ml +++ b/libraries/ec2/lib/startInstances.ml @@ -4,9 +4,11 @@ type input = StartInstancesRequest.t type output = StartInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["StartInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/stopInstances.ml b/libraries/ec2/lib/stopInstances.ml index a5d24957a..fc75776ce 100644 --- a/libraries/ec2/lib/stopInstances.ml +++ b/libraries/ec2/lib/stopInstances.ml @@ -4,9 +4,11 @@ type input = StopInstancesRequest.t type output = StopInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["StopInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/terminateInstances.ml b/libraries/ec2/lib/terminateInstances.ml index db33ebe7a..28a63d0fb 100644 --- a/libraries/ec2/lib/terminateInstances.ml +++ b/libraries/ec2/lib/terminateInstances.ml @@ -4,9 +4,11 @@ type input = TerminateInstancesRequest.t type output = TerminateInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["TerminateInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib/types.ml b/libraries/ec2/lib/types.ml index 79cbeef3b..24879e64b 100644 --- a/libraries/ec2/lib/types.ml +++ b/libraries/ec2/lib/types.ml @@ -10,6 +10,8 @@ module VolumeType = | Gp2 let str_to_t = [("gp2", Gp2); ("io1", Io1); ("standard", Standard)] let t_to_str = [(Gp2, "gp2"); (Io1, "io1"); (Standard, "standard")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -230,6 +232,8 @@ module AttachmentStatus = (Detaching, "detaching"); (Attached, "attached"); (Attaching, "attaching")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -349,6 +353,8 @@ module DiskImageFormat = | VHD let str_to_t = [("VHD", VHD); ("RAW", RAW); ("VMDK", VMDK)] let t_to_str = [(VHD, "VHD"); (RAW, "RAW"); (VMDK, "VMDK")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -743,6 +749,8 @@ module NetworkInterfaceStatus = (In_use, "in-use"); (Attaching, "attaching"); (Available, "available")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -761,6 +769,8 @@ module ProductCodeValues = | Marketplace let str_to_t = [("marketplace", Marketplace); ("devpay", Devpay)] let t_to_str = [(Marketplace, "marketplace"); (Devpay, "devpay")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -956,6 +966,8 @@ module InstanceType = (M1_medium, "m1.medium"); (M1_small, "m1.small"); (T1_micro, "t1.micro")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1064,6 +1076,8 @@ module StatusName = | Reachability let str_to_t = [("reachability", Reachability)] let t_to_str = [(Reachability, "reachability")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1092,6 +1106,8 @@ module StatusType = (Insufficient_data, "insufficient-data"); (Failed, "failed"); (Passed, "passed")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1329,6 +1345,8 @@ module VolumeStatusName = [("io-performance", Io_performance); ("io-enabled", Io_enabled)] let t_to_str = [(Io_performance, "io-performance"); (Io_enabled, "io-enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1597,6 +1615,8 @@ module InstanceStateName = (Shutting_down, "shutting-down"); (Running, "running"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1625,6 +1645,8 @@ module MonitoringState = (Enabled, "enabled"); (Disabling, "disabling"); (Disabled, "disabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1643,6 +1665,8 @@ module Tenancy = | Dedicated let str_to_t = [("dedicated", Dedicated); ("default", Default)] let t_to_str = [(Dedicated, "dedicated"); (Default, "default")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1874,6 +1898,8 @@ module RecurringChargeFrequency = | Hourly let str_to_t = [("Hourly", Hourly)] let t_to_str = [(Hourly, "Hourly")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2000,6 +2026,8 @@ module RouteOrigin = [(EnableVgwRoutePropagation, "EnableVgwRoutePropagation"); (CreateRoute, "CreateRoute"); (CreateRouteTable, "CreateRouteTable")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2018,6 +2046,8 @@ module RouteState = | Blackhole let str_to_t = [("blackhole", Blackhole); ("active", Active)] let t_to_str = [(Blackhole, "blackhole"); (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2046,6 +2076,8 @@ module ListingState = (Cancelled, "cancelled"); (Sold, "sold"); (Available, "available")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2063,6 +2095,8 @@ module CurrencyCodeValues = | USD let str_to_t = [("USD", USD)] let t_to_str = [(USD, "USD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2094,6 +2128,8 @@ module EventCode = (System_maintenance, "system-maintenance"); (System_reboot, "system-reboot"); (Instance_reboot, "instance-reboot")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2460,6 +2496,8 @@ module VolumeAttachmentState = (Detaching, "detaching"); (Attached, "attached"); (Attaching, "attaching")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2478,6 +2516,8 @@ module TelemetryStatus = | DOWN let str_to_t = [("DOWN", DOWN); ("UP", UP)] let t_to_str = [(DOWN, "DOWN"); (UP, "UP")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2506,6 +2546,8 @@ module VpnState = (Deleting, "deleting"); (Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2523,6 +2565,8 @@ module VpnStaticRouteSource = | Static let str_to_t = [("Static", Static)] let t_to_str = [(Static, "Static")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2541,6 +2585,8 @@ module ArchitectureValues = | X86_64 let str_to_t = [("x86_64", X86_64); ("i386", I386)] let t_to_str = [(X86_64, "x86_64"); (I386, "i386")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2559,6 +2605,8 @@ module DeviceType = | Instance_store let str_to_t = [("instance-store", Instance_store); ("ebs", Ebs)] let t_to_str = [(Instance_store, "instance-store"); (Ebs, "ebs")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2577,6 +2625,8 @@ module HypervisorType = | Xen let str_to_t = [("xen", Xen); ("ovm", Ovm)] let t_to_str = [(Xen, "xen"); (Ovm, "ovm")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2636,6 +2686,8 @@ module InstanceLifecycleType = | Spot let str_to_t = [("spot", Spot)] let t_to_str = [(Spot, "spot")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2773,6 +2825,8 @@ module PlatformValues = | Windows let str_to_t = [("Windows", Windows)] let t_to_str = [(Windows, "Windows")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2843,6 +2897,8 @@ module VirtualizationType = | Paravirtual let str_to_t = [("paravirtual", Paravirtual); ("hvm", Hvm)] let t_to_str = [(Paravirtual, "paravirtual"); (Hvm, "hvm")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2921,6 +2977,8 @@ module RuleAction = | Deny let str_to_t = [("deny", Deny); ("allow", Allow)] let t_to_str = [(Deny, "deny"); (Allow, "allow")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -3220,6 +3278,8 @@ module PermissionGroup = | All let str_to_t = [("all", All)] let t_to_str = [(All, "all")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -3622,6 +3682,8 @@ module SummaryStatus = (Insufficient_data, "insufficient-data"); (Impaired, "impaired"); (Ok, "ok")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -3664,6 +3726,8 @@ module ContainerFormat = | Ova let str_to_t = [("ova", Ova)] let t_to_str = [(Ova, "ova")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -3685,6 +3749,8 @@ module ExportEnvironment = [("microsoft", Microsoft); ("vmware", Vmware); ("citrix", Citrix)] let t_to_str = [(Microsoft, "microsoft"); (Vmware, "vmware"); (Citrix, "citrix")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -4075,6 +4141,8 @@ module VolumeStatusInfoStatus = [(Insufficient_data, "insufficient-data"); (Impaired, "impaired"); (Ok, "ok")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -4825,6 +4893,8 @@ module VpcPeeringConnectionStateReasonCode = (Active, "active"); (Pending_acceptance, "pending-acceptance"); (Initiating_request, "initiating-request")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5114,6 +5184,8 @@ module CancelBatchErrorCode = "fleetRequestNotInCancellableState"); (FleetRequestIdMalformed, "fleetRequestIdMalformed"); (FleetRequestIdDoesNotExist, "fleetRequestIdDoesNotExist")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5318,6 +5390,8 @@ module ResourceType = (Image, "image"); (Dhcp_options, "dhcp-options"); (Customer_gateway, "customer-gateway")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5346,6 +5420,8 @@ module GatewayType = | Ipsec_1 let str_to_t = [("ipsec.1", Ipsec_1)] let t_to_str = [(Ipsec_1, "ipsec.1")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5416,6 +5492,8 @@ module OfferingTypeValues = (Light_Utilization, "Light Utilization"); (Medium_Utilization, "Medium Utilization"); (Heavy_Utilization, "Heavy Utilization")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5444,6 +5522,8 @@ module RIProductDescription = (Windows, "Windows"); (Linux_UNIX__Amazon_VPC_, "Linux/UNIX (Amazon VPC)"); (Linux_UNIX, "Linux/UNIX")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5483,6 +5563,8 @@ module ReservedInstanceState = (Payment_failed, "payment-failed"); (Active, "active"); (Payment_pending, "payment-pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5521,6 +5603,8 @@ module PlacementGroupState = (Deleting, "deleting"); (Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5538,6 +5622,8 @@ module PlacementStrategy = | Cluster let str_to_t = [("cluster", Cluster)] let t_to_str = [(Cluster, "cluster")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5569,6 +5655,8 @@ module CancelSpotInstanceRequestState = (Closed, "closed"); (Open, "open"); (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5631,6 +5719,8 @@ module ConversionTaskState = (Cancelled, "cancelled"); (Cancelling, "cancelling"); (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5842,6 +5932,8 @@ module EventType = [(Error, "error"); (FleetRequestChange, "fleetRequestChange"); (InstanceChange, "instanceChange")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5945,6 +6037,8 @@ module ListingStatus = (Cancelled, "cancelled"); (Pending, "pending"); (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -5977,6 +6071,8 @@ module MoveStatus = let t_to_str = [(RestoringToClassic, "restoringToClassic"); (MovingToVpc, "movingToVpc")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6065,6 +6161,8 @@ module ImageState = (Invalid, "invalid"); (Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6086,6 +6184,8 @@ module ImageTypeValues = [("ramdisk", Ramdisk); ("kernel", Kernel); ("machine", Machine)] let t_to_str = [(Ramdisk, "ramdisk"); (Kernel, "kernel"); (Machine, "machine")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6433,6 +6533,8 @@ module SpotInstanceState = (Closed, "closed"); (Active, "active"); (Open, "open")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6526,6 +6628,8 @@ module SpotInstanceType = | Persistent let str_to_t = [("persistent", Persistent); ("one-time", One_time)] let t_to_str = [(Persistent, "persistent"); (One_time, "one-time")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6554,6 +6658,8 @@ module ExportTaskState = (Cancelled, "cancelled"); (Cancelling, "cancelling"); (Active, "active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6752,6 +6858,8 @@ module BatchState = (Cancelled, "cancelled"); (Active, "active"); (Submitted, "submitted")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6899,6 +7007,8 @@ module AvailabilityZoneState = | Available let str_to_t = [("available", Available)] let t_to_str = [(Available, "available")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6918,6 +7028,8 @@ module TrafficType = | ALL let str_to_t = [("ALL", ALL); ("REJECT", REJECT); ("ACCEPT", ACCEPT)] let t_to_str = [(ALL, "ALL"); (REJECT, "REJECT"); (ACCEPT, "ACCEPT")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -6987,6 +7099,8 @@ module BundleTaskState = (Bundling, "bundling"); (Waiting_for_shutdown, "waiting-for-shutdown"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -7150,6 +7264,8 @@ module VolumeState = (In_use, "in-use"); (Available, "available"); (Creating, "creating")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -7168,6 +7284,8 @@ module DomainType = | Standard let str_to_t = [("standard", Standard); ("vpc", Vpc)] let t_to_str = [(Standard, "standard"); (Vpc, "vpc")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -7342,6 +7460,8 @@ module VpcState = | Available let str_to_t = [("available", Available); ("pending", Pending)] let t_to_str = [(Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -7382,6 +7502,8 @@ module SubnetState = | Available let str_to_t = [("available", Available); ("pending", Pending)] let t_to_str = [(Available, "available"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -7540,6 +7662,8 @@ module State = (Deleting, "Deleting"); (Available, "Available"); (Pending, "Pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -7595,6 +7719,8 @@ module SnapshotState = [("error", Error); ("completed", Completed); ("pending", Pending)] let t_to_str = [(Error, "error"); (Completed, "completed"); (Pending, "pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -8536,6 +8662,8 @@ module DatafeedSubscriptionState = | Inactive let str_to_t = [("Inactive", Inactive); ("Active", Active)] let t_to_str = [(Inactive, "Inactive"); (Active, "Active")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -10215,6 +10343,8 @@ module AccountAttributeName = let t_to_str = [(Default_vpc, "default-vpc"); (Supported_platforms, "supported-platforms")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -12286,6 +12416,8 @@ module ReportInstanceReasonCodes = (Not_accepting_credentials, "not-accepting-credentials"); (Unresponsive, "unresponsive"); (Instance_stuck_in_state, "instance-stuck-in-state")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -12362,6 +12494,8 @@ module ShutdownBehavior = | Terminate let str_to_t = [("terminate", Terminate); ("stop", Stop)] let t_to_str = [(Terminate, "terminate"); (Stop, "stop")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -12787,6 +12921,8 @@ module VpcAttributeName = let t_to_str = [(EnableDnsHostnames, "enableDnsHostnames"); (EnableDnsSupport, "enableDnsSupport")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -13051,6 +13187,8 @@ module OperationType = | Remove let str_to_t = [("remove", Remove); ("add", Add)] let t_to_str = [(Remove, "remove"); (Add, "add")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -13138,6 +13276,8 @@ module InstanceAttributeName = (Ramdisk, "ramdisk"); (Kernel, "kernel"); (InstanceType, "instanceType")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -13577,6 +13717,8 @@ module Status = [(InClassic, "InClassic"); (InVpc, "InVpc"); (MoveInProgress, "MoveInProgress")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -13917,6 +14059,8 @@ module SnapshotAttributeName = let t_to_str = [(CreateVolumePermission, "createVolumePermission"); (ProductCodes, "productCodes")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -14058,6 +14202,8 @@ module VolumeAttributeName = [("productCodes", ProductCodes); ("autoEnableIO", AutoEnableIO)] let t_to_str = [(ProductCodes, "productCodes"); (AutoEnableIO, "autoEnableIO")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -14517,6 +14663,8 @@ module FlowLogsResourceType = [(NetworkInterface, "NetworkInterface"); (Subnet, "Subnet"); (VPC, "VPC")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -14606,6 +14754,8 @@ module ReportStatusType = | Impaired let str_to_t = [("impaired", Impaired); ("ok", Ok)] let t_to_str = [(Impaired, "impaired"); (Ok, "ok")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -14854,6 +15004,8 @@ module ImageAttributeName = (Ramdisk, "ramdisk"); (Kernel, "kernel"); (Description, "description")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -14892,6 +15044,8 @@ module NetworkInterfaceAttribute = (SourceDestCheck, "sourceDestCheck"); (GroupSet, "groupSet"); (Description, "description")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -14946,6 +15100,8 @@ module ResetImageAttributeName = | LaunchPermission let str_to_t = [("launchPermission", LaunchPermission)] let t_to_str = [(LaunchPermission, "launchPermission")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/ec2/lib/unassignPrivateIpAddresses.ml b/libraries/ec2/lib/unassignPrivateIpAddresses.ml index 4fe628b17..7128f6856 100644 --- a/libraries/ec2/lib/unassignPrivateIpAddresses.ml +++ b/libraries/ec2/lib/unassignPrivateIpAddresses.ml @@ -4,9 +4,11 @@ type input = UnassignPrivateIpAddressesRequest.t type output = unit type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["UnassignPrivateIpAddresses"])] diff --git a/libraries/ec2/lib/unmonitorInstances.ml b/libraries/ec2/lib/unmonitorInstances.ml index 5833e590e..21e909d70 100644 --- a/libraries/ec2/lib/unmonitorInstances.ml +++ b/libraries/ec2/lib/unmonitorInstances.ml @@ -4,9 +4,11 @@ type input = UnmonitorInstancesRequest.t type output = UnmonitorInstancesResult.t type error = Errors_internal.t let service = "ec2" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ec2.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-04-15"]); ("Action", ["UnmonitorInstances"])] (Util.drop_empty diff --git a/libraries/ec2/lib_test/aws_ec2_test.ml b/libraries/ec2/lib_test/aws_ec2_test.ml index 7747d5742..16d0622ef 100644 --- a/libraries/ec2/lib_test/aws_ec2_test.ml +++ b/libraries/ec2/lib_test/aws_ec2_test.ml @@ -30,27 +30,6 @@ module TestSuite(Runtime : sig | `Error err -> begin Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); false end end - let describe_regions_error () = - let open Aws.Error in - let res = Runtime.(un_m (run_request - ~region:"mars-western" - (module DescribeRegions) - (Types.DescribeRegionsRequest.make ()))) in - "DescribeRegions returns error" - @? begin match res with - | `Ok resp -> - false - (* NOTE(dbp 2015-03-13): I have _NO_ idea why AWS would think that asking for - a non-existent region is an AuthFailure... But that's what it returns. *) - | `Error (HttpError (401, AwsError [Understood Errors_internal.AuthFailure, _])) -> - true - | `Error err -> - begin - Printf.printf "Error: %s\n" (Aws.Error.format Errors_internal.to_string err); - false - end - end - let create_security_group () = let result = Runtime.(un_m (run_request ~region:"us-east-1" @@ -89,7 +68,6 @@ module TestSuite(Runtime : sig | `Ok _ -> true | `Error e -> begin print_endline (Aws.Error.format Errors_internal.to_string e); false end end - ;; let create_instance () = let result = Runtime.(un_m (run_request @@ -108,7 +86,6 @@ module TestSuite(Runtime : sig | x::xs -> Some x end | `Error e -> begin print_endline (Aws.Error.format Errors_internal.to_string e); None end - ;; let create () = let result = create_instance () in @@ -123,7 +100,9 @@ module TestSuite(Runtime : sig in (* NOTE(dbp 2015-01-21): In seems that sometimes if you hit it quickly enough, * the api doesn't know about the instance and errors. This is obviously bad! *) + Printf.printf "waiting for instance to be created"; Unix.sleep 3; + let result = Runtime.(un_m (run_request ~region:"us-east-1" (module TerminateInstances) @@ -134,11 +113,9 @@ module TestSuite(Runtime : sig | `Ok _ -> true | `Error e -> begin print_endline (Aws.Error.format Errors_internal.to_string e); false end end - ;; let test_cases = [ "Describe Regions" >:: describe_regions_json - ; "Describe Regions Errors" >:: describe_regions_error ; "Create Instance" >:: create ; "Find Security Group" >:: create_security_group_test ] diff --git a/libraries/elasticache/lib/addTagsToResource.ml b/libraries/elasticache/lib/addTagsToResource.ml index 0142ed843..2f84cd515 100644 --- a/libraries/elasticache/lib/addTagsToResource.ml +++ b/libraries/elasticache/lib/addTagsToResource.ml @@ -4,9 +4,11 @@ type input = AddTagsToResourceMessage.t type output = TagListMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["AddTagsToResource"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml b/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml index 413c3e07a..a236405a5 100644 --- a/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml +++ b/libraries/elasticache/lib/authorizeCacheSecurityGroupIngress.ml @@ -4,9 +4,11 @@ type input = AuthorizeCacheSecurityGroupIngressMessage.t type output = AuthorizeCacheSecurityGroupIngressResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["AuthorizeCacheSecurityGroupIngress"])] diff --git a/libraries/elasticache/lib/copySnapshot.ml b/libraries/elasticache/lib/copySnapshot.ml index 53f632648..918c6ea28 100644 --- a/libraries/elasticache/lib/copySnapshot.ml +++ b/libraries/elasticache/lib/copySnapshot.ml @@ -4,9 +4,11 @@ type input = CopySnapshotMessage.t type output = CopySnapshotResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CopySnapshot"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/createCacheCluster.ml b/libraries/elasticache/lib/createCacheCluster.ml index 8e298b8e6..4e6082eb8 100644 --- a/libraries/elasticache/lib/createCacheCluster.ml +++ b/libraries/elasticache/lib/createCacheCluster.ml @@ -4,9 +4,11 @@ type input = CreateCacheClusterMessage.t type output = CreateCacheClusterResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CreateCacheCluster"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/createCacheParameterGroup.ml b/libraries/elasticache/lib/createCacheParameterGroup.ml index 7f559ff1b..53b29e04b 100644 --- a/libraries/elasticache/lib/createCacheParameterGroup.ml +++ b/libraries/elasticache/lib/createCacheParameterGroup.ml @@ -4,9 +4,11 @@ type input = CreateCacheParameterGroupMessage.t type output = CreateCacheParameterGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CreateCacheParameterGroup"])] diff --git a/libraries/elasticache/lib/createCacheSecurityGroup.ml b/libraries/elasticache/lib/createCacheSecurityGroup.ml index e7f16740a..828e6e831 100644 --- a/libraries/elasticache/lib/createCacheSecurityGroup.ml +++ b/libraries/elasticache/lib/createCacheSecurityGroup.ml @@ -4,9 +4,11 @@ type input = CreateCacheSecurityGroupMessage.t type output = CreateCacheSecurityGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CreateCacheSecurityGroup"])] diff --git a/libraries/elasticache/lib/createCacheSubnetGroup.ml b/libraries/elasticache/lib/createCacheSubnetGroup.ml index d24eac942..e23898621 100644 --- a/libraries/elasticache/lib/createCacheSubnetGroup.ml +++ b/libraries/elasticache/lib/createCacheSubnetGroup.ml @@ -4,9 +4,11 @@ type input = CreateCacheSubnetGroupMessage.t type output = CreateCacheSubnetGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CreateCacheSubnetGroup"])] diff --git a/libraries/elasticache/lib/createReplicationGroup.ml b/libraries/elasticache/lib/createReplicationGroup.ml index c554925c8..163f2465d 100644 --- a/libraries/elasticache/lib/createReplicationGroup.ml +++ b/libraries/elasticache/lib/createReplicationGroup.ml @@ -4,9 +4,11 @@ type input = CreateReplicationGroupMessage.t type output = CreateReplicationGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CreateReplicationGroup"])] diff --git a/libraries/elasticache/lib/createSnapshot.ml b/libraries/elasticache/lib/createSnapshot.ml index f712e87a8..b23e53091 100644 --- a/libraries/elasticache/lib/createSnapshot.ml +++ b/libraries/elasticache/lib/createSnapshot.ml @@ -4,9 +4,11 @@ type input = CreateSnapshotMessage.t type output = CreateSnapshotResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["CreateSnapshot"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/deleteCacheCluster.ml b/libraries/elasticache/lib/deleteCacheCluster.ml index a3083a1d3..e1b8cebe3 100644 --- a/libraries/elasticache/lib/deleteCacheCluster.ml +++ b/libraries/elasticache/lib/deleteCacheCluster.ml @@ -4,9 +4,11 @@ type input = DeleteCacheClusterMessage.t type output = DeleteCacheClusterResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DeleteCacheCluster"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/deleteCacheParameterGroup.ml b/libraries/elasticache/lib/deleteCacheParameterGroup.ml index aa172d91c..7e513717c 100644 --- a/libraries/elasticache/lib/deleteCacheParameterGroup.ml +++ b/libraries/elasticache/lib/deleteCacheParameterGroup.ml @@ -4,9 +4,11 @@ type input = DeleteCacheParameterGroupMessage.t type output = unit type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DeleteCacheParameterGroup"])] diff --git a/libraries/elasticache/lib/deleteCacheSecurityGroup.ml b/libraries/elasticache/lib/deleteCacheSecurityGroup.ml index 90ac096f0..3e2885925 100644 --- a/libraries/elasticache/lib/deleteCacheSecurityGroup.ml +++ b/libraries/elasticache/lib/deleteCacheSecurityGroup.ml @@ -4,9 +4,11 @@ type input = DeleteCacheSecurityGroupMessage.t type output = unit type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DeleteCacheSecurityGroup"])] diff --git a/libraries/elasticache/lib/deleteCacheSubnetGroup.ml b/libraries/elasticache/lib/deleteCacheSubnetGroup.ml index 2d3562d98..60cb7c7d7 100644 --- a/libraries/elasticache/lib/deleteCacheSubnetGroup.ml +++ b/libraries/elasticache/lib/deleteCacheSubnetGroup.ml @@ -4,9 +4,11 @@ type input = DeleteCacheSubnetGroupMessage.t type output = unit type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DeleteCacheSubnetGroup"])] diff --git a/libraries/elasticache/lib/deleteReplicationGroup.ml b/libraries/elasticache/lib/deleteReplicationGroup.ml index 826d53bf8..c431e51a3 100644 --- a/libraries/elasticache/lib/deleteReplicationGroup.ml +++ b/libraries/elasticache/lib/deleteReplicationGroup.ml @@ -4,9 +4,11 @@ type input = DeleteReplicationGroupMessage.t type output = DeleteReplicationGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DeleteReplicationGroup"])] diff --git a/libraries/elasticache/lib/deleteSnapshot.ml b/libraries/elasticache/lib/deleteSnapshot.ml index e686ba774..0cf37d1d5 100644 --- a/libraries/elasticache/lib/deleteSnapshot.ml +++ b/libraries/elasticache/lib/deleteSnapshot.ml @@ -4,9 +4,11 @@ type input = DeleteSnapshotMessage.t type output = DeleteSnapshotResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DeleteSnapshot"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/describeCacheClusters.ml b/libraries/elasticache/lib/describeCacheClusters.ml index e4ce9ceef..84494bdb9 100644 --- a/libraries/elasticache/lib/describeCacheClusters.ml +++ b/libraries/elasticache/lib/describeCacheClusters.ml @@ -4,9 +4,11 @@ type input = DescribeCacheClustersMessage.t type output = CacheClusterMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheClusters"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/describeCacheEngineVersions.ml b/libraries/elasticache/lib/describeCacheEngineVersions.ml index 160315e33..15b24e2c2 100644 --- a/libraries/elasticache/lib/describeCacheEngineVersions.ml +++ b/libraries/elasticache/lib/describeCacheEngineVersions.ml @@ -4,9 +4,11 @@ type input = DescribeCacheEngineVersionsMessage.t type output = CacheEngineVersionMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheEngineVersions"])] diff --git a/libraries/elasticache/lib/describeCacheParameterGroups.ml b/libraries/elasticache/lib/describeCacheParameterGroups.ml index ac121f7f8..4feb3025a 100644 --- a/libraries/elasticache/lib/describeCacheParameterGroups.ml +++ b/libraries/elasticache/lib/describeCacheParameterGroups.ml @@ -4,9 +4,11 @@ type input = DescribeCacheParameterGroupsMessage.t type output = CacheParameterGroupsMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheParameterGroups"])] diff --git a/libraries/elasticache/lib/describeCacheParameters.ml b/libraries/elasticache/lib/describeCacheParameters.ml index ccf6dcd5f..1865970ba 100644 --- a/libraries/elasticache/lib/describeCacheParameters.ml +++ b/libraries/elasticache/lib/describeCacheParameters.ml @@ -4,9 +4,11 @@ type input = DescribeCacheParametersMessage.t type output = CacheParameterGroupDetails.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheParameters"])] diff --git a/libraries/elasticache/lib/describeCacheSecurityGroups.ml b/libraries/elasticache/lib/describeCacheSecurityGroups.ml index c8acc363b..3bb1f78e2 100644 --- a/libraries/elasticache/lib/describeCacheSecurityGroups.ml +++ b/libraries/elasticache/lib/describeCacheSecurityGroups.ml @@ -4,9 +4,11 @@ type input = DescribeCacheSecurityGroupsMessage.t type output = CacheSecurityGroupMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheSecurityGroups"])] diff --git a/libraries/elasticache/lib/describeCacheSubnetGroups.ml b/libraries/elasticache/lib/describeCacheSubnetGroups.ml index 1209188a3..077abf0e1 100644 --- a/libraries/elasticache/lib/describeCacheSubnetGroups.ml +++ b/libraries/elasticache/lib/describeCacheSubnetGroups.ml @@ -4,9 +4,11 @@ type input = DescribeCacheSubnetGroupsMessage.t type output = CacheSubnetGroupMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeCacheSubnetGroups"])] diff --git a/libraries/elasticache/lib/describeEngineDefaultParameters.ml b/libraries/elasticache/lib/describeEngineDefaultParameters.ml index d722fd36e..d06432a11 100644 --- a/libraries/elasticache/lib/describeEngineDefaultParameters.ml +++ b/libraries/elasticache/lib/describeEngineDefaultParameters.ml @@ -4,9 +4,11 @@ type input = DescribeEngineDefaultParametersMessage.t type output = DescribeEngineDefaultParametersResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeEngineDefaultParameters"])] diff --git a/libraries/elasticache/lib/describeEvents.ml b/libraries/elasticache/lib/describeEvents.ml index 760ce40f1..8c3fbaa85 100644 --- a/libraries/elasticache/lib/describeEvents.ml +++ b/libraries/elasticache/lib/describeEvents.ml @@ -4,9 +4,11 @@ type input = DescribeEventsMessage.t type output = EventsMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeEvents"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/describeReplicationGroups.ml b/libraries/elasticache/lib/describeReplicationGroups.ml index 81bb9e018..a268c4a18 100644 --- a/libraries/elasticache/lib/describeReplicationGroups.ml +++ b/libraries/elasticache/lib/describeReplicationGroups.ml @@ -4,9 +4,11 @@ type input = DescribeReplicationGroupsMessage.t type output = ReplicationGroupMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeReplicationGroups"])] diff --git a/libraries/elasticache/lib/describeReservedCacheNodes.ml b/libraries/elasticache/lib/describeReservedCacheNodes.ml index becaf943c..047ebecd2 100644 --- a/libraries/elasticache/lib/describeReservedCacheNodes.ml +++ b/libraries/elasticache/lib/describeReservedCacheNodes.ml @@ -4,9 +4,11 @@ type input = DescribeReservedCacheNodesMessage.t type output = ReservedCacheNodeMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeReservedCacheNodes"])] diff --git a/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml b/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml index 4b206a251..65432997b 100644 --- a/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml +++ b/libraries/elasticache/lib/describeReservedCacheNodesOfferings.ml @@ -4,9 +4,11 @@ type input = DescribeReservedCacheNodesOfferingsMessage.t type output = ReservedCacheNodesOfferingMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeReservedCacheNodesOfferings"])] diff --git a/libraries/elasticache/lib/describeSnapshots.ml b/libraries/elasticache/lib/describeSnapshots.ml index b42c9b902..b33982720 100644 --- a/libraries/elasticache/lib/describeSnapshots.ml +++ b/libraries/elasticache/lib/describeSnapshots.ml @@ -4,9 +4,11 @@ type input = DescribeSnapshotsMessage.t type output = DescribeSnapshotsListMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["DescribeSnapshots"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/listTagsForResource.ml b/libraries/elasticache/lib/listTagsForResource.ml index a79b58189..75aeaecdf 100644 --- a/libraries/elasticache/lib/listTagsForResource.ml +++ b/libraries/elasticache/lib/listTagsForResource.ml @@ -4,9 +4,11 @@ type input = ListTagsForResourceMessage.t type output = TagListMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["ListTagsForResource"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/modifyCacheCluster.ml b/libraries/elasticache/lib/modifyCacheCluster.ml index a914e80a7..3781e2611 100644 --- a/libraries/elasticache/lib/modifyCacheCluster.ml +++ b/libraries/elasticache/lib/modifyCacheCluster.ml @@ -4,9 +4,11 @@ type input = ModifyCacheClusterMessage.t type output = ModifyCacheClusterResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["ModifyCacheCluster"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/modifyCacheParameterGroup.ml b/libraries/elasticache/lib/modifyCacheParameterGroup.ml index c8d5655ac..967b2f52b 100644 --- a/libraries/elasticache/lib/modifyCacheParameterGroup.ml +++ b/libraries/elasticache/lib/modifyCacheParameterGroup.ml @@ -4,9 +4,11 @@ type input = ModifyCacheParameterGroupMessage.t type output = CacheParameterGroupNameMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["ModifyCacheParameterGroup"])] diff --git a/libraries/elasticache/lib/modifyCacheSubnetGroup.ml b/libraries/elasticache/lib/modifyCacheSubnetGroup.ml index dbf5dd19e..057631400 100644 --- a/libraries/elasticache/lib/modifyCacheSubnetGroup.ml +++ b/libraries/elasticache/lib/modifyCacheSubnetGroup.ml @@ -4,9 +4,11 @@ type input = ModifyCacheSubnetGroupMessage.t type output = ModifyCacheSubnetGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["ModifyCacheSubnetGroup"])] diff --git a/libraries/elasticache/lib/modifyReplicationGroup.ml b/libraries/elasticache/lib/modifyReplicationGroup.ml index eceacbf68..390297c57 100644 --- a/libraries/elasticache/lib/modifyReplicationGroup.ml +++ b/libraries/elasticache/lib/modifyReplicationGroup.ml @@ -4,9 +4,11 @@ type input = ModifyReplicationGroupMessage.t type output = ModifyReplicationGroupResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["ModifyReplicationGroup"])] diff --git a/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml b/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml index d14de1d54..41169a7f4 100644 --- a/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml +++ b/libraries/elasticache/lib/purchaseReservedCacheNodesOffering.ml @@ -4,9 +4,11 @@ type input = PurchaseReservedCacheNodesOfferingMessage.t type output = PurchaseReservedCacheNodesOfferingResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["PurchaseReservedCacheNodesOffering"])] diff --git a/libraries/elasticache/lib/rebootCacheCluster.ml b/libraries/elasticache/lib/rebootCacheCluster.ml index 195176d33..1924332b2 100644 --- a/libraries/elasticache/lib/rebootCacheCluster.ml +++ b/libraries/elasticache/lib/rebootCacheCluster.ml @@ -4,9 +4,11 @@ type input = RebootCacheClusterMessage.t type output = RebootCacheClusterResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["RebootCacheCluster"])] (Util.drop_empty diff --git a/libraries/elasticache/lib/removeTagsFromResource.ml b/libraries/elasticache/lib/removeTagsFromResource.ml index e947cd012..cf642829b 100644 --- a/libraries/elasticache/lib/removeTagsFromResource.ml +++ b/libraries/elasticache/lib/removeTagsFromResource.ml @@ -4,9 +4,11 @@ type input = RemoveTagsFromResourceMessage.t type output = TagListMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["RemoveTagsFromResource"])] diff --git a/libraries/elasticache/lib/resetCacheParameterGroup.ml b/libraries/elasticache/lib/resetCacheParameterGroup.ml index 2c6aea6fd..a2b2c26ae 100644 --- a/libraries/elasticache/lib/resetCacheParameterGroup.ml +++ b/libraries/elasticache/lib/resetCacheParameterGroup.ml @@ -4,9 +4,11 @@ type input = ResetCacheParameterGroupMessage.t type output = CacheParameterGroupNameMessage.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["ResetCacheParameterGroup"])] diff --git a/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml b/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml index b3843b8b5..0a81e4813 100644 --- a/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml +++ b/libraries/elasticache/lib/revokeCacheSecurityGroupIngress.ml @@ -4,9 +4,11 @@ type input = RevokeCacheSecurityGroupIngressMessage.t type output = RevokeCacheSecurityGroupIngressResult.t type error = Errors_internal.t let service = "elasticache" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://elasticache.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2015-02-02"]); ("Action", ["RevokeCacheSecurityGroupIngress"])] diff --git a/libraries/elasticache/lib/types.ml b/libraries/elasticache/lib/types.ml index 109aa7f44..736ac0829 100644 --- a/libraries/elasticache/lib/types.ml +++ b/libraries/elasticache/lib/types.ml @@ -597,6 +597,8 @@ module PendingAutomaticFailoverStatus = | Disabled let str_to_t = [("disabled", Disabled); ("enabled", Enabled)] let t_to_str = [(Disabled, "disabled"); (Enabled, "enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1113,6 +1115,8 @@ module SourceType = (Cache_security_group, "cache-security-group"); (Cache_parameter_group, "cache-parameter-group"); (Cache_cluster, "cache-cluster")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1141,6 +1145,8 @@ module AutomaticFailoverStatus = (Enabling, "enabling"); (Disabled, "disabled"); (Enabled, "enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2832,6 +2838,8 @@ module AZMode = | Cross_az let str_to_t = [("cross-az", Cross_az); ("single-az", Single_az)] let t_to_str = [(Cross_az, "cross-az"); (Single_az, "single-az")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/elasticache/lib_test/aws_elasticache_test.ml b/libraries/elasticache/lib_test/aws_elasticache_test.ml index ae94a708f..e28ec97f5 100644 --- a/libraries/elasticache/lib_test/aws_elasticache_test.ml +++ b/libraries/elasticache/lib_test/aws_elasticache_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop ELASTICACHE test succeeds" - @?false + @?true let test_cases = [ "ELASTICACHE noop" >:: noop_test ] diff --git a/libraries/elasticloadbalancing/lib/addTags.ml b/libraries/elasticloadbalancing/lib/addTags.ml index edb17615f..367f77007 100644 --- a/libraries/elasticloadbalancing/lib/addTags.ml +++ b/libraries/elasticloadbalancing/lib/addTags.ml @@ -4,10 +4,11 @@ type input = AddTagsInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["AddTags"])] (Util.drop_empty (Uri.query_of_encoded (Query.render (AddTagsInput.to_query req))))) in diff --git a/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml b/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml index 1788a12ab..6ba793c38 100644 --- a/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/applySecurityGroupsToLoadBalancer.ml @@ -4,10 +4,11 @@ type input = ApplySecurityGroupsToLoadBalancerInput.t type output = ApplySecurityGroupsToLoadBalancerOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["ApplySecurityGroupsToLoadBalancer"])] diff --git a/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml b/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml index 12c8f5a21..cf8080f8f 100644 --- a/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml +++ b/libraries/elasticloadbalancing/lib/attachLoadBalancerToSubnets.ml @@ -4,10 +4,11 @@ type input = AttachLoadBalancerToSubnetsInput.t type output = AttachLoadBalancerToSubnetsOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["AttachLoadBalancerToSubnets"])] diff --git a/libraries/elasticloadbalancing/lib/configureHealthCheck.ml b/libraries/elasticloadbalancing/lib/configureHealthCheck.ml index 0c765fedb..c40bb556a 100644 --- a/libraries/elasticloadbalancing/lib/configureHealthCheck.ml +++ b/libraries/elasticloadbalancing/lib/configureHealthCheck.ml @@ -4,10 +4,11 @@ type input = ConfigureHealthCheckInput.t type output = ConfigureHealthCheckOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["ConfigureHealthCheck"])] (Util.drop_empty diff --git a/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml b/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml index b627c71c9..dd7d1033b 100644 --- a/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml +++ b/libraries/elasticloadbalancing/lib/createAppCookieStickinessPolicy.ml @@ -4,10 +4,11 @@ type input = CreateAppCookieStickinessPolicyInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["CreateAppCookieStickinessPolicy"])] diff --git a/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml b/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml index ce2c0fae4..f54ad26b0 100644 --- a/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml +++ b/libraries/elasticloadbalancing/lib/createLBCookieStickinessPolicy.ml @@ -4,10 +4,11 @@ type input = CreateLBCookieStickinessPolicyInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["CreateLBCookieStickinessPolicy"])] diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancer.ml b/libraries/elasticloadbalancing/lib/createLoadBalancer.ml index a2f472601..b22d8c148 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/createLoadBalancer.ml @@ -4,10 +4,11 @@ type input = CreateAccessPointInput.t type output = CreateAccessPointOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["CreateLoadBalancer"])] (Util.drop_empty diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml b/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml index e36f7b85d..ad211446c 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml +++ b/libraries/elasticloadbalancing/lib/createLoadBalancerListeners.ml @@ -4,10 +4,11 @@ type input = CreateLoadBalancerListenerInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["CreateLoadBalancerListeners"])] diff --git a/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml b/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml index f74e8af5d..1cf2c5dd3 100644 --- a/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml +++ b/libraries/elasticloadbalancing/lib/createLoadBalancerPolicy.ml @@ -4,10 +4,11 @@ type input = CreateLoadBalancerPolicyInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["CreateLoadBalancerPolicy"])] diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml b/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml index 8bb28c893..b434d32a5 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancer.ml @@ -4,10 +4,11 @@ type input = DeleteAccessPointInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DeleteLoadBalancer"])] (Util.drop_empty diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml b/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml index 3bab18667..e977361f8 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancerListeners.ml @@ -4,10 +4,11 @@ type input = DeleteLoadBalancerListenerInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DeleteLoadBalancerListeners"])] diff --git a/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml b/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml index 14a65cd01..83e7f4953 100644 --- a/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml +++ b/libraries/elasticloadbalancing/lib/deleteLoadBalancerPolicy.ml @@ -4,10 +4,11 @@ type input = DeleteLoadBalancerPolicyInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DeleteLoadBalancerPolicy"])] diff --git a/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml b/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml index 0e1177d4b..88faee993 100644 --- a/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/deregisterInstancesFromLoadBalancer.ml @@ -4,10 +4,11 @@ type input = DeregisterEndPointsInput.t type output = DeregisterEndPointsOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DeregisterInstancesFromLoadBalancer"])] diff --git a/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml b/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml index 610229590..e21f86ed0 100644 --- a/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml +++ b/libraries/elasticloadbalancing/lib/describeInstanceHealth.ml @@ -4,10 +4,11 @@ type input = DescribeEndPointStateInput.t type output = DescribeEndPointStateOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DescribeInstanceHealth"])] diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml index 6618731d3..114ae24e2 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerAttributes.ml @@ -4,10 +4,11 @@ type input = DescribeLoadBalancerAttributesInput.t type output = DescribeLoadBalancerAttributesOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DescribeLoadBalancerAttributes"])] diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml index 89cfdf758..d08c13721 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicies.ml @@ -4,10 +4,11 @@ type input = DescribeLoadBalancerPoliciesInput.t type output = DescribeLoadBalancerPoliciesOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DescribeLoadBalancerPolicies"])] diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml index 5b7fd6129..347cb6f8c 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancerPolicyTypes.ml @@ -4,10 +4,11 @@ type input = DescribeLoadBalancerPolicyTypesInput.t type output = DescribeLoadBalancerPolicyTypesOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DescribeLoadBalancerPolicyTypes"])] diff --git a/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml b/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml index 78087db8e..028f4908f 100644 --- a/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml +++ b/libraries/elasticloadbalancing/lib/describeLoadBalancers.ml @@ -4,10 +4,11 @@ type input = DescribeAccessPointsInput.t type output = DescribeAccessPointsOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DescribeLoadBalancers"])] (Util.drop_empty diff --git a/libraries/elasticloadbalancing/lib/describeTags.ml b/libraries/elasticloadbalancing/lib/describeTags.ml index 6ee1accf9..aa167a733 100644 --- a/libraries/elasticloadbalancing/lib/describeTags.ml +++ b/libraries/elasticloadbalancing/lib/describeTags.ml @@ -4,10 +4,11 @@ type input = DescribeTagsInput.t type output = DescribeTagsOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DescribeTags"])] (Util.drop_empty diff --git a/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml b/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml index 10eac77b8..c4679ab6f 100644 --- a/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml +++ b/libraries/elasticloadbalancing/lib/detachLoadBalancerFromSubnets.ml @@ -4,10 +4,11 @@ type input = DetachLoadBalancerFromSubnetsInput.t type output = DetachLoadBalancerFromSubnetsOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DetachLoadBalancerFromSubnets"])] diff --git a/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml b/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml index 52e884947..c7c871286 100644 --- a/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/disableAvailabilityZonesForLoadBalancer.ml @@ -4,10 +4,11 @@ type input = RemoveAvailabilityZonesInput.t type output = RemoveAvailabilityZonesOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["DisableAvailabilityZonesForLoadBalancer"])] diff --git a/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml b/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml index 07580e911..05d80fbf5 100644 --- a/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/enableAvailabilityZonesForLoadBalancer.ml @@ -4,10 +4,11 @@ type input = AddAvailabilityZonesInput.t type output = AddAvailabilityZonesOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["EnableAvailabilityZonesForLoadBalancer"])] diff --git a/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml b/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml index 56f5cbac8..4de8c9e65 100644 --- a/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml +++ b/libraries/elasticloadbalancing/lib/modifyLoadBalancerAttributes.ml @@ -4,10 +4,11 @@ type input = ModifyLoadBalancerAttributesInput.t type output = ModifyLoadBalancerAttributesOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["ModifyLoadBalancerAttributes"])] diff --git a/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml b/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml index 0bf169ff3..629a80083 100644 --- a/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml +++ b/libraries/elasticloadbalancing/lib/registerInstancesWithLoadBalancer.ml @@ -4,10 +4,11 @@ type input = RegisterEndPointsInput.t type output = RegisterEndPointsOutput.t type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["RegisterInstancesWithLoadBalancer"])] diff --git a/libraries/elasticloadbalancing/lib/removeTags.ml b/libraries/elasticloadbalancing/lib/removeTags.ml index 5c254f8f2..c77934752 100644 --- a/libraries/elasticloadbalancing/lib/removeTags.ml +++ b/libraries/elasticloadbalancing/lib/removeTags.ml @@ -4,10 +4,11 @@ type input = RemoveTagsInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["RemoveTags"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml b/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml index 73984e880..a9e044019 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerListenerSSLCertificate.ml @@ -4,10 +4,11 @@ type input = SetLoadBalancerListenerSSLCertificateInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["SetLoadBalancerListenerSSLCertificate"])] diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml index 9958748cc..7f6eafabc 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesForBackendServer.ml @@ -4,10 +4,11 @@ type input = SetLoadBalancerPoliciesForBackendServerInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["SetLoadBalancerPoliciesForBackendServer"])] diff --git a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml index 67478c6b8..c71b7d711 100644 --- a/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml +++ b/libraries/elasticloadbalancing/lib/setLoadBalancerPoliciesOfListener.ml @@ -4,10 +4,11 @@ type input = SetLoadBalancerPoliciesOfListenerInput.t type output = unit type error = Errors_internal.t let service = "elasticloadbalancing" -let to_http req = +let to_http service region req = let uri = Uri.add_query_params - (Uri.of_string "https://elasticloadbalancing.amazonaws.com") + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2012-06-01"]); ("Action", ["SetLoadBalancerPoliciesOfListener"])] diff --git a/libraries/rds/lib/addSourceIdentifierToSubscription.ml b/libraries/rds/lib/addSourceIdentifierToSubscription.ml index 37d175068..329bc14d5 100644 --- a/libraries/rds/lib/addSourceIdentifierToSubscription.ml +++ b/libraries/rds/lib/addSourceIdentifierToSubscription.ml @@ -4,9 +4,11 @@ type input = AddSourceIdentifierToSubscriptionMessage.t type output = AddSourceIdentifierToSubscriptionResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["AddSourceIdentifierToSubscription"])] diff --git a/libraries/rds/lib/addTagsToResource.ml b/libraries/rds/lib/addTagsToResource.ml index a775a0bcb..4d19e02ee 100644 --- a/libraries/rds/lib/addTagsToResource.ml +++ b/libraries/rds/lib/addTagsToResource.ml @@ -4,9 +4,11 @@ type input = AddTagsToResourceMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["AddTagsToResource"])] (Util.drop_empty diff --git a/libraries/rds/lib/applyPendingMaintenanceAction.ml b/libraries/rds/lib/applyPendingMaintenanceAction.ml index 70f763337..712df287b 100644 --- a/libraries/rds/lib/applyPendingMaintenanceAction.ml +++ b/libraries/rds/lib/applyPendingMaintenanceAction.ml @@ -4,9 +4,11 @@ type input = ApplyPendingMaintenanceActionMessage.t type output = ApplyPendingMaintenanceActionResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ApplyPendingMaintenanceAction"])] diff --git a/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml b/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml index db2d5fa42..8b1fd3813 100644 --- a/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml +++ b/libraries/rds/lib/authorizeDBSecurityGroupIngress.ml @@ -4,9 +4,11 @@ type input = AuthorizeDBSecurityGroupIngressMessage.t type output = AuthorizeDBSecurityGroupIngressResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["AuthorizeDBSecurityGroupIngress"])] diff --git a/libraries/rds/lib/copyDBClusterSnapshot.ml b/libraries/rds/lib/copyDBClusterSnapshot.ml index d83dfc3f3..6d88ad4fe 100644 --- a/libraries/rds/lib/copyDBClusterSnapshot.ml +++ b/libraries/rds/lib/copyDBClusterSnapshot.ml @@ -4,9 +4,11 @@ type input = CopyDBClusterSnapshotMessage.t type output = CopyDBClusterSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CopyDBClusterSnapshot"])] (Util.drop_empty diff --git a/libraries/rds/lib/copyDBParameterGroup.ml b/libraries/rds/lib/copyDBParameterGroup.ml index 50313f619..e58ed44e2 100644 --- a/libraries/rds/lib/copyDBParameterGroup.ml +++ b/libraries/rds/lib/copyDBParameterGroup.ml @@ -4,9 +4,11 @@ type input = CopyDBParameterGroupMessage.t type output = CopyDBParameterGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CopyDBParameterGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/copyDBSnapshot.ml b/libraries/rds/lib/copyDBSnapshot.ml index 4fa57cde8..ea669ac69 100644 --- a/libraries/rds/lib/copyDBSnapshot.ml +++ b/libraries/rds/lib/copyDBSnapshot.ml @@ -4,9 +4,11 @@ type input = CopyDBSnapshotMessage.t type output = CopyDBSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CopyDBSnapshot"])] (Util.drop_empty diff --git a/libraries/rds/lib/copyOptionGroup.ml b/libraries/rds/lib/copyOptionGroup.ml index 76577cb94..59d4a13bd 100644 --- a/libraries/rds/lib/copyOptionGroup.ml +++ b/libraries/rds/lib/copyOptionGroup.ml @@ -4,9 +4,11 @@ type input = CopyOptionGroupMessage.t type output = CopyOptionGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CopyOptionGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/createDBCluster.ml b/libraries/rds/lib/createDBCluster.ml index 10ba17e54..d74d0a887 100644 --- a/libraries/rds/lib/createDBCluster.ml +++ b/libraries/rds/lib/createDBCluster.ml @@ -4,9 +4,11 @@ type input = CreateDBClusterMessage.t type output = CreateDBClusterResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBCluster"])] (Util.drop_empty diff --git a/libraries/rds/lib/createDBClusterParameterGroup.ml b/libraries/rds/lib/createDBClusterParameterGroup.ml index f382c3b85..02599c530 100644 --- a/libraries/rds/lib/createDBClusterParameterGroup.ml +++ b/libraries/rds/lib/createDBClusterParameterGroup.ml @@ -4,9 +4,11 @@ type input = CreateDBClusterParameterGroupMessage.t type output = CreateDBClusterParameterGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBClusterParameterGroup"])] diff --git a/libraries/rds/lib/createDBClusterSnapshot.ml b/libraries/rds/lib/createDBClusterSnapshot.ml index a510c0eb5..ae07f0195 100644 --- a/libraries/rds/lib/createDBClusterSnapshot.ml +++ b/libraries/rds/lib/createDBClusterSnapshot.ml @@ -4,9 +4,11 @@ type input = CreateDBClusterSnapshotMessage.t type output = CreateDBClusterSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBClusterSnapshot"])] diff --git a/libraries/rds/lib/createDBInstance.ml b/libraries/rds/lib/createDBInstance.ml index cd8db7f12..58f6fa5db 100644 --- a/libraries/rds/lib/createDBInstance.ml +++ b/libraries/rds/lib/createDBInstance.ml @@ -4,9 +4,11 @@ type input = CreateDBInstanceMessage.t type output = CreateDBInstanceResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBInstance"])] (Util.drop_empty diff --git a/libraries/rds/lib/createDBInstanceReadReplica.ml b/libraries/rds/lib/createDBInstanceReadReplica.ml index 99492768c..72769f43c 100644 --- a/libraries/rds/lib/createDBInstanceReadReplica.ml +++ b/libraries/rds/lib/createDBInstanceReadReplica.ml @@ -4,9 +4,11 @@ type input = CreateDBInstanceReadReplicaMessage.t type output = CreateDBInstanceReadReplicaResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBInstanceReadReplica"])] diff --git a/libraries/rds/lib/createDBParameterGroup.ml b/libraries/rds/lib/createDBParameterGroup.ml index bc1a3e40d..6edd4a923 100644 --- a/libraries/rds/lib/createDBParameterGroup.ml +++ b/libraries/rds/lib/createDBParameterGroup.ml @@ -4,9 +4,11 @@ type input = CreateDBParameterGroupMessage.t type output = CreateDBParameterGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBParameterGroup"])] diff --git a/libraries/rds/lib/createDBSecurityGroup.ml b/libraries/rds/lib/createDBSecurityGroup.ml index f34663b66..6eaa3ed2f 100644 --- a/libraries/rds/lib/createDBSecurityGroup.ml +++ b/libraries/rds/lib/createDBSecurityGroup.ml @@ -4,9 +4,11 @@ type input = CreateDBSecurityGroupMessage.t type output = CreateDBSecurityGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBSecurityGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/createDBSnapshot.ml b/libraries/rds/lib/createDBSnapshot.ml index c3fa53a31..1eb956f86 100644 --- a/libraries/rds/lib/createDBSnapshot.ml +++ b/libraries/rds/lib/createDBSnapshot.ml @@ -4,9 +4,11 @@ type input = CreateDBSnapshotMessage.t type output = CreateDBSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBSnapshot"])] (Util.drop_empty diff --git a/libraries/rds/lib/createDBSubnetGroup.ml b/libraries/rds/lib/createDBSubnetGroup.ml index 69db98d69..611e3d66e 100644 --- a/libraries/rds/lib/createDBSubnetGroup.ml +++ b/libraries/rds/lib/createDBSubnetGroup.ml @@ -4,9 +4,11 @@ type input = CreateDBSubnetGroupMessage.t type output = CreateDBSubnetGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateDBSubnetGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/createEventSubscription.ml b/libraries/rds/lib/createEventSubscription.ml index 9ee92537d..d8e65ad35 100644 --- a/libraries/rds/lib/createEventSubscription.ml +++ b/libraries/rds/lib/createEventSubscription.ml @@ -4,9 +4,11 @@ type input = CreateEventSubscriptionMessage.t type output = CreateEventSubscriptionResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateEventSubscription"])] diff --git a/libraries/rds/lib/createOptionGroup.ml b/libraries/rds/lib/createOptionGroup.ml index a691cfec9..923fe5e27 100644 --- a/libraries/rds/lib/createOptionGroup.ml +++ b/libraries/rds/lib/createOptionGroup.ml @@ -4,9 +4,11 @@ type input = CreateOptionGroupMessage.t type output = CreateOptionGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["CreateOptionGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/deleteDBCluster.ml b/libraries/rds/lib/deleteDBCluster.ml index b1bd1fc82..514fc6df1 100644 --- a/libraries/rds/lib/deleteDBCluster.ml +++ b/libraries/rds/lib/deleteDBCluster.ml @@ -4,9 +4,11 @@ type input = DeleteDBClusterMessage.t type output = DeleteDBClusterResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBCluster"])] (Util.drop_empty diff --git a/libraries/rds/lib/deleteDBClusterParameterGroup.ml b/libraries/rds/lib/deleteDBClusterParameterGroup.ml index d182811f8..9bbbc240d 100644 --- a/libraries/rds/lib/deleteDBClusterParameterGroup.ml +++ b/libraries/rds/lib/deleteDBClusterParameterGroup.ml @@ -4,9 +4,11 @@ type input = DeleteDBClusterParameterGroupMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBClusterParameterGroup"])] diff --git a/libraries/rds/lib/deleteDBClusterSnapshot.ml b/libraries/rds/lib/deleteDBClusterSnapshot.ml index 6d94e76e9..257b3762f 100644 --- a/libraries/rds/lib/deleteDBClusterSnapshot.ml +++ b/libraries/rds/lib/deleteDBClusterSnapshot.ml @@ -4,9 +4,11 @@ type input = DeleteDBClusterSnapshotMessage.t type output = DeleteDBClusterSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBClusterSnapshot"])] diff --git a/libraries/rds/lib/deleteDBInstance.ml b/libraries/rds/lib/deleteDBInstance.ml index dfffc3ce2..79b257855 100644 --- a/libraries/rds/lib/deleteDBInstance.ml +++ b/libraries/rds/lib/deleteDBInstance.ml @@ -4,9 +4,11 @@ type input = DeleteDBInstanceMessage.t type output = DeleteDBInstanceResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBInstance"])] (Util.drop_empty diff --git a/libraries/rds/lib/deleteDBParameterGroup.ml b/libraries/rds/lib/deleteDBParameterGroup.ml index a369f105d..e821d02e2 100644 --- a/libraries/rds/lib/deleteDBParameterGroup.ml +++ b/libraries/rds/lib/deleteDBParameterGroup.ml @@ -4,9 +4,11 @@ type input = DeleteDBParameterGroupMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBParameterGroup"])] diff --git a/libraries/rds/lib/deleteDBSecurityGroup.ml b/libraries/rds/lib/deleteDBSecurityGroup.ml index c0557d671..4e089892c 100644 --- a/libraries/rds/lib/deleteDBSecurityGroup.ml +++ b/libraries/rds/lib/deleteDBSecurityGroup.ml @@ -4,9 +4,11 @@ type input = DeleteDBSecurityGroupMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBSecurityGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/deleteDBSnapshot.ml b/libraries/rds/lib/deleteDBSnapshot.ml index 543d844ec..aff27e688 100644 --- a/libraries/rds/lib/deleteDBSnapshot.ml +++ b/libraries/rds/lib/deleteDBSnapshot.ml @@ -4,9 +4,11 @@ type input = DeleteDBSnapshotMessage.t type output = DeleteDBSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBSnapshot"])] (Util.drop_empty diff --git a/libraries/rds/lib/deleteDBSubnetGroup.ml b/libraries/rds/lib/deleteDBSubnetGroup.ml index 23bad2984..9fbd56146 100644 --- a/libraries/rds/lib/deleteDBSubnetGroup.ml +++ b/libraries/rds/lib/deleteDBSubnetGroup.ml @@ -4,9 +4,11 @@ type input = DeleteDBSubnetGroupMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteDBSubnetGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/deleteEventSubscription.ml b/libraries/rds/lib/deleteEventSubscription.ml index 85dfe50a0..4c7c63311 100644 --- a/libraries/rds/lib/deleteEventSubscription.ml +++ b/libraries/rds/lib/deleteEventSubscription.ml @@ -4,9 +4,11 @@ type input = DeleteEventSubscriptionMessage.t type output = DeleteEventSubscriptionResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteEventSubscription"])] diff --git a/libraries/rds/lib/deleteOptionGroup.ml b/libraries/rds/lib/deleteOptionGroup.ml index 9168314bc..639862102 100644 --- a/libraries/rds/lib/deleteOptionGroup.ml +++ b/libraries/rds/lib/deleteOptionGroup.ml @@ -4,9 +4,11 @@ type input = DeleteOptionGroupMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DeleteOptionGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeAccountAttributes.ml b/libraries/rds/lib/describeAccountAttributes.ml index a0b4f4210..ced87ce0d 100644 --- a/libraries/rds/lib/describeAccountAttributes.ml +++ b/libraries/rds/lib/describeAccountAttributes.ml @@ -4,9 +4,11 @@ type input = unit type output = AccountAttributesMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) [("Version", ["2014-10-31"]); ("Action", ["DescribeAccountAttributes"])] in (`POST, uri, []) diff --git a/libraries/rds/lib/describeCertificates.ml b/libraries/rds/lib/describeCertificates.ml index 12bab3b5c..985be5ee7 100644 --- a/libraries/rds/lib/describeCertificates.ml +++ b/libraries/rds/lib/describeCertificates.ml @@ -4,9 +4,11 @@ type input = DescribeCertificatesMessage.t type output = CertificateMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeCertificates"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeDBClusterParameterGroups.ml b/libraries/rds/lib/describeDBClusterParameterGroups.ml index 6175cc283..82b23a29a 100644 --- a/libraries/rds/lib/describeDBClusterParameterGroups.ml +++ b/libraries/rds/lib/describeDBClusterParameterGroups.ml @@ -4,9 +4,11 @@ type input = DescribeDBClusterParameterGroupsMessage.t type output = DBClusterParameterGroupsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBClusterParameterGroups"])] diff --git a/libraries/rds/lib/describeDBClusterParameters.ml b/libraries/rds/lib/describeDBClusterParameters.ml index 8dd94f32d..185270984 100644 --- a/libraries/rds/lib/describeDBClusterParameters.ml +++ b/libraries/rds/lib/describeDBClusterParameters.ml @@ -4,9 +4,11 @@ type input = DescribeDBClusterParametersMessage.t type output = DBClusterParameterGroupDetails.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBClusterParameters"])] diff --git a/libraries/rds/lib/describeDBClusterSnapshots.ml b/libraries/rds/lib/describeDBClusterSnapshots.ml index 237126298..5403bc008 100644 --- a/libraries/rds/lib/describeDBClusterSnapshots.ml +++ b/libraries/rds/lib/describeDBClusterSnapshots.ml @@ -4,9 +4,11 @@ type input = DescribeDBClusterSnapshotsMessage.t type output = DBClusterSnapshotMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBClusterSnapshots"])] diff --git a/libraries/rds/lib/describeDBClusters.ml b/libraries/rds/lib/describeDBClusters.ml index 7ada52540..c2e417ee1 100644 --- a/libraries/rds/lib/describeDBClusters.ml +++ b/libraries/rds/lib/describeDBClusters.ml @@ -4,9 +4,11 @@ type input = DescribeDBClustersMessage.t type output = DBClusterMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBClusters"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeDBEngineVersions.ml b/libraries/rds/lib/describeDBEngineVersions.ml index ee242d6f8..49084a65e 100644 --- a/libraries/rds/lib/describeDBEngineVersions.ml +++ b/libraries/rds/lib/describeDBEngineVersions.ml @@ -4,9 +4,11 @@ type input = DescribeDBEngineVersionsMessage.t type output = DBEngineVersionMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBEngineVersions"])] diff --git a/libraries/rds/lib/describeDBInstances.ml b/libraries/rds/lib/describeDBInstances.ml index 795a9bbc7..ec43dc353 100644 --- a/libraries/rds/lib/describeDBInstances.ml +++ b/libraries/rds/lib/describeDBInstances.ml @@ -4,9 +4,11 @@ type input = DescribeDBInstancesMessage.t type output = DBInstanceMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBInstances"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeDBLogFiles.ml b/libraries/rds/lib/describeDBLogFiles.ml index 4d5c12e36..d5bf105d5 100644 --- a/libraries/rds/lib/describeDBLogFiles.ml +++ b/libraries/rds/lib/describeDBLogFiles.ml @@ -4,9 +4,11 @@ type input = DescribeDBLogFilesMessage.t type output = DescribeDBLogFilesResponse.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBLogFiles"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeDBParameterGroups.ml b/libraries/rds/lib/describeDBParameterGroups.ml index 4e9b2e18b..e62fc0034 100644 --- a/libraries/rds/lib/describeDBParameterGroups.ml +++ b/libraries/rds/lib/describeDBParameterGroups.ml @@ -4,9 +4,11 @@ type input = DescribeDBParameterGroupsMessage.t type output = DBParameterGroupsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBParameterGroups"])] diff --git a/libraries/rds/lib/describeDBParameters.ml b/libraries/rds/lib/describeDBParameters.ml index a3b2676d0..87228afb8 100644 --- a/libraries/rds/lib/describeDBParameters.ml +++ b/libraries/rds/lib/describeDBParameters.ml @@ -4,9 +4,11 @@ type input = DescribeDBParametersMessage.t type output = DBParameterGroupDetails.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBParameters"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeDBSecurityGroups.ml b/libraries/rds/lib/describeDBSecurityGroups.ml index df17edcb9..d33524e1d 100644 --- a/libraries/rds/lib/describeDBSecurityGroups.ml +++ b/libraries/rds/lib/describeDBSecurityGroups.ml @@ -4,9 +4,11 @@ type input = DescribeDBSecurityGroupsMessage.t type output = DBSecurityGroupMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBSecurityGroups"])] diff --git a/libraries/rds/lib/describeDBSnapshots.ml b/libraries/rds/lib/describeDBSnapshots.ml index 7b94e4933..d4fcb8067 100644 --- a/libraries/rds/lib/describeDBSnapshots.ml +++ b/libraries/rds/lib/describeDBSnapshots.ml @@ -4,9 +4,11 @@ type input = DescribeDBSnapshotsMessage.t type output = DBSnapshotMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBSnapshots"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeDBSubnetGroups.ml b/libraries/rds/lib/describeDBSubnetGroups.ml index 09629f361..c672fa557 100644 --- a/libraries/rds/lib/describeDBSubnetGroups.ml +++ b/libraries/rds/lib/describeDBSubnetGroups.ml @@ -4,9 +4,11 @@ type input = DescribeDBSubnetGroupsMessage.t type output = DBSubnetGroupMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeDBSubnetGroups"])] diff --git a/libraries/rds/lib/describeEngineDefaultClusterParameters.ml b/libraries/rds/lib/describeEngineDefaultClusterParameters.ml index 22f34a617..6dba9fd75 100644 --- a/libraries/rds/lib/describeEngineDefaultClusterParameters.ml +++ b/libraries/rds/lib/describeEngineDefaultClusterParameters.ml @@ -4,9 +4,11 @@ type input = DescribeEngineDefaultClusterParametersMessage.t type output = DescribeEngineDefaultClusterParametersResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeEngineDefaultClusterParameters"])] diff --git a/libraries/rds/lib/describeEngineDefaultParameters.ml b/libraries/rds/lib/describeEngineDefaultParameters.ml index 75d8b4857..e2b0375bb 100644 --- a/libraries/rds/lib/describeEngineDefaultParameters.ml +++ b/libraries/rds/lib/describeEngineDefaultParameters.ml @@ -4,9 +4,11 @@ type input = DescribeEngineDefaultParametersMessage.t type output = DescribeEngineDefaultParametersResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeEngineDefaultParameters"])] diff --git a/libraries/rds/lib/describeEventCategories.ml b/libraries/rds/lib/describeEventCategories.ml index 14e0f014e..2c64b835b 100644 --- a/libraries/rds/lib/describeEventCategories.ml +++ b/libraries/rds/lib/describeEventCategories.ml @@ -4,9 +4,11 @@ type input = DescribeEventCategoriesMessage.t type output = EventCategoriesMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeEventCategories"])] diff --git a/libraries/rds/lib/describeEventSubscriptions.ml b/libraries/rds/lib/describeEventSubscriptions.ml index 12ad251d8..79d76273a 100644 --- a/libraries/rds/lib/describeEventSubscriptions.ml +++ b/libraries/rds/lib/describeEventSubscriptions.ml @@ -4,9 +4,11 @@ type input = DescribeEventSubscriptionsMessage.t type output = EventSubscriptionsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeEventSubscriptions"])] diff --git a/libraries/rds/lib/describeEvents.ml b/libraries/rds/lib/describeEvents.ml index 5ad59edb5..e6d72b7d2 100644 --- a/libraries/rds/lib/describeEvents.ml +++ b/libraries/rds/lib/describeEvents.ml @@ -4,9 +4,11 @@ type input = DescribeEventsMessage.t type output = EventsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeEvents"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeOptionGroupOptions.ml b/libraries/rds/lib/describeOptionGroupOptions.ml index a51683f5f..b5d0ea9e6 100644 --- a/libraries/rds/lib/describeOptionGroupOptions.ml +++ b/libraries/rds/lib/describeOptionGroupOptions.ml @@ -4,9 +4,11 @@ type input = DescribeOptionGroupOptionsMessage.t type output = OptionGroupOptionsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeOptionGroupOptions"])] diff --git a/libraries/rds/lib/describeOptionGroups.ml b/libraries/rds/lib/describeOptionGroups.ml index c05cd80b4..16ca6eb5f 100644 --- a/libraries/rds/lib/describeOptionGroups.ml +++ b/libraries/rds/lib/describeOptionGroups.ml @@ -4,9 +4,11 @@ type input = DescribeOptionGroupsMessage.t type output = OptionGroups.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeOptionGroups"])] (Util.drop_empty diff --git a/libraries/rds/lib/describeOrderableDBInstanceOptions.ml b/libraries/rds/lib/describeOrderableDBInstanceOptions.ml index 5b1516279..773fcd26b 100644 --- a/libraries/rds/lib/describeOrderableDBInstanceOptions.ml +++ b/libraries/rds/lib/describeOrderableDBInstanceOptions.ml @@ -4,9 +4,11 @@ type input = DescribeOrderableDBInstanceOptionsMessage.t type output = OrderableDBInstanceOptionsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeOrderableDBInstanceOptions"])] diff --git a/libraries/rds/lib/describePendingMaintenanceActions.ml b/libraries/rds/lib/describePendingMaintenanceActions.ml index fb3a68e95..de733038d 100644 --- a/libraries/rds/lib/describePendingMaintenanceActions.ml +++ b/libraries/rds/lib/describePendingMaintenanceActions.ml @@ -4,9 +4,11 @@ type input = DescribePendingMaintenanceActionsMessage.t type output = PendingMaintenanceActionsMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribePendingMaintenanceActions"])] diff --git a/libraries/rds/lib/describeReservedDBInstances.ml b/libraries/rds/lib/describeReservedDBInstances.ml index 998a0b59d..98b8fd438 100644 --- a/libraries/rds/lib/describeReservedDBInstances.ml +++ b/libraries/rds/lib/describeReservedDBInstances.ml @@ -4,9 +4,11 @@ type input = DescribeReservedDBInstancesMessage.t type output = ReservedDBInstanceMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeReservedDBInstances"])] diff --git a/libraries/rds/lib/describeReservedDBInstancesOfferings.ml b/libraries/rds/lib/describeReservedDBInstancesOfferings.ml index f38436991..b358ad670 100644 --- a/libraries/rds/lib/describeReservedDBInstancesOfferings.ml +++ b/libraries/rds/lib/describeReservedDBInstancesOfferings.ml @@ -4,9 +4,11 @@ type input = DescribeReservedDBInstancesOfferingsMessage.t type output = ReservedDBInstancesOfferingMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DescribeReservedDBInstancesOfferings"])] diff --git a/libraries/rds/lib/downloadDBLogFilePortion.ml b/libraries/rds/lib/downloadDBLogFilePortion.ml index 67e953107..2abd127ae 100644 --- a/libraries/rds/lib/downloadDBLogFilePortion.ml +++ b/libraries/rds/lib/downloadDBLogFilePortion.ml @@ -4,9 +4,11 @@ type input = DownloadDBLogFilePortionMessage.t type output = DownloadDBLogFilePortionDetails.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["DownloadDBLogFilePortion"])] diff --git a/libraries/rds/lib/failoverDBCluster.ml b/libraries/rds/lib/failoverDBCluster.ml index 2dc416760..710df549c 100644 --- a/libraries/rds/lib/failoverDBCluster.ml +++ b/libraries/rds/lib/failoverDBCluster.ml @@ -4,9 +4,11 @@ type input = FailoverDBClusterMessage.t type output = FailoverDBClusterResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["FailoverDBCluster"])] (Util.drop_empty diff --git a/libraries/rds/lib/listTagsForResource.ml b/libraries/rds/lib/listTagsForResource.ml index 9899bffea..05bdec820 100644 --- a/libraries/rds/lib/listTagsForResource.ml +++ b/libraries/rds/lib/listTagsForResource.ml @@ -4,9 +4,11 @@ type input = ListTagsForResourceMessage.t type output = TagListMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ListTagsForResource"])] (Util.drop_empty diff --git a/libraries/rds/lib/modifyDBCluster.ml b/libraries/rds/lib/modifyDBCluster.ml index e5b24a0db..17c792032 100644 --- a/libraries/rds/lib/modifyDBCluster.ml +++ b/libraries/rds/lib/modifyDBCluster.ml @@ -4,9 +4,11 @@ type input = ModifyDBClusterMessage.t type output = ModifyDBClusterResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyDBCluster"])] (Util.drop_empty diff --git a/libraries/rds/lib/modifyDBClusterParameterGroup.ml b/libraries/rds/lib/modifyDBClusterParameterGroup.ml index 2b0f52c33..ff7d6dc93 100644 --- a/libraries/rds/lib/modifyDBClusterParameterGroup.ml +++ b/libraries/rds/lib/modifyDBClusterParameterGroup.ml @@ -4,9 +4,11 @@ type input = ModifyDBClusterParameterGroupMessage.t type output = DBClusterParameterGroupNameMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyDBClusterParameterGroup"])] diff --git a/libraries/rds/lib/modifyDBInstance.ml b/libraries/rds/lib/modifyDBInstance.ml index db87d2602..39c3515a7 100644 --- a/libraries/rds/lib/modifyDBInstance.ml +++ b/libraries/rds/lib/modifyDBInstance.ml @@ -4,9 +4,11 @@ type input = ModifyDBInstanceMessage.t type output = ModifyDBInstanceResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyDBInstance"])] (Util.drop_empty diff --git a/libraries/rds/lib/modifyDBParameterGroup.ml b/libraries/rds/lib/modifyDBParameterGroup.ml index 7ceec7bc0..0ae7c63f7 100644 --- a/libraries/rds/lib/modifyDBParameterGroup.ml +++ b/libraries/rds/lib/modifyDBParameterGroup.ml @@ -4,9 +4,11 @@ type input = ModifyDBParameterGroupMessage.t type output = DBParameterGroupNameMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyDBParameterGroup"])] diff --git a/libraries/rds/lib/modifyDBSubnetGroup.ml b/libraries/rds/lib/modifyDBSubnetGroup.ml index dba0f2d47..4f3bfcbc8 100644 --- a/libraries/rds/lib/modifyDBSubnetGroup.ml +++ b/libraries/rds/lib/modifyDBSubnetGroup.ml @@ -4,9 +4,11 @@ type input = ModifyDBSubnetGroupMessage.t type output = ModifyDBSubnetGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyDBSubnetGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/modifyEventSubscription.ml b/libraries/rds/lib/modifyEventSubscription.ml index af48539cb..1af081f14 100644 --- a/libraries/rds/lib/modifyEventSubscription.ml +++ b/libraries/rds/lib/modifyEventSubscription.ml @@ -4,9 +4,11 @@ type input = ModifyEventSubscriptionMessage.t type output = ModifyEventSubscriptionResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyEventSubscription"])] diff --git a/libraries/rds/lib/modifyOptionGroup.ml b/libraries/rds/lib/modifyOptionGroup.ml index 915b3104e..81e59f953 100644 --- a/libraries/rds/lib/modifyOptionGroup.ml +++ b/libraries/rds/lib/modifyOptionGroup.ml @@ -4,9 +4,11 @@ type input = ModifyOptionGroupMessage.t type output = ModifyOptionGroupResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ModifyOptionGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/promoteReadReplica.ml b/libraries/rds/lib/promoteReadReplica.ml index 1ec3eabed..4cc4adb82 100644 --- a/libraries/rds/lib/promoteReadReplica.ml +++ b/libraries/rds/lib/promoteReadReplica.ml @@ -4,9 +4,11 @@ type input = PromoteReadReplicaMessage.t type output = PromoteReadReplicaResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["PromoteReadReplica"])] (Util.drop_empty diff --git a/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml b/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml index 41428b1fc..1012c5bbf 100644 --- a/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml +++ b/libraries/rds/lib/purchaseReservedDBInstancesOffering.ml @@ -4,9 +4,11 @@ type input = PurchaseReservedDBInstancesOfferingMessage.t type output = PurchaseReservedDBInstancesOfferingResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["PurchaseReservedDBInstancesOffering"])] diff --git a/libraries/rds/lib/rebootDBInstance.ml b/libraries/rds/lib/rebootDBInstance.ml index 94b2fb6ba..3233f564a 100644 --- a/libraries/rds/lib/rebootDBInstance.ml +++ b/libraries/rds/lib/rebootDBInstance.ml @@ -4,9 +4,11 @@ type input = RebootDBInstanceMessage.t type output = RebootDBInstanceResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RebootDBInstance"])] (Util.drop_empty diff --git a/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml b/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml index abd2ac5e6..4e9f4aabf 100644 --- a/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml +++ b/libraries/rds/lib/removeSourceIdentifierFromSubscription.ml @@ -4,9 +4,11 @@ type input = RemoveSourceIdentifierFromSubscriptionMessage.t type output = RemoveSourceIdentifierFromSubscriptionResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RemoveSourceIdentifierFromSubscription"])] diff --git a/libraries/rds/lib/removeTagsFromResource.ml b/libraries/rds/lib/removeTagsFromResource.ml index 831b1d5d9..857cc132b 100644 --- a/libraries/rds/lib/removeTagsFromResource.ml +++ b/libraries/rds/lib/removeTagsFromResource.ml @@ -4,9 +4,11 @@ type input = RemoveTagsFromResourceMessage.t type output = unit type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RemoveTagsFromResource"])] diff --git a/libraries/rds/lib/resetDBClusterParameterGroup.ml b/libraries/rds/lib/resetDBClusterParameterGroup.ml index 67f8027f9..cc7856c32 100644 --- a/libraries/rds/lib/resetDBClusterParameterGroup.ml +++ b/libraries/rds/lib/resetDBClusterParameterGroup.ml @@ -4,9 +4,11 @@ type input = ResetDBClusterParameterGroupMessage.t type output = DBClusterParameterGroupNameMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ResetDBClusterParameterGroup"])] diff --git a/libraries/rds/lib/resetDBParameterGroup.ml b/libraries/rds/lib/resetDBParameterGroup.ml index cd8d6c5f2..6d20240e5 100644 --- a/libraries/rds/lib/resetDBParameterGroup.ml +++ b/libraries/rds/lib/resetDBParameterGroup.ml @@ -4,9 +4,11 @@ type input = ResetDBParameterGroupMessage.t type output = DBParameterGroupNameMessage.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["ResetDBParameterGroup"])] (Util.drop_empty diff --git a/libraries/rds/lib/restoreDBClusterFromSnapshot.ml b/libraries/rds/lib/restoreDBClusterFromSnapshot.ml index a740fd8fd..03043708f 100644 --- a/libraries/rds/lib/restoreDBClusterFromSnapshot.ml +++ b/libraries/rds/lib/restoreDBClusterFromSnapshot.ml @@ -4,9 +4,11 @@ type input = RestoreDBClusterFromSnapshotMessage.t type output = RestoreDBClusterFromSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RestoreDBClusterFromSnapshot"])] diff --git a/libraries/rds/lib/restoreDBClusterToPointInTime.ml b/libraries/rds/lib/restoreDBClusterToPointInTime.ml index 0b96f1dd9..aa9e6d008 100644 --- a/libraries/rds/lib/restoreDBClusterToPointInTime.ml +++ b/libraries/rds/lib/restoreDBClusterToPointInTime.ml @@ -4,9 +4,11 @@ type input = RestoreDBClusterToPointInTimeMessage.t type output = RestoreDBClusterToPointInTimeResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RestoreDBClusterToPointInTime"])] diff --git a/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml b/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml index 921bd19e6..912e6924e 100644 --- a/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml +++ b/libraries/rds/lib/restoreDBInstanceFromDBSnapshot.ml @@ -4,9 +4,11 @@ type input = RestoreDBInstanceFromDBSnapshotMessage.t type output = RestoreDBInstanceFromDBSnapshotResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RestoreDBInstanceFromDBSnapshot"])] diff --git a/libraries/rds/lib/restoreDBInstanceToPointInTime.ml b/libraries/rds/lib/restoreDBInstanceToPointInTime.ml index 1a5d3d665..82b1996b3 100644 --- a/libraries/rds/lib/restoreDBInstanceToPointInTime.ml +++ b/libraries/rds/lib/restoreDBInstanceToPointInTime.ml @@ -4,9 +4,11 @@ type input = RestoreDBInstanceToPointInTimeMessage.t type output = RestoreDBInstanceToPointInTimeResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RestoreDBInstanceToPointInTime"])] diff --git a/libraries/rds/lib/revokeDBSecurityGroupIngress.ml b/libraries/rds/lib/revokeDBSecurityGroupIngress.ml index 2dbba8142..b7cae4f6b 100644 --- a/libraries/rds/lib/revokeDBSecurityGroupIngress.ml +++ b/libraries/rds/lib/revokeDBSecurityGroupIngress.ml @@ -4,9 +4,11 @@ type input = RevokeDBSecurityGroupIngressMessage.t type output = RevokeDBSecurityGroupIngressResult.t type error = Errors_internal.t let service = "rds" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://rds.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-10-31"]); ("Action", ["RevokeDBSecurityGroupIngress"])] diff --git a/libraries/rds/lib/types.ml b/libraries/rds/lib/types.ml index 4be10d1c9..828386f5c 100644 --- a/libraries/rds/lib/types.ml +++ b/libraries/rds/lib/types.ml @@ -386,6 +386,8 @@ module ApplyMethod = [("pending-reboot", Pending_reboot); ("immediate", Immediate)] let t_to_str = [(Pending_reboot, "pending-reboot"); (Immediate, "immediate")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1649,6 +1651,8 @@ module SourceType = (Db_security_group, "db-security-group"); (Db_parameter_group, "db-parameter-group"); (Db_instance, "db-instance")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/rds/lib_test/aws_rds_test.ml b/libraries/rds/lib_test/aws_rds_test.ml index 6c9a869c9..cb114f1c4 100644 --- a/libraries/rds/lib_test/aws_rds_test.ml +++ b/libraries/rds/lib_test/aws_rds_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop RDS test succeeds" - @?false + @?true let test_cases = [ "RDS noop" >:: noop_test ] diff --git a/libraries/route53/lib/associateVPCWithHostedZone.ml b/libraries/route53/lib/associateVPCWithHostedZone.ml index 3e9a8157c..913174920 100644 --- a/libraries/route53/lib/associateVPCWithHostedZone.ml +++ b/libraries/route53/lib/associateVPCWithHostedZone.ml @@ -4,9 +4,11 @@ type input = AssociateVPCWithHostedZoneRequest.t type output = AssociateVPCWithHostedZoneResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["AssociateVPCWithHostedZone"])] diff --git a/libraries/route53/lib/changeResourceRecordSets.ml b/libraries/route53/lib/changeResourceRecordSets.ml index eaae97890..870fec619 100644 --- a/libraries/route53/lib/changeResourceRecordSets.ml +++ b/libraries/route53/lib/changeResourceRecordSets.ml @@ -4,9 +4,11 @@ type input = ChangeResourceRecordSetsRequest.t type output = ChangeResourceRecordSetsResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ChangeResourceRecordSets"])] diff --git a/libraries/route53/lib/changeTagsForResource.ml b/libraries/route53/lib/changeTagsForResource.ml index 121a6dc03..f3b60a351 100644 --- a/libraries/route53/lib/changeTagsForResource.ml +++ b/libraries/route53/lib/changeTagsForResource.ml @@ -4,9 +4,11 @@ type input = ChangeTagsForResourceRequest.t type output = unit type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ChangeTagsForResource"])] (Util.drop_empty diff --git a/libraries/route53/lib/createHealthCheck.ml b/libraries/route53/lib/createHealthCheck.ml index 97ef5b94e..74e14e952 100644 --- a/libraries/route53/lib/createHealthCheck.ml +++ b/libraries/route53/lib/createHealthCheck.ml @@ -4,9 +4,11 @@ type input = CreateHealthCheckRequest.t type output = CreateHealthCheckResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["CreateHealthCheck"])] (Util.drop_empty diff --git a/libraries/route53/lib/createHostedZone.ml b/libraries/route53/lib/createHostedZone.ml index 2800e0813..bcfb866f6 100644 --- a/libraries/route53/lib/createHostedZone.ml +++ b/libraries/route53/lib/createHostedZone.ml @@ -4,9 +4,11 @@ type input = CreateHostedZoneRequest.t type output = CreateHostedZoneResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["CreateHostedZone"])] (Util.drop_empty diff --git a/libraries/route53/lib/createReusableDelegationSet.ml b/libraries/route53/lib/createReusableDelegationSet.ml index 3bb455f4f..c602fd9e6 100644 --- a/libraries/route53/lib/createReusableDelegationSet.ml +++ b/libraries/route53/lib/createReusableDelegationSet.ml @@ -4,9 +4,11 @@ type input = CreateReusableDelegationSetRequest.t type output = CreateReusableDelegationSetResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["CreateReusableDelegationSet"])] diff --git a/libraries/route53/lib/deleteHealthCheck.ml b/libraries/route53/lib/deleteHealthCheck.ml index 5fff72e77..f6abd5f30 100644 --- a/libraries/route53/lib/deleteHealthCheck.ml +++ b/libraries/route53/lib/deleteHealthCheck.ml @@ -4,9 +4,11 @@ type input = DeleteHealthCheckRequest.t type output = unit type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["DeleteHealthCheck"])] (Util.drop_empty diff --git a/libraries/route53/lib/deleteHostedZone.ml b/libraries/route53/lib/deleteHostedZone.ml index bd400dc5b..ac4880c9c 100644 --- a/libraries/route53/lib/deleteHostedZone.ml +++ b/libraries/route53/lib/deleteHostedZone.ml @@ -4,9 +4,11 @@ type input = DeleteHostedZoneRequest.t type output = DeleteHostedZoneResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["DeleteHostedZone"])] (Util.drop_empty diff --git a/libraries/route53/lib/deleteReusableDelegationSet.ml b/libraries/route53/lib/deleteReusableDelegationSet.ml index 9500d401c..b8b2f215f 100644 --- a/libraries/route53/lib/deleteReusableDelegationSet.ml +++ b/libraries/route53/lib/deleteReusableDelegationSet.ml @@ -4,9 +4,11 @@ type input = DeleteReusableDelegationSetRequest.t type output = unit type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["DeleteReusableDelegationSet"])] diff --git a/libraries/route53/lib/disassociateVPCFromHostedZone.ml b/libraries/route53/lib/disassociateVPCFromHostedZone.ml index 802e2c66a..83718682c 100644 --- a/libraries/route53/lib/disassociateVPCFromHostedZone.ml +++ b/libraries/route53/lib/disassociateVPCFromHostedZone.ml @@ -4,9 +4,11 @@ type input = DisassociateVPCFromHostedZoneRequest.t type output = DisassociateVPCFromHostedZoneResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["DisassociateVPCFromHostedZone"])] diff --git a/libraries/route53/lib/getChange.ml b/libraries/route53/lib/getChange.ml index 80d70ceb7..9e8eae0ea 100644 --- a/libraries/route53/lib/getChange.ml +++ b/libraries/route53/lib/getChange.ml @@ -4,9 +4,11 @@ type input = GetChangeRequest.t type output = GetChangeResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetChange"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/route53/lib/getCheckerIpRanges.ml b/libraries/route53/lib/getCheckerIpRanges.ml index 5b965472a..fc93af22c 100644 --- a/libraries/route53/lib/getCheckerIpRanges.ml +++ b/libraries/route53/lib/getCheckerIpRanges.ml @@ -4,9 +4,11 @@ type input = unit type output = GetCheckerIpRangesResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) [("Version", ["2013-04-01"]); ("Action", ["GetCheckerIpRanges"])] in (`GET, uri, []) let of_http body = diff --git a/libraries/route53/lib/getGeoLocation.ml b/libraries/route53/lib/getGeoLocation.ml index b6385b91b..78005a1c7 100644 --- a/libraries/route53/lib/getGeoLocation.ml +++ b/libraries/route53/lib/getGeoLocation.ml @@ -4,9 +4,11 @@ type input = GetGeoLocationRequest.t type output = GetGeoLocationResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetGeoLocation"])] (Util.drop_empty diff --git a/libraries/route53/lib/getHealthCheck.ml b/libraries/route53/lib/getHealthCheck.ml index 07ba359a8..08590e971 100644 --- a/libraries/route53/lib/getHealthCheck.ml +++ b/libraries/route53/lib/getHealthCheck.ml @@ -4,9 +4,11 @@ type input = GetHealthCheckRequest.t type output = GetHealthCheckResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheck"])] (Util.drop_empty diff --git a/libraries/route53/lib/getHealthCheckCount.ml b/libraries/route53/lib/getHealthCheckCount.ml index e31ce0438..da5e366a3 100644 --- a/libraries/route53/lib/getHealthCheckCount.ml +++ b/libraries/route53/lib/getHealthCheckCount.ml @@ -4,9 +4,11 @@ type input = unit type output = GetHealthCheckCountResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheckCount"])] in (`GET, uri, []) let of_http body = diff --git a/libraries/route53/lib/getHealthCheckLastFailureReason.ml b/libraries/route53/lib/getHealthCheckLastFailureReason.ml index 33652107f..7d4a646f9 100644 --- a/libraries/route53/lib/getHealthCheckLastFailureReason.ml +++ b/libraries/route53/lib/getHealthCheckLastFailureReason.ml @@ -4,9 +4,11 @@ type input = GetHealthCheckLastFailureReasonRequest.t type output = GetHealthCheckLastFailureReasonResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheckLastFailureReason"])] diff --git a/libraries/route53/lib/getHealthCheckStatus.ml b/libraries/route53/lib/getHealthCheckStatus.ml index 83cc83193..e8070e778 100644 --- a/libraries/route53/lib/getHealthCheckStatus.ml +++ b/libraries/route53/lib/getHealthCheckStatus.ml @@ -4,9 +4,11 @@ type input = GetHealthCheckStatusRequest.t type output = GetHealthCheckStatusResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetHealthCheckStatus"])] (Util.drop_empty diff --git a/libraries/route53/lib/getHostedZone.ml b/libraries/route53/lib/getHostedZone.ml index 6a0887d26..bce3336ff 100644 --- a/libraries/route53/lib/getHostedZone.ml +++ b/libraries/route53/lib/getHostedZone.ml @@ -4,9 +4,11 @@ type input = GetHostedZoneRequest.t type output = GetHostedZoneResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetHostedZone"])] (Util.drop_empty diff --git a/libraries/route53/lib/getHostedZoneCount.ml b/libraries/route53/lib/getHostedZoneCount.ml index 06a7b9dd0..4bed171e5 100644 --- a/libraries/route53/lib/getHostedZoneCount.ml +++ b/libraries/route53/lib/getHostedZoneCount.ml @@ -4,9 +4,11 @@ type input = unit type output = GetHostedZoneCountResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) [("Version", ["2013-04-01"]); ("Action", ["GetHostedZoneCount"])] in (`GET, uri, []) let of_http body = diff --git a/libraries/route53/lib/getReusableDelegationSet.ml b/libraries/route53/lib/getReusableDelegationSet.ml index 4f1a6ef72..769a91178 100644 --- a/libraries/route53/lib/getReusableDelegationSet.ml +++ b/libraries/route53/lib/getReusableDelegationSet.ml @@ -4,9 +4,11 @@ type input = GetReusableDelegationSetRequest.t type output = GetReusableDelegationSetResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["GetReusableDelegationSet"])] diff --git a/libraries/route53/lib/listGeoLocations.ml b/libraries/route53/lib/listGeoLocations.ml index bcd6b49ed..6e1721c91 100644 --- a/libraries/route53/lib/listGeoLocations.ml +++ b/libraries/route53/lib/listGeoLocations.ml @@ -4,9 +4,11 @@ type input = ListGeoLocationsRequest.t type output = ListGeoLocationsResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListGeoLocations"])] (Util.drop_empty diff --git a/libraries/route53/lib/listHealthChecks.ml b/libraries/route53/lib/listHealthChecks.ml index 4efecaa91..70e058176 100644 --- a/libraries/route53/lib/listHealthChecks.ml +++ b/libraries/route53/lib/listHealthChecks.ml @@ -4,9 +4,11 @@ type input = ListHealthChecksRequest.t type output = ListHealthChecksResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListHealthChecks"])] (Util.drop_empty diff --git a/libraries/route53/lib/listHostedZones.ml b/libraries/route53/lib/listHostedZones.ml index eab5ac2a4..7ffad6cec 100644 --- a/libraries/route53/lib/listHostedZones.ml +++ b/libraries/route53/lib/listHostedZones.ml @@ -4,9 +4,11 @@ type input = ListHostedZonesRequest.t type output = ListHostedZonesResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListHostedZones"])] (Util.drop_empty diff --git a/libraries/route53/lib/listHostedZonesByName.ml b/libraries/route53/lib/listHostedZonesByName.ml index b5d24591b..4043664cb 100644 --- a/libraries/route53/lib/listHostedZonesByName.ml +++ b/libraries/route53/lib/listHostedZonesByName.ml @@ -4,9 +4,11 @@ type input = ListHostedZonesByNameRequest.t type output = ListHostedZonesByNameResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListHostedZonesByName"])] (Util.drop_empty diff --git a/libraries/route53/lib/listResourceRecordSets.ml b/libraries/route53/lib/listResourceRecordSets.ml index d063a9db2..c7b7b7372 100644 --- a/libraries/route53/lib/listResourceRecordSets.ml +++ b/libraries/route53/lib/listResourceRecordSets.ml @@ -4,9 +4,11 @@ type input = ListResourceRecordSetsRequest.t type output = ListResourceRecordSetsResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListResourceRecordSets"])] diff --git a/libraries/route53/lib/listReusableDelegationSets.ml b/libraries/route53/lib/listReusableDelegationSets.ml index aca681f69..b605d47de 100644 --- a/libraries/route53/lib/listReusableDelegationSets.ml +++ b/libraries/route53/lib/listReusableDelegationSets.ml @@ -4,9 +4,11 @@ type input = ListReusableDelegationSetsRequest.t type output = ListReusableDelegationSetsResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListReusableDelegationSets"])] diff --git a/libraries/route53/lib/listTagsForResource.ml b/libraries/route53/lib/listTagsForResource.ml index c784d4631..08d09bd93 100644 --- a/libraries/route53/lib/listTagsForResource.ml +++ b/libraries/route53/lib/listTagsForResource.ml @@ -4,9 +4,11 @@ type input = ListTagsForResourceRequest.t type output = ListTagsForResourceResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListTagsForResource"])] (Util.drop_empty diff --git a/libraries/route53/lib/listTagsForResources.ml b/libraries/route53/lib/listTagsForResources.ml index f242d3e30..a0bd87620 100644 --- a/libraries/route53/lib/listTagsForResources.ml +++ b/libraries/route53/lib/listTagsForResources.ml @@ -4,9 +4,11 @@ type input = ListTagsForResourcesRequest.t type output = ListTagsForResourcesResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["ListTagsForResources"])] (Util.drop_empty diff --git a/libraries/route53/lib/types.ml b/libraries/route53/lib/types.ml index ad16ca1aa..1c12304eb 100644 --- a/libraries/route53/lib/types.ml +++ b/libraries/route53/lib/types.ml @@ -160,6 +160,8 @@ module RRType = (TXT, "TXT"); (A, "A"); (SOA, "SOA")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -178,6 +180,8 @@ module ResourceRecordSetFailover = | SECONDARY let str_to_t = [("SECONDARY", SECONDARY); ("PRIMARY", PRIMARY)] let t_to_str = [(SECONDARY, "SECONDARY"); (PRIMARY, "PRIMARY")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -224,6 +228,8 @@ module ResourceRecordSetRegion = (Us_west_2, "us-west-2"); (Us_west_1, "us-west-1"); (Us_east_1, "us-east-1")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -266,6 +272,8 @@ module HealthCheckType = (HTTP_STR_MATCH, "HTTP_STR_MATCH"); (HTTPS, "HTTPS"); (HTTP, "HTTP")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -317,6 +325,8 @@ module ChangeAction = [("UPSERT", UPSERT); ("DELETE", DELETE); ("CREATE", CREATE)] let t_to_str = [(UPSERT, "UPSERT"); (DELETE, "DELETE"); (CREATE, "CREATE")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -658,6 +668,8 @@ module TagResourceType = | Hostedzone let str_to_t = [("hostedzone", Hostedzone); ("healthcheck", Healthcheck)] let t_to_str = [(Hostedzone, "hostedzone"); (Healthcheck, "healthcheck")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -757,6 +769,8 @@ module VPCRegion = (Us_west_2, "us-west-2"); (Us_west_1, "us-west-1"); (Us_east_1, "us-east-1")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -844,6 +858,8 @@ module ChangeStatus = | INSYNC let str_to_t = [("INSYNC", INSYNC); ("PENDING", PENDING)] let t_to_str = [(INSYNC, "INSYNC"); (PENDING, "PENDING")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/route53/lib/updateHealthCheck.ml b/libraries/route53/lib/updateHealthCheck.ml index 0f2652d88..0048296a7 100644 --- a/libraries/route53/lib/updateHealthCheck.ml +++ b/libraries/route53/lib/updateHealthCheck.ml @@ -4,9 +4,11 @@ type input = UpdateHealthCheckRequest.t type output = UpdateHealthCheckResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["UpdateHealthCheck"])] (Util.drop_empty diff --git a/libraries/route53/lib/updateHostedZoneComment.ml b/libraries/route53/lib/updateHostedZoneComment.ml index 78a6efe55..c12d5bef1 100644 --- a/libraries/route53/lib/updateHostedZoneComment.ml +++ b/libraries/route53/lib/updateHostedZoneComment.ml @@ -4,9 +4,11 @@ type input = UpdateHostedZoneCommentRequest.t type output = UpdateHostedZoneCommentResponse.t type error = Errors_internal.t let service = "route53" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://route53.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2013-04-01"]); ("Action", ["UpdateHostedZoneComment"])] diff --git a/libraries/route53/lib_test/aws_route53_test.ml b/libraries/route53/lib_test/aws_route53_test.ml index 25f1e3b1e..535391a85 100644 --- a/libraries/route53/lib_test/aws_route53_test.ml +++ b/libraries/route53/lib_test/aws_route53_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop Route53 test succeeds" - @?false + @?true let test_cases = [ "Route53 noop" >:: noop_test ] diff --git a/libraries/s3/lib/abortMultipartUpload.ml b/libraries/s3/lib/abortMultipartUpload.ml index 3de91de51..d1aac624a 100644 --- a/libraries/s3/lib/abortMultipartUpload.ml +++ b/libraries/s3/lib/abortMultipartUpload.ml @@ -4,9 +4,11 @@ type input = AbortMultipartUploadRequest.t type output = AbortMultipartUploadOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["AbortMultipartUpload"])] (Util.drop_empty diff --git a/libraries/s3/lib/completeMultipartUpload.ml b/libraries/s3/lib/completeMultipartUpload.ml index a11fe2053..c07624c5a 100644 --- a/libraries/s3/lib/completeMultipartUpload.ml +++ b/libraries/s3/lib/completeMultipartUpload.ml @@ -4,9 +4,11 @@ type input = CompleteMultipartUploadRequest.t type output = CompleteMultipartUploadOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["CompleteMultipartUpload"])] diff --git a/libraries/s3/lib/copyObject.ml b/libraries/s3/lib/copyObject.ml index 3b1394906..76889c030 100644 --- a/libraries/s3/lib/copyObject.ml +++ b/libraries/s3/lib/copyObject.ml @@ -4,9 +4,11 @@ type input = CopyObjectRequest.t type output = CopyObjectOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["CopyObject"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/createBucket.ml b/libraries/s3/lib/createBucket.ml index a5d6ef4fe..4fec21c24 100644 --- a/libraries/s3/lib/createBucket.ml +++ b/libraries/s3/lib/createBucket.ml @@ -4,9 +4,11 @@ type input = CreateBucketRequest.t type output = CreateBucketOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["CreateBucket"])] (Util.drop_empty diff --git a/libraries/s3/lib/createMultipartUpload.ml b/libraries/s3/lib/createMultipartUpload.ml index 5712a3681..d992a733c 100644 --- a/libraries/s3/lib/createMultipartUpload.ml +++ b/libraries/s3/lib/createMultipartUpload.ml @@ -4,9 +4,11 @@ type input = CreateMultipartUploadRequest.t type output = CreateMultipartUploadOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["CreateMultipartUpload"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteBucket.ml b/libraries/s3/lib/deleteBucket.ml index b5080c248..00b61275d 100644 --- a/libraries/s3/lib/deleteBucket.ml +++ b/libraries/s3/lib/deleteBucket.ml @@ -4,9 +4,11 @@ type input = DeleteBucketRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucket"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteBucketCors.ml b/libraries/s3/lib/deleteBucketCors.ml index 3795f2dcf..245620d66 100644 --- a/libraries/s3/lib/deleteBucketCors.ml +++ b/libraries/s3/lib/deleteBucketCors.ml @@ -4,9 +4,11 @@ type input = DeleteBucketCorsRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketCors"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteBucketLifecycle.ml b/libraries/s3/lib/deleteBucketLifecycle.ml index 982741b5e..3963080a8 100644 --- a/libraries/s3/lib/deleteBucketLifecycle.ml +++ b/libraries/s3/lib/deleteBucketLifecycle.ml @@ -4,9 +4,11 @@ type input = DeleteBucketLifecycleRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketLifecycle"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteBucketPolicy.ml b/libraries/s3/lib/deleteBucketPolicy.ml index 5ad2e8a02..9ba56140d 100644 --- a/libraries/s3/lib/deleteBucketPolicy.ml +++ b/libraries/s3/lib/deleteBucketPolicy.ml @@ -4,9 +4,11 @@ type input = DeleteBucketPolicyRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketPolicy"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteBucketReplication.ml b/libraries/s3/lib/deleteBucketReplication.ml index f8d937727..fc444ef4d 100644 --- a/libraries/s3/lib/deleteBucketReplication.ml +++ b/libraries/s3/lib/deleteBucketReplication.ml @@ -4,9 +4,11 @@ type input = DeleteBucketReplicationRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketReplication"])] diff --git a/libraries/s3/lib/deleteBucketTagging.ml b/libraries/s3/lib/deleteBucketTagging.ml index b07a20e8a..291edf5e4 100644 --- a/libraries/s3/lib/deleteBucketTagging.ml +++ b/libraries/s3/lib/deleteBucketTagging.ml @@ -4,9 +4,11 @@ type input = DeleteBucketTaggingRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketTagging"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteBucketWebsite.ml b/libraries/s3/lib/deleteBucketWebsite.ml index 7c9192a89..8322b2c99 100644 --- a/libraries/s3/lib/deleteBucketWebsite.ml +++ b/libraries/s3/lib/deleteBucketWebsite.ml @@ -4,9 +4,11 @@ type input = DeleteBucketWebsiteRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteBucketWebsite"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteObject.ml b/libraries/s3/lib/deleteObject.ml index 451c5479e..2704979f5 100644 --- a/libraries/s3/lib/deleteObject.ml +++ b/libraries/s3/lib/deleteObject.ml @@ -4,9 +4,11 @@ type input = DeleteObjectRequest.t type output = DeleteObjectOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteObject"])] (Util.drop_empty diff --git a/libraries/s3/lib/deleteObjects.ml b/libraries/s3/lib/deleteObjects.ml index c39a2d1e7..1a3e74600 100644 --- a/libraries/s3/lib/deleteObjects.ml +++ b/libraries/s3/lib/deleteObjects.ml @@ -4,9 +4,11 @@ type input = DeleteObjectsRequest.t type output = DeleteObjectsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["DeleteObjects"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketAcl.ml b/libraries/s3/lib/getBucketAcl.ml index 6070d0bd1..3f65beef0 100644 --- a/libraries/s3/lib/getBucketAcl.ml +++ b/libraries/s3/lib/getBucketAcl.ml @@ -4,9 +4,11 @@ type input = GetBucketAclRequest.t type output = GetBucketAclOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketAcl"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketCors.ml b/libraries/s3/lib/getBucketCors.ml index 6f90249cf..498dac37d 100644 --- a/libraries/s3/lib/getBucketCors.ml +++ b/libraries/s3/lib/getBucketCors.ml @@ -4,9 +4,11 @@ type input = GetBucketCorsRequest.t type output = GetBucketCorsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketCors"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketLifecycle.ml b/libraries/s3/lib/getBucketLifecycle.ml index 16800b1e1..61e96e6d7 100644 --- a/libraries/s3/lib/getBucketLifecycle.ml +++ b/libraries/s3/lib/getBucketLifecycle.ml @@ -4,9 +4,11 @@ type input = GetBucketLifecycleRequest.t type output = GetBucketLifecycleOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketLifecycle"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketLocation.ml b/libraries/s3/lib/getBucketLocation.ml index a2c08d6a3..43fedcc45 100644 --- a/libraries/s3/lib/getBucketLocation.ml +++ b/libraries/s3/lib/getBucketLocation.ml @@ -4,9 +4,11 @@ type input = GetBucketLocationRequest.t type output = GetBucketLocationOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketLocation"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketLogging.ml b/libraries/s3/lib/getBucketLogging.ml index ca8bf2290..08794b961 100644 --- a/libraries/s3/lib/getBucketLogging.ml +++ b/libraries/s3/lib/getBucketLogging.ml @@ -4,9 +4,11 @@ type input = GetBucketLoggingRequest.t type output = GetBucketLoggingOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketLogging"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketNotification.ml b/libraries/s3/lib/getBucketNotification.ml index 483829b86..5c70adfe4 100644 --- a/libraries/s3/lib/getBucketNotification.ml +++ b/libraries/s3/lib/getBucketNotification.ml @@ -4,9 +4,11 @@ type input = GetBucketNotificationConfigurationRequest.t type output = NotificationConfigurationDeprecated.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketNotification"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketNotificationConfiguration.ml b/libraries/s3/lib/getBucketNotificationConfiguration.ml index 8bc347bd0..1f2255bab 100644 --- a/libraries/s3/lib/getBucketNotificationConfiguration.ml +++ b/libraries/s3/lib/getBucketNotificationConfiguration.ml @@ -4,9 +4,11 @@ type input = GetBucketNotificationConfigurationRequest.t type output = NotificationConfiguration.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketNotificationConfiguration"])] diff --git a/libraries/s3/lib/getBucketPolicy.ml b/libraries/s3/lib/getBucketPolicy.ml index 2164e953f..eae12dbcd 100644 --- a/libraries/s3/lib/getBucketPolicy.ml +++ b/libraries/s3/lib/getBucketPolicy.ml @@ -4,9 +4,11 @@ type input = GetBucketPolicyRequest.t type output = GetBucketPolicyOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketPolicy"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketReplication.ml b/libraries/s3/lib/getBucketReplication.ml index 6c089e315..9c2259375 100644 --- a/libraries/s3/lib/getBucketReplication.ml +++ b/libraries/s3/lib/getBucketReplication.ml @@ -4,9 +4,11 @@ type input = GetBucketReplicationRequest.t type output = GetBucketReplicationOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketReplication"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketRequestPayment.ml b/libraries/s3/lib/getBucketRequestPayment.ml index 22d8be5b1..49e4b5930 100644 --- a/libraries/s3/lib/getBucketRequestPayment.ml +++ b/libraries/s3/lib/getBucketRequestPayment.ml @@ -4,9 +4,11 @@ type input = GetBucketRequestPaymentRequest.t type output = GetBucketRequestPaymentOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketRequestPayment"])] diff --git a/libraries/s3/lib/getBucketTagging.ml b/libraries/s3/lib/getBucketTagging.ml index 479655812..74589ab70 100644 --- a/libraries/s3/lib/getBucketTagging.ml +++ b/libraries/s3/lib/getBucketTagging.ml @@ -4,9 +4,11 @@ type input = GetBucketTaggingRequest.t type output = GetBucketTaggingOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketTagging"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketVersioning.ml b/libraries/s3/lib/getBucketVersioning.ml index d3fa467d9..fd78af890 100644 --- a/libraries/s3/lib/getBucketVersioning.ml +++ b/libraries/s3/lib/getBucketVersioning.ml @@ -4,9 +4,11 @@ type input = GetBucketVersioningRequest.t type output = GetBucketVersioningOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketVersioning"])] (Util.drop_empty diff --git a/libraries/s3/lib/getBucketWebsite.ml b/libraries/s3/lib/getBucketWebsite.ml index 2b78fcb62..c72250740 100644 --- a/libraries/s3/lib/getBucketWebsite.ml +++ b/libraries/s3/lib/getBucketWebsite.ml @@ -4,9 +4,11 @@ type input = GetBucketWebsiteRequest.t type output = GetBucketWebsiteOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetBucketWebsite"])] (Util.drop_empty diff --git a/libraries/s3/lib/getObject.ml b/libraries/s3/lib/getObject.ml index c24bfc85c..b699a6fc0 100644 --- a/libraries/s3/lib/getObject.ml +++ b/libraries/s3/lib/getObject.ml @@ -4,9 +4,11 @@ type input = GetObjectRequest.t type output = GetObjectOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetObject"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/getObjectAcl.ml b/libraries/s3/lib/getObjectAcl.ml index 33149cec7..591f1c97a 100644 --- a/libraries/s3/lib/getObjectAcl.ml +++ b/libraries/s3/lib/getObjectAcl.ml @@ -4,9 +4,11 @@ type input = GetObjectAclRequest.t type output = GetObjectAclOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetObjectAcl"])] (Util.drop_empty diff --git a/libraries/s3/lib/getObjectTorrent.ml b/libraries/s3/lib/getObjectTorrent.ml index f9fecb2c9..b783d6e3d 100644 --- a/libraries/s3/lib/getObjectTorrent.ml +++ b/libraries/s3/lib/getObjectTorrent.ml @@ -4,9 +4,11 @@ type input = GetObjectTorrentRequest.t type output = GetObjectTorrentOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["GetObjectTorrent"])] (Util.drop_empty diff --git a/libraries/s3/lib/headBucket.ml b/libraries/s3/lib/headBucket.ml index 85b8f9771..506829fb8 100644 --- a/libraries/s3/lib/headBucket.ml +++ b/libraries/s3/lib/headBucket.ml @@ -4,9 +4,11 @@ type input = HeadBucketRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["HeadBucket"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/headObject.ml b/libraries/s3/lib/headObject.ml index cdc544598..c50b971f4 100644 --- a/libraries/s3/lib/headObject.ml +++ b/libraries/s3/lib/headObject.ml @@ -4,9 +4,11 @@ type input = HeadObjectRequest.t type output = HeadObjectOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["HeadObject"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/listBuckets.ml b/libraries/s3/lib/listBuckets.ml index 7f67f6437..ecf71e91b 100644 --- a/libraries/s3/lib/listBuckets.ml +++ b/libraries/s3/lib/listBuckets.ml @@ -4,9 +4,11 @@ type input = Aws.BaseTypes.Unit.t type output = ListBucketsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["ListBuckets"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/listMultipartUploads.ml b/libraries/s3/lib/listMultipartUploads.ml index 5f20ff4d9..28da98544 100644 --- a/libraries/s3/lib/listMultipartUploads.ml +++ b/libraries/s3/lib/listMultipartUploads.ml @@ -4,9 +4,11 @@ type input = ListMultipartUploadsRequest.t type output = ListMultipartUploadsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["ListMultipartUploads"])] (Util.drop_empty diff --git a/libraries/s3/lib/listObjectVersions.ml b/libraries/s3/lib/listObjectVersions.ml index 5dbc2a245..4adc0a9b0 100644 --- a/libraries/s3/lib/listObjectVersions.ml +++ b/libraries/s3/lib/listObjectVersions.ml @@ -4,9 +4,11 @@ type input = ListObjectVersionsRequest.t type output = ListObjectVersionsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["ListObjectVersions"])] (Util.drop_empty diff --git a/libraries/s3/lib/listObjects.ml b/libraries/s3/lib/listObjects.ml index 45795148e..e77ead791 100644 --- a/libraries/s3/lib/listObjects.ml +++ b/libraries/s3/lib/listObjects.ml @@ -4,9 +4,11 @@ type input = ListObjectsRequest.t type output = ListObjectsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["ListObjects"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/listParts.ml b/libraries/s3/lib/listParts.ml index b88e6a072..df1642303 100644 --- a/libraries/s3/lib/listParts.ml +++ b/libraries/s3/lib/listParts.ml @@ -4,9 +4,11 @@ type input = ListPartsRequest.t type output = ListPartsOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["ListParts"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/putBucketAcl.ml b/libraries/s3/lib/putBucketAcl.ml index 52c31fd0c..255da54ff 100644 --- a/libraries/s3/lib/putBucketAcl.ml +++ b/libraries/s3/lib/putBucketAcl.ml @@ -4,9 +4,11 @@ type input = PutBucketAclRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketAcl"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketCors.ml b/libraries/s3/lib/putBucketCors.ml index c2a2d650b..c6956db12 100644 --- a/libraries/s3/lib/putBucketCors.ml +++ b/libraries/s3/lib/putBucketCors.ml @@ -4,9 +4,11 @@ type input = PutBucketCorsRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketCors"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketLifecycle.ml b/libraries/s3/lib/putBucketLifecycle.ml index d60180d8c..8715c55c5 100644 --- a/libraries/s3/lib/putBucketLifecycle.ml +++ b/libraries/s3/lib/putBucketLifecycle.ml @@ -4,9 +4,11 @@ type input = PutBucketLifecycleRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketLifecycle"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketLogging.ml b/libraries/s3/lib/putBucketLogging.ml index 1d39a7969..01dff061b 100644 --- a/libraries/s3/lib/putBucketLogging.ml +++ b/libraries/s3/lib/putBucketLogging.ml @@ -4,9 +4,11 @@ type input = PutBucketLoggingRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketLogging"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketNotification.ml b/libraries/s3/lib/putBucketNotification.ml index b9d8084d5..0a68560a9 100644 --- a/libraries/s3/lib/putBucketNotification.ml +++ b/libraries/s3/lib/putBucketNotification.ml @@ -4,9 +4,11 @@ type input = PutBucketNotificationRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketNotification"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketNotificationConfiguration.ml b/libraries/s3/lib/putBucketNotificationConfiguration.ml index 07cb6a51a..69264ad1f 100644 --- a/libraries/s3/lib/putBucketNotificationConfiguration.ml +++ b/libraries/s3/lib/putBucketNotificationConfiguration.ml @@ -4,9 +4,11 @@ type input = PutBucketNotificationConfigurationRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketNotificationConfiguration"])] diff --git a/libraries/s3/lib/putBucketPolicy.ml b/libraries/s3/lib/putBucketPolicy.ml index 7233af55d..45d5e91d6 100644 --- a/libraries/s3/lib/putBucketPolicy.ml +++ b/libraries/s3/lib/putBucketPolicy.ml @@ -4,9 +4,11 @@ type input = PutBucketPolicyRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketPolicy"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketReplication.ml b/libraries/s3/lib/putBucketReplication.ml index e02c12b46..5fb501708 100644 --- a/libraries/s3/lib/putBucketReplication.ml +++ b/libraries/s3/lib/putBucketReplication.ml @@ -4,9 +4,11 @@ type input = PutBucketReplicationRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketReplication"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketRequestPayment.ml b/libraries/s3/lib/putBucketRequestPayment.ml index 1a559f7aa..0f3ca00aa 100644 --- a/libraries/s3/lib/putBucketRequestPayment.ml +++ b/libraries/s3/lib/putBucketRequestPayment.ml @@ -4,9 +4,11 @@ type input = PutBucketRequestPaymentRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketRequestPayment"])] diff --git a/libraries/s3/lib/putBucketTagging.ml b/libraries/s3/lib/putBucketTagging.ml index 1aea5c50e..fc1a11272 100644 --- a/libraries/s3/lib/putBucketTagging.ml +++ b/libraries/s3/lib/putBucketTagging.ml @@ -4,9 +4,11 @@ type input = PutBucketTaggingRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketTagging"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketVersioning.ml b/libraries/s3/lib/putBucketVersioning.ml index 52e04f3c3..6f298c277 100644 --- a/libraries/s3/lib/putBucketVersioning.ml +++ b/libraries/s3/lib/putBucketVersioning.ml @@ -4,9 +4,11 @@ type input = PutBucketVersioningRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketVersioning"])] (Util.drop_empty diff --git a/libraries/s3/lib/putBucketWebsite.ml b/libraries/s3/lib/putBucketWebsite.ml index 8d27aafe9..120bc629c 100644 --- a/libraries/s3/lib/putBucketWebsite.ml +++ b/libraries/s3/lib/putBucketWebsite.ml @@ -4,9 +4,11 @@ type input = PutBucketWebsiteRequest.t type output = unit type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutBucketWebsite"])] (Util.drop_empty diff --git a/libraries/s3/lib/putObject.ml b/libraries/s3/lib/putObject.ml index cf9f2ae2a..05662de02 100644 --- a/libraries/s3/lib/putObject.ml +++ b/libraries/s3/lib/putObject.ml @@ -4,9 +4,11 @@ type input = PutObjectRequest.t type output = PutObjectOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutObject"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/putObjectAcl.ml b/libraries/s3/lib/putObjectAcl.ml index 63ef15763..e3607e60a 100644 --- a/libraries/s3/lib/putObjectAcl.ml +++ b/libraries/s3/lib/putObjectAcl.ml @@ -4,9 +4,11 @@ type input = PutObjectAclRequest.t type output = PutObjectAclOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["PutObjectAcl"])] (Util.drop_empty diff --git a/libraries/s3/lib/restoreObject.ml b/libraries/s3/lib/restoreObject.ml index 055ee4cb1..7404dcec3 100644 --- a/libraries/s3/lib/restoreObject.ml +++ b/libraries/s3/lib/restoreObject.ml @@ -4,9 +4,11 @@ type input = RestoreObjectRequest.t type output = RestoreObjectOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["RestoreObject"])] (Util.drop_empty diff --git a/libraries/s3/lib/types.ml b/libraries/s3/lib/types.ml index 3951482e8..df4cd20be 100644 --- a/libraries/s3/lib/types.ml +++ b/libraries/s3/lib/types.ml @@ -9,6 +9,8 @@ module FilterRuleName = | Suffix let str_to_t = [("suffix", Suffix); ("prefix", Prefix)] let t_to_str = [(Suffix, "suffix"); (Prefix, "prefix")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -67,6 +69,8 @@ module Type = [(Group, "Group"); (AmazonCustomerByEmail, "AmazonCustomerByEmail"); (CanonicalUser, "CanonicalUser")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -94,6 +98,8 @@ module TransitionStorageClass = | GLACIER let str_to_t = [("GLACIER", GLACIER)] let t_to_str = [(GLACIER, "GLACIER")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -115,6 +121,8 @@ module BucketLogsPermission = [("WRITE", WRITE); ("READ", READ); ("FULL_CONTROL", FULL_CONTROL)] let t_to_str = [(WRITE, "WRITE"); (READ, "READ"); (FULL_CONTROL, "FULL_CONTROL")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -190,6 +198,8 @@ module Protocol = | Https let str_to_t = [("https", Https); ("http", Http)] let t_to_str = [(Https, "https"); (Http, "http")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -237,6 +247,8 @@ module Event = (S3_ObjectCreated_Put, "s3:ObjectCreated:Put"); (S3_ObjectCreated__, "s3:ObjectCreated:*"); (S3_ReducedRedundancyLostObject, "s3:ReducedRedundancyLostObject")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -254,13 +266,7 @@ module S3KeyFilter = filter_rules: FilterRuleList.t } let make ?(filter_rules= []) () = { filter_rules } let parse xml = - Some - { - filter_rules = - (Util.of_option [] - (Util.option_bind (Xml.member "FilterRule" xml) - FilterRuleList.parse)) - } + Some { filter_rules = (Util.of_option [] (FilterRuleList.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -310,6 +316,8 @@ module ReplicationRuleStatus = | Disabled let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -328,6 +336,8 @@ module ExpirationStatus = | Disabled let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -510,6 +520,8 @@ module Permission = (WRITE_ACP, "WRITE_ACP"); (WRITE, "WRITE"); (FULL_CONTROL, "FULL_CONTROL")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -823,6 +835,8 @@ module ObjectStorageClass = [(GLACIER, "GLACIER"); (REDUCED_REDUNDANCY, "REDUCED_REDUNDANCY"); (STANDARD, "STANDARD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1058,6 +1072,8 @@ module ObjectVersionStorageClass = | STANDARD let str_to_t = [("STANDARD", STANDARD)] let t_to_str = [(STANDARD, "STANDARD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1145,6 +1161,8 @@ module StorageClass = [("REDUCED_REDUNDANCY", REDUCED_REDUNDANCY); ("STANDARD", STANDARD)] let t_to_str = [(REDUCED_REDUNDANCY, "REDUCED_REDUNDANCY"); (STANDARD, "STANDARD")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1241,9 +1259,7 @@ module LambdaFunctionConfiguration = (Xml.required "CloudFunction" (Util.option_bind (Xml.member "CloudFunction" xml) String.parse)); - events = - (Xml.required "Event" - (Util.option_bind (Xml.member "Event" xml) EventList.parse)); + events = (Xml.required "Event" (EventList.parse xml)); filter = (Util.option_bind (Xml.member "Filter" xml) NotificationConfigurationFilter.parse) @@ -1301,9 +1317,7 @@ module QueueConfiguration = queue_arn = (Xml.required "Queue" (Util.option_bind (Xml.member "Queue" xml) String.parse)); - events = - (Xml.required "Event" - (Util.option_bind (Xml.member "Event" xml) EventList.parse)); + events = (Xml.required "Event" (EventList.parse xml)); filter = (Util.option_bind (Xml.member "Filter" xml) NotificationConfigurationFilter.parse) @@ -1357,9 +1371,7 @@ module TopicConfiguration = topic_arn = (Xml.required "Topic" (Util.option_bind (Xml.member "Topic" xml) String.parse)); - events = - (Xml.required "Event" - (Util.option_bind (Xml.member "Event" xml) EventList.parse)); + events = (Xml.required "Event" (EventList.parse xml)); filter = (Util.option_bind (Xml.member "Filter" xml) NotificationConfigurationFilter.parse) @@ -1417,22 +1429,10 @@ module CORSRule = let parse xml = Some { - allowed_headers = - (Util.of_option [] - (Util.option_bind (Xml.member "AllowedHeader" xml) - AllowedHeaders.parse)); - allowed_methods = - (Util.of_option [] - (Util.option_bind (Xml.member "AllowedMethod" xml) - AllowedMethods.parse)); - allowed_origins = - (Util.of_option [] - (Util.option_bind (Xml.member "AllowedOrigin" xml) - AllowedOrigins.parse)); - expose_headers = - (Util.of_option [] - (Util.option_bind (Xml.member "ExposeHeader" xml) - ExposeHeaders.parse)); + allowed_headers = (Util.of_option [] (AllowedHeaders.parse xml)); + allowed_methods = (Util.of_option [] (AllowedMethods.parse xml)); + allowed_origins = (Util.of_option [] (AllowedOrigins.parse xml)); + expose_headers = (Util.of_option [] (ExposeHeaders.parse xml)); max_age_seconds = (Util.option_bind (Xml.member "MaxAgeSeconds" xml) Integer.parse) } @@ -1647,6 +1647,8 @@ module BucketLocationConstraint = (Us_west_1, "us-west-1"); (Eu_west_1, "eu-west-1"); (EU, "EU")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -1773,9 +1775,7 @@ module CloudFunctionConfiguration = { id = (Util.option_bind (Xml.member "Id" xml) String.parse); event = (Util.option_bind (Xml.member "Event" xml) Event.parse); - events = - (Util.of_option [] - (Util.option_bind (Xml.member "Event" xml) EventList.parse)); + events = (Util.of_option [] (EventList.parse xml)); cloud_function = (Util.option_bind (Xml.member "CloudFunction" xml) String.parse); invocation_role = @@ -1830,9 +1830,7 @@ module QueueConfigurationDeprecated = { id = (Util.option_bind (Xml.member "Id" xml) String.parse); event = (Util.option_bind (Xml.member "Event" xml) Event.parse); - events = - (Util.of_option [] - (Util.option_bind (Xml.member "Event" xml) EventList.parse)); + events = (Util.of_option [] (EventList.parse xml)); queue = (Util.option_bind (Xml.member "Queue" xml) String.parse) } let to_query v = @@ -1875,9 +1873,7 @@ module TopicConfigurationDeprecated = Some { id = (Util.option_bind (Xml.member "Id" xml) String.parse); - events = - (Util.of_option [] - (Util.option_bind (Xml.member "Event" xml) EventList.parse)); + events = (Util.of_option [] (EventList.parse xml)); event = (Util.option_bind (Xml.member "Event" xml) Event.parse); topic = (Util.option_bind (Xml.member "Topic" xml) String.parse) } @@ -2068,6 +2064,8 @@ module BucketVersioningStatus = | Suspended let str_to_t = [("Suspended", Suspended); ("Enabled", Enabled)] let t_to_str = [(Suspended, "Suspended"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2086,6 +2084,8 @@ module MFADelete = | Disabled let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2104,6 +2104,8 @@ module Payer = | BucketOwner let str_to_t = [("BucketOwner", BucketOwner); ("Requester", Requester)] let t_to_str = [(BucketOwner, "BucketOwner"); (Requester, "Requester")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2504,6 +2506,8 @@ module RequestPayer = | Requester let str_to_t = [("requester", Requester)] let t_to_str = [(Requester, "requester")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2521,6 +2525,8 @@ module RequestCharged = | Requester let str_to_t = [("requester", Requester)] let t_to_str = [(Requester, "requester")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2539,6 +2545,8 @@ module ServerSideEncryption = | Aws_kms let str_to_t = [("aws:kms", Aws_kms); ("AES256", AES256)] let t_to_str = [(Aws_kms, "aws:kms"); (AES256, "AES256")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2562,10 +2570,7 @@ module ReplicationConfiguration = role = (Xml.required "Role" (Util.option_bind (Xml.member "Role" xml) String.parse)); - rules = - (Xml.required "Rule" - (Util.option_bind (Xml.member "Rule" xml) - ReplicationRules.parse)) + rules = (Xml.required "Rule" (ReplicationRules.parse xml)) } let to_query v = Query.List @@ -2602,6 +2607,8 @@ module EncodingType = | Url let str_to_t = [("url", Url)] let t_to_str = [(Url, "url")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2628,12 +2635,16 @@ module Metadata = type t = (String.t, String.t) Hashtbl.t let make elems () = elems let parse xml = None - let to_query v = Query.to_query_hashtbl String.to_query v + let to_query v = + Query.to_query_hashtbl String.to_string String.to_query v let to_json v = `Assoc (Hashtbl.fold - (fun k -> fun v -> fun acc -> (k, (String.to_json v)) :: acc) v []) - let of_json j = Json.to_hashtbl String.of_json j + (fun k -> + fun v -> + fun acc -> ((String.to_string k), (String.to_json v)) :: acc) + v []) + let of_json j = Json.to_hashtbl String.of_string String.of_json j end module ReplicationStatus = struct @@ -2652,6 +2663,8 @@ module ReplicationStatus = (FAILED, "FAILED"); (PENDING, "PENDING"); (COMPLETE, "COMPLETE")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2668,13 +2681,7 @@ module LifecycleConfiguration = type t = { rules: Rules.t } let make ~rules () = { rules } - let parse xml = - Some - { - rules = - (Xml.required "Rule" - (Util.option_bind (Xml.member "Rule" xml) Rules.parse)) - } + let parse xml = Some { rules = (Xml.required "Rule" (Rules.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -2742,6 +2749,8 @@ module ObjectCannedACL = (Public_read_write, "public-read-write"); (Public_read, "public-read"); (Private, "private")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2770,6 +2779,8 @@ module BucketCannedACL = (Public_read_write, "public-read-write"); (Public_read, "public-read"); (Private, "private")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -2851,13 +2862,7 @@ module CompletedMultipartUpload = parts: CompletedPartList.t } let make ?(parts= []) () = { parts } let parse xml = - Some - { - parts = - (Util.of_option [] - (Util.option_bind (Xml.member "Part" xml) - CompletedPartList.parse)) - } + Some { parts = (Util.of_option [] (CompletedPartList.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -3125,10 +3130,7 @@ module Delete = let parse xml = Some { - objects = - (Xml.required "Object" - (Util.option_bind (Xml.member "Object" xml) - ObjectIdentifierList.parse)); + objects = (Xml.required "Object" (ObjectIdentifierList.parse xml)); quiet = (Util.option_bind (Xml.member "Quiet" xml) Boolean.parse) } let to_query v = @@ -3180,6 +3182,8 @@ module MFADeleteStatus = | Disabled let str_to_t = [("Disabled", Disabled); ("Enabled", Enabled)] let t_to_str = [(Disabled, "Disabled"); (Enabled, "Enabled")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -3198,6 +3202,8 @@ module MetadataDirective = | REPLACE let str_to_t = [("REPLACE", REPLACE); ("COPY", COPY)] let t_to_str = [(REPLACE, "REPLACE"); (COPY, "COPY")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -3364,18 +3370,11 @@ module NotificationConfiguration = Some { topic_configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "TopicConfiguration" xml) - TopicConfigurationList.parse)); + (Util.of_option [] (TopicConfigurationList.parse xml)); queue_configurations = - (Util.of_option [] - (Util.option_bind (Xml.member "QueueConfiguration" xml) - QueueConfigurationList.parse)); + (Util.of_option [] (QueueConfigurationList.parse xml)); lambda_function_configurations = - (Util.of_option [] - (Util.option_bind - (Xml.member "CloudFunctionConfiguration" xml) - LambdaFunctionConfigurationList.parse)) + (Util.of_option [] (LambdaFunctionConfigurationList.parse xml)) } let to_query v = Query.List @@ -3426,12 +3425,7 @@ module CORSConfiguration = c_o_r_s_rules: CORSRules.t } let make ?(c_o_r_s_rules= []) () = { c_o_r_s_rules } let parse xml = - Some - { - c_o_r_s_rules = - (Util.of_option [] - (Util.option_bind (Xml.member "CORSRule" xml) CORSRules.parse)) - } + Some { c_o_r_s_rules = (Util.of_option [] (CORSRules.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -4317,19 +4311,14 @@ module ListObjectsOutput = marker = (Util.option_bind (Xml.member "Marker" xml) String.parse); next_marker = (Util.option_bind (Xml.member "NextMarker" xml) String.parse); - contents = - (Util.of_option [] - (Util.option_bind (Xml.member "Contents" xml) ObjectList.parse)); + contents = (Util.of_option [] (ObjectList.parse xml)); name = (Util.option_bind (Xml.member "Name" xml) String.parse); prefix = (Util.option_bind (Xml.member "Prefix" xml) String.parse); delimiter = (Util.option_bind (Xml.member "Delimiter" xml) String.parse); max_keys = (Util.option_bind (Xml.member "MaxKeys" xml) Integer.parse); - common_prefixes = - (Util.of_option [] - (Util.option_bind (Xml.member "CommonPrefixes" xml) - CommonPrefixList.parse)); + common_prefixes = (Util.of_option [] (CommonPrefixList.parse xml)); encoding_type = (Util.option_bind (Xml.member "EncodingType" xml) EncodingType.parse) @@ -4755,13 +4744,7 @@ module GetBucketLifecycleOutput = type t = { rules: Rules.t } let make ?(rules= []) () = { rules } - let parse xml = - Some - { - rules = - (Util.of_option [] - (Util.option_bind (Xml.member "Rule" xml) Rules.parse)) - } + let parse xml = Some { rules = (Util.of_option [] (Rules.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -5450,12 +5433,7 @@ module GetBucketCorsOutput = c_o_r_s_rules: CORSRules.t } let make ?(c_o_r_s_rules= []) () = { c_o_r_s_rules } let parse xml = - Some - { - c_o_r_s_rules = - (Util.of_option [] - (Util.option_bind (Xml.member "CORSRule" xml) CORSRules.parse)) - } + Some { c_o_r_s_rules = (Util.of_option [] (CORSRules.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -6646,24 +6624,15 @@ module ListObjectVersionsOutput = next_version_id_marker = (Util.option_bind (Xml.member "NextVersionIdMarker" xml) String.parse); - versions = - (Util.of_option [] - (Util.option_bind (Xml.member "Version" xml) - ObjectVersionList.parse)); - delete_markers = - (Util.of_option [] - (Util.option_bind (Xml.member "DeleteMarker" xml) - DeleteMarkers.parse)); + versions = (Util.of_option [] (ObjectVersionList.parse xml)); + delete_markers = (Util.of_option [] (DeleteMarkers.parse xml)); name = (Util.option_bind (Xml.member "Name" xml) String.parse); prefix = (Util.option_bind (Xml.member "Prefix" xml) String.parse); delimiter = (Util.option_bind (Xml.member "Delimiter" xml) String.parse); max_keys = (Util.option_bind (Xml.member "MaxKeys" xml) Integer.parse); - common_prefixes = - (Util.of_option [] - (Util.option_bind (Xml.member "CommonPrefixes" xml) - CommonPrefixList.parse)); + common_prefixes = (Util.of_option [] (CommonPrefixList.parse xml)); encoding_type = (Util.option_bind (Xml.member "EncodingType" xml) EncodingType.parse) @@ -6907,16 +6876,11 @@ module DeleteObjectsOutput = let parse xml = Some { - deleted = - (Util.of_option [] - (Util.option_bind (Xml.member "Deleted" xml) - DeletedObjects.parse)); + deleted = (Util.of_option [] (DeletedObjects.parse xml)); request_charged = (Util.option_bind (Xml.member "x-amz-request-charged" xml) RequestCharged.parse); - errors = - (Util.of_option [] - (Util.option_bind (Xml.member "Error" xml) Errors.parse)) + errors = (Util.of_option [] (Errors.parse xml)) } let to_query v = Query.List @@ -8180,9 +8144,7 @@ module ListPartsOutput = (Util.option_bind (Xml.member "MaxParts" xml) Integer.parse); is_truncated = (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse); - parts = - (Util.of_option [] - (Util.option_bind (Xml.member "Part" xml) Parts.parse)); + parts = (Util.of_option [] (Parts.parse xml)); initiator = (Util.option_bind (Xml.member "Initiator" xml) Initiator.parse); owner = (Util.option_bind (Xml.member "Owner" xml) Owner.parse); @@ -8593,14 +8555,8 @@ module ListMultipartUploadsOutput = (Util.option_bind (Xml.member "MaxUploads" xml) Integer.parse); is_truncated = (Util.option_bind (Xml.member "IsTruncated" xml) Boolean.parse); - uploads = - (Util.of_option [] - (Util.option_bind (Xml.member "Upload" xml) - MultipartUploadList.parse)); - common_prefixes = - (Util.of_option [] - (Util.option_bind (Xml.member "CommonPrefixes" xml) - CommonPrefixList.parse)); + uploads = (Util.of_option [] (MultipartUploadList.parse xml)); + common_prefixes = (Util.of_option [] (CommonPrefixList.parse xml)); encoding_type = (Util.option_bind (Xml.member "EncodingType" xml) EncodingType.parse) diff --git a/libraries/s3/lib/uploadPart.ml b/libraries/s3/lib/uploadPart.ml index 04195d065..cd71f52ed 100644 --- a/libraries/s3/lib/uploadPart.ml +++ b/libraries/s3/lib/uploadPart.ml @@ -4,9 +4,11 @@ type input = UploadPartRequest.t type output = UploadPartOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["UploadPart"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/s3/lib/uploadPartCopy.ml b/libraries/s3/lib/uploadPartCopy.ml index 887cc4d04..1bb5ad2c9 100644 --- a/libraries/s3/lib/uploadPartCopy.ml +++ b/libraries/s3/lib/uploadPartCopy.ml @@ -4,9 +4,11 @@ type input = UploadPartCopyRequest.t type output = UploadPartCopyOutput.t type error = Errors_internal.t let service = "s3" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://s3.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2006-03-01"]); ("Action", ["UploadPartCopy"])] (Util.drop_empty diff --git a/libraries/s3/lib_test/aws_s3_test.ml b/libraries/s3/lib_test/aws_s3_test.ml index 69e5bf657..c2b6aab81 100644 --- a/libraries/s3/lib_test/aws_s3_test.ml +++ b/libraries/s3/lib_test/aws_s3_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop S3 test succeeds" - @?false + @?true let test_cases = [ "S3 noop" >:: noop_test ] diff --git a/libraries/sdb/lib/batchDeleteAttributes.ml b/libraries/sdb/lib/batchDeleteAttributes.ml index 6f629789b..d36cb1d75 100644 --- a/libraries/sdb/lib/batchDeleteAttributes.ml +++ b/libraries/sdb/lib/batchDeleteAttributes.ml @@ -4,9 +4,11 @@ type input = BatchDeleteAttributesRequest.t type output = unit type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["BatchDeleteAttributes"])] (Util.drop_empty diff --git a/libraries/sdb/lib/batchPutAttributes.ml b/libraries/sdb/lib/batchPutAttributes.ml index a241e4c0d..63242e8ff 100644 --- a/libraries/sdb/lib/batchPutAttributes.ml +++ b/libraries/sdb/lib/batchPutAttributes.ml @@ -4,9 +4,11 @@ type input = BatchPutAttributesRequest.t type output = unit type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["BatchPutAttributes"])] (Util.drop_empty diff --git a/libraries/sdb/lib/createDomain.ml b/libraries/sdb/lib/createDomain.ml index 87bcef788..74facbbf8 100644 --- a/libraries/sdb/lib/createDomain.ml +++ b/libraries/sdb/lib/createDomain.ml @@ -4,9 +4,11 @@ type input = CreateDomainRequest.t type output = unit type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["CreateDomain"])] (Util.drop_empty diff --git a/libraries/sdb/lib/deleteAttributes.ml b/libraries/sdb/lib/deleteAttributes.ml index 509eacda7..d69fe1f01 100644 --- a/libraries/sdb/lib/deleteAttributes.ml +++ b/libraries/sdb/lib/deleteAttributes.ml @@ -4,9 +4,11 @@ type input = DeleteAttributesRequest.t type output = unit type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["DeleteAttributes"])] (Util.drop_empty diff --git a/libraries/sdb/lib/deleteDomain.ml b/libraries/sdb/lib/deleteDomain.ml index 9f1cec6ed..2113d7795 100644 --- a/libraries/sdb/lib/deleteDomain.ml +++ b/libraries/sdb/lib/deleteDomain.ml @@ -4,9 +4,11 @@ type input = DeleteDomainRequest.t type output = unit type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["DeleteDomain"])] (Util.drop_empty diff --git a/libraries/sdb/lib/domainMetadata.ml b/libraries/sdb/lib/domainMetadata.ml index 60494267d..e169e9b6e 100644 --- a/libraries/sdb/lib/domainMetadata.ml +++ b/libraries/sdb/lib/domainMetadata.ml @@ -4,9 +4,11 @@ type input = DomainMetadataRequest.t type output = DomainMetadataResult.t type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["DomainMetadata"])] (Util.drop_empty diff --git a/libraries/sdb/lib/getAttributes.ml b/libraries/sdb/lib/getAttributes.ml index 6042243ad..7d55afe7e 100644 --- a/libraries/sdb/lib/getAttributes.ml +++ b/libraries/sdb/lib/getAttributes.ml @@ -4,9 +4,11 @@ type input = GetAttributesRequest.t type output = GetAttributesResult.t type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["GetAttributes"])] (Util.drop_empty diff --git a/libraries/sdb/lib/listDomains.ml b/libraries/sdb/lib/listDomains.ml index 5d65d3886..e5ea70c3a 100644 --- a/libraries/sdb/lib/listDomains.ml +++ b/libraries/sdb/lib/listDomains.ml @@ -4,9 +4,11 @@ type input = ListDomainsRequest.t type output = ListDomainsResult.t type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["ListDomains"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/sdb/lib/putAttributes.ml b/libraries/sdb/lib/putAttributes.ml index 9bd6200a8..921bf4ce9 100644 --- a/libraries/sdb/lib/putAttributes.ml +++ b/libraries/sdb/lib/putAttributes.ml @@ -4,9 +4,11 @@ type input = PutAttributesRequest.t type output = unit type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["PutAttributes"])] (Util.drop_empty diff --git a/libraries/sdb/lib/select.ml b/libraries/sdb/lib/select.ml index b4ceb6b10..e2291a3b4 100644 --- a/libraries/sdb/lib/select.ml +++ b/libraries/sdb/lib/select.ml @@ -4,9 +4,11 @@ type input = SelectRequest.t type output = SelectResult.t type error = Errors_internal.t let service = "sdb" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sdb.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2009-04-15"]); ("Action", ["Select"])] (Util.drop_empty (Uri.query_of_encoded (Query.render (SelectRequest.to_query req))))) in diff --git a/libraries/sdb/lib/types.ml b/libraries/sdb/lib/types.ml index 146cd3a74..cec2d0371 100644 --- a/libraries/sdb/lib/types.ml +++ b/libraries/sdb/lib/types.ml @@ -136,9 +136,7 @@ module ReplaceableItem = (Xml.required "ItemName" (Util.option_bind (Xml.member "ItemName" xml) String.parse)); attributes = - (Xml.required "Attributes" - (Util.option_bind (Xml.member "Attributes" xml) - ReplaceableAttributeList.parse)) + (Xml.required "Attributes" (ReplaceableAttributeList.parse xml)) } let to_query v = Query.List @@ -174,10 +172,7 @@ module DeletableItem = name = (Xml.required "ItemName" (Util.option_bind (Xml.member "ItemName" xml) String.parse)); - attributes = - (Util.of_option [] - (Util.option_bind (Xml.member "Attributes" xml) - AttributeList.parse)) + attributes = (Util.of_option [] (AttributeList.parse xml)) } let to_query v = Query.List @@ -217,10 +212,7 @@ module Item = alternate_name_encoding = (Util.option_bind (Xml.member "AlternateNameEncoding" xml) String.parse); - attributes = - (Xml.required "Attributes" - (Util.option_bind (Xml.member "Attributes" xml) - AttributeList.parse)) + attributes = (Xml.required "Attributes" (AttributeList.parse xml)) } let to_query v = Query.List @@ -359,10 +351,7 @@ module DeleteAttributesRequest = item_name = (Xml.required "ItemName" (Util.option_bind (Xml.member "ItemName" xml) String.parse)); - attributes = - (Util.of_option [] - (Util.option_bind (Xml.member "Attributes" xml) - AttributeList.parse)); + attributes = (Util.of_option [] (AttributeList.parse xml)); expected = (Util.option_bind (Xml.member "Expected" xml) UpdateCondition.parse) @@ -437,10 +426,7 @@ module BatchPutAttributesRequest = domain_name = (Xml.required "DomainName" (Util.option_bind (Xml.member "DomainName" xml) String.parse)); - items = - (Xml.required "Items" - (Util.option_bind (Xml.member "Items" xml) - ReplaceableItemList.parse)) + items = (Xml.required "Items" (ReplaceableItemList.parse xml)) } let to_query v = Query.List @@ -483,10 +469,7 @@ module GetAttributesRequest = item_name = (Xml.required "ItemName" (Util.option_bind (Xml.member "ItemName" xml) String.parse)); - attribute_names = - (Util.of_option [] - (Util.option_bind (Xml.member "AttributeNames" xml) - AttributeNameList.parse)); + attribute_names = (Util.of_option [] (AttributeNameList.parse xml)); consistent_read = (Util.option_bind (Xml.member "ConsistentRead" xml) Boolean.parse) } @@ -530,13 +513,7 @@ module GetAttributesResult = attributes: AttributeList.t } let make ?(attributes= []) () = { attributes } let parse xml = - Some - { - attributes = - (Util.of_option [] - (Util.option_bind (Xml.member "Attributes" xml) - AttributeList.parse)) - } + Some { attributes = (Util.of_option [] (AttributeList.parse xml)) } let to_query v = Query.List (Util.list_filter_opt @@ -574,9 +551,7 @@ module PutAttributesRequest = (Xml.required "ItemName" (Util.option_bind (Xml.member "ItemName" xml) String.parse)); attributes = - (Xml.required "Attributes" - (Util.option_bind (Xml.member "Attributes" xml) - ReplaceableAttributeList.parse)); + (Xml.required "Attributes" (ReplaceableAttributeList.parse xml)); expected = (Util.option_bind (Xml.member "Expected" xml) UpdateCondition.parse) @@ -734,10 +709,7 @@ module BatchDeleteAttributesRequest = domain_name = (Xml.required "DomainName" (Util.option_bind (Xml.member "DomainName" xml) String.parse)); - items = - (Xml.required "Items" - (Util.option_bind (Xml.member "Items" xml) - DeletableItemList.parse)) + items = (Xml.required "Items" (DeletableItemList.parse xml)) } let to_query v = Query.List @@ -849,9 +821,7 @@ module SelectResult = let parse xml = Some { - items = - (Util.of_option [] - (Util.option_bind (Xml.member "Items" xml) ItemList.parse)); + items = (Util.of_option [] (ItemList.parse xml)); next_token = (Util.option_bind (Xml.member "NextToken" xml) String.parse) } @@ -1244,10 +1214,7 @@ module ListDomainsResult = let parse xml = Some { - domain_names = - (Util.of_option [] - (Util.option_bind (Xml.member "DomainNames" xml) - DomainNameList.parse)); + domain_names = (Util.of_option [] (DomainNameList.parse xml)); next_token = (Util.option_bind (Xml.member "NextToken" xml) String.parse) } diff --git a/libraries/sdb/lib_test/aws_sdb_test.ml b/libraries/sdb/lib_test/aws_sdb_test.ml index 51b46bc9f..1e1e203e7 100644 --- a/libraries/sdb/lib_test/aws_sdb_test.ml +++ b/libraries/sdb/lib_test/aws_sdb_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop SDB test succeeds" - @?false + @?true let test_cases = [ "SDB noop" >:: noop_test ] diff --git a/libraries/sqs/lib/addPermission.ml b/libraries/sqs/lib/addPermission.ml new file mode 100644 index 000000000..c57b7ef5b --- /dev/null +++ b/libraries/sqs/lib/addPermission.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = AddPermissionRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["AddPermission"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (AddPermissionRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [Errors_internal.OverLimit] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/addPermission.mli b/libraries/sqs/lib/addPermission.mli new file mode 100644 index 000000000..0fff20fd1 --- /dev/null +++ b/libraries/sqs/lib/addPermission.mli @@ -0,0 +1,7 @@ +open Types +type input = AddPermissionRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibility.ml b/libraries/sqs/lib/changeMessageVisibility.ml new file mode 100644 index 000000000..ea3205e36 --- /dev/null +++ b/libraries/sqs/lib/changeMessageVisibility.ml @@ -0,0 +1,33 @@ +open Types +open Aws +type input = ChangeMessageVisibilityRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); + ("Action", ["ChangeMessageVisibility"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ChangeMessageVisibilityRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_MessageNotInflight] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibility.mli b/libraries/sqs/lib/changeMessageVisibility.mli new file mode 100644 index 000000000..2a343bfbf --- /dev/null +++ b/libraries/sqs/lib/changeMessageVisibility.mli @@ -0,0 +1,7 @@ +open Types +type input = ChangeMessageVisibilityRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibilityBatch.ml b/libraries/sqs/lib/changeMessageVisibilityBatch.ml new file mode 100644 index 000000000..70820c374 --- /dev/null +++ b/libraries/sqs/lib/changeMessageVisibilityBatch.ml @@ -0,0 +1,69 @@ +open Types +open Aws +type input = ChangeMessageVisibilityBatchRequest.t +type output = ChangeMessageVisibilityBatchResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); + ("Action", ["ChangeMessageVisibilityBatch"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render + (ChangeMessageVisibilityBatchRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind + (Xml.member "ChangeMessageVisibilityBatchResponse" (snd xml)) + (Xml.member "ChangeMessageVisibilityBatchResult") in + try + Util.or_error + (Util.option_bind resp ChangeMessageVisibilityBatchResult.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed ChangeMessageVisibilityBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ChangeMessageVisibilityBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId; + Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct; + Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest; + Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/changeMessageVisibilityBatch.mli b/libraries/sqs/lib/changeMessageVisibilityBatch.mli new file mode 100644 index 000000000..8a84aea7f --- /dev/null +++ b/libraries/sqs/lib/changeMessageVisibilityBatch.mli @@ -0,0 +1,7 @@ +open Types +type input = ChangeMessageVisibilityBatchRequest.t +type output = ChangeMessageVisibilityBatchResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/createQueue.ml b/libraries/sqs/lib/createQueue.ml new file mode 100644 index 000000000..d0c2d117e --- /dev/null +++ b/libraries/sqs/lib/createQueue.ml @@ -0,0 +1,61 @@ +open Types +open Aws +type input = CreateQueueRequest.t +type output = CreateQueueResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["CreateQueue"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (CreateQueueRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "CreateQueueResponse" (snd xml)) + (Xml.member "CreateQueueResult") in + try + Util.or_error (Util.option_bind resp CreateQueueResult.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed CreateQueueResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing CreateQueueResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.QueueAlreadyExists; + Errors_internal.AWS_SimpleQueueService_QueueDeletedRecently] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/createQueue.mli b/libraries/sqs/lib/createQueue.mli new file mode 100644 index 000000000..52a270fa8 --- /dev/null +++ b/libraries/sqs/lib/createQueue.mli @@ -0,0 +1,7 @@ +open Types +type input = CreateQueueRequest.t +type output = CreateQueueResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessage.ml b/libraries/sqs/lib/deleteMessage.ml new file mode 100644 index 000000000..966bf79bc --- /dev/null +++ b/libraries/sqs/lib/deleteMessage.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = DeleteMessageRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["DeleteMessage"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DeleteMessageRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessage.mli b/libraries/sqs/lib/deleteMessage.mli new file mode 100644 index 000000000..acc110c36 --- /dev/null +++ b/libraries/sqs/lib/deleteMessage.mli @@ -0,0 +1,7 @@ +open Types +type input = DeleteMessageRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessageBatch.ml b/libraries/sqs/lib/deleteMessageBatch.ml new file mode 100644 index 000000000..eeceee11c --- /dev/null +++ b/libraries/sqs/lib/deleteMessageBatch.ml @@ -0,0 +1,65 @@ +open Types +open Aws +type input = DeleteMessageBatchRequest.t +type output = DeleteMessageBatchResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["DeleteMessageBatch"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DeleteMessageBatchRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "DeleteMessageBatchResponse" (snd xml)) + (Xml.member "DeleteMessageBatchResult") in + try + Util.or_error (Util.option_bind resp DeleteMessageBatchResult.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed DeleteMessageBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing DeleteMessageBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId; + Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct; + Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest; + Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/deleteMessageBatch.mli b/libraries/sqs/lib/deleteMessageBatch.mli new file mode 100644 index 000000000..4e08764db --- /dev/null +++ b/libraries/sqs/lib/deleteMessageBatch.mli @@ -0,0 +1,7 @@ +open Types +type input = DeleteMessageBatchRequest.t +type output = DeleteMessageBatchResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/deleteQueue.ml b/libraries/sqs/lib/deleteQueue.ml new file mode 100644 index 000000000..a19550d8e --- /dev/null +++ b/libraries/sqs/lib/deleteQueue.ml @@ -0,0 +1,29 @@ +open Types +open Aws +type input = DeleteQueueRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["DeleteQueue"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (DeleteQueueRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/deleteQueue.mli b/libraries/sqs/lib/deleteQueue.mli new file mode 100644 index 000000000..87cc019fd --- /dev/null +++ b/libraries/sqs/lib/deleteQueue.mli @@ -0,0 +1,7 @@ +open Types +type input = DeleteQueueRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/dune b/libraries/sqs/lib/dune new file mode 100644 index 000000000..55f250acc --- /dev/null +++ b/libraries/sqs/lib/dune @@ -0,0 +1,6 @@ +(library + (name aws_sqs) + (public_name aws_sqs) + (synopsis "aws-Amazon Simple Queue Service") + (flags (:standard -w -27)) + (libraries aws)) diff --git a/libraries/sqs/lib/errors_internal.ml b/libraries/sqs/lib/errors_internal.ml new file mode 100644 index 000000000..b708166f1 --- /dev/null +++ b/libraries/sqs/lib/errors_internal.ml @@ -0,0 +1,227 @@ +type t = + | AWS_SimpleQueueService_BatchEntryIdsNotDistinct + | AWS_SimpleQueueService_BatchRequestTooLong + | AWS_SimpleQueueService_EmptyBatchRequest + | AWS_SimpleQueueService_InvalidBatchEntryId + | AWS_SimpleQueueService_MessageNotInflight + | AWS_SimpleQueueService_NonExistentQueue + | AWS_SimpleQueueService_PurgeQueueInProgress + | AWS_SimpleQueueService_QueueDeletedRecently + | AWS_SimpleQueueService_TooManyEntriesInBatchRequest + | AWS_SimpleQueueService_UnsupportedOperation + | AuthFailure + | Blocked + | DryRunOperation + | IdempotentParameterMismatch + | IncompleteSignature + | InternalFailure + | InvalidAction + | InvalidAttributeName + | InvalidClientTokenId + | InvalidIdFormat + | InvalidMessageContents + | InvalidParameter + | InvalidParameterCombination + | InvalidParameterValue + | InvalidQueryParameter + | MalformedQueryString + | MissingAction + | MissingAuthenticationToken + | MissingParameter + | OptInRequired + | OverLimit + | PendingVerification + | QueueAlreadyExists + | ReceiptHandleIsInvalid + | RequestExpired + | RequestLimitExceeded + | ServiceUnavailable + | Throttling + | UnauthorizedOperation + | UnknownParameter + | UnsupportedProtocol + | ValidationError + | Uninhabited +let common = + [UnsupportedProtocol; + UnknownParameter; + UnauthorizedOperation; + RequestLimitExceeded; + PendingVerification; + InvalidParameter; + IdempotentParameterMismatch; + DryRunOperation; + Blocked; + AuthFailure; + ValidationError; + Throttling; + ServiceUnavailable; + RequestExpired; + OptInRequired; + MissingParameter; + MissingAuthenticationToken; + MissingAction; + MalformedQueryString; + InvalidQueryParameter; + InvalidParameterValue; + InvalidParameterCombination; + InvalidClientTokenId; + InvalidAction; + InternalFailure; + IncompleteSignature] +let to_http_code e = + match e with + | AWS_SimpleQueueService_BatchEntryIdsNotDistinct -> Some 400 + | AWS_SimpleQueueService_BatchRequestTooLong -> Some 400 + | AWS_SimpleQueueService_EmptyBatchRequest -> Some 400 + | AWS_SimpleQueueService_InvalidBatchEntryId -> Some 400 + | AWS_SimpleQueueService_MessageNotInflight -> Some 400 + | AWS_SimpleQueueService_NonExistentQueue -> Some 400 + | AWS_SimpleQueueService_PurgeQueueInProgress -> Some 403 + | AWS_SimpleQueueService_QueueDeletedRecently -> Some 400 + | AWS_SimpleQueueService_TooManyEntriesInBatchRequest -> Some 400 + | AWS_SimpleQueueService_UnsupportedOperation -> Some 400 + | AuthFailure -> None + | Blocked -> None + | DryRunOperation -> None + | IdempotentParameterMismatch -> None + | IncompleteSignature -> Some 400 + | InternalFailure -> Some 500 + | InvalidAction -> Some 400 + | InvalidAttributeName -> None + | InvalidClientTokenId -> Some 403 + | InvalidIdFormat -> None + | InvalidMessageContents -> None + | InvalidParameter -> None + | InvalidParameterCombination -> Some 400 + | InvalidParameterValue -> Some 400 + | InvalidQueryParameter -> Some 400 + | MalformedQueryString -> Some 404 + | MissingAction -> Some 400 + | MissingAuthenticationToken -> Some 403 + | MissingParameter -> Some 400 + | OptInRequired -> Some 403 + | OverLimit -> Some 403 + | PendingVerification -> None + | QueueAlreadyExists -> Some 400 + | ReceiptHandleIsInvalid -> None + | RequestExpired -> Some 400 + | RequestLimitExceeded -> None + | ServiceUnavailable -> Some 503 + | Throttling -> Some 400 + | UnauthorizedOperation -> None + | UnknownParameter -> None + | UnsupportedProtocol -> None + | ValidationError -> Some 400 + | Uninhabited -> None +let to_string e = + match e with + | AWS_SimpleQueueService_BatchEntryIdsNotDistinct -> + "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" + | AWS_SimpleQueueService_BatchRequestTooLong -> + "AWS.SimpleQueueService.BatchRequestTooLong" + | AWS_SimpleQueueService_EmptyBatchRequest -> + "AWS.SimpleQueueService.EmptyBatchRequest" + | AWS_SimpleQueueService_InvalidBatchEntryId -> + "AWS.SimpleQueueService.InvalidBatchEntryId" + | AWS_SimpleQueueService_MessageNotInflight -> + "AWS.SimpleQueueService.MessageNotInflight" + | AWS_SimpleQueueService_NonExistentQueue -> + "AWS.SimpleQueueService.NonExistentQueue" + | AWS_SimpleQueueService_PurgeQueueInProgress -> + "AWS.SimpleQueueService.PurgeQueueInProgress" + | AWS_SimpleQueueService_QueueDeletedRecently -> + "AWS.SimpleQueueService.QueueDeletedRecently" + | AWS_SimpleQueueService_TooManyEntriesInBatchRequest -> + "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" + | AWS_SimpleQueueService_UnsupportedOperation -> + "AWS.SimpleQueueService.UnsupportedOperation" + | AuthFailure -> "AuthFailure" + | Blocked -> "Blocked" + | DryRunOperation -> "DryRunOperation" + | IdempotentParameterMismatch -> "IdempotentParameterMismatch" + | IncompleteSignature -> "IncompleteSignature" + | InternalFailure -> "InternalFailure" + | InvalidAction -> "InvalidAction" + | InvalidAttributeName -> "InvalidAttributeName" + | InvalidClientTokenId -> "InvalidClientTokenId" + | InvalidIdFormat -> "InvalidIdFormat" + | InvalidMessageContents -> "InvalidMessageContents" + | InvalidParameter -> "InvalidParameter" + | InvalidParameterCombination -> "InvalidParameterCombination" + | InvalidParameterValue -> "InvalidParameterValue" + | InvalidQueryParameter -> "InvalidQueryParameter" + | MalformedQueryString -> "MalformedQueryString" + | MissingAction -> "MissingAction" + | MissingAuthenticationToken -> "MissingAuthenticationToken" + | MissingParameter -> "MissingParameter" + | OptInRequired -> "OptInRequired" + | OverLimit -> "OverLimit" + | PendingVerification -> "PendingVerification" + | QueueAlreadyExists -> "QueueAlreadyExists" + | ReceiptHandleIsInvalid -> "ReceiptHandleIsInvalid" + | RequestExpired -> "RequestExpired" + | RequestLimitExceeded -> "RequestLimitExceeded" + | ServiceUnavailable -> "ServiceUnavailable" + | Throttling -> "Throttling" + | UnauthorizedOperation -> "UnauthorizedOperation" + | UnknownParameter -> "UnknownParameter" + | UnsupportedProtocol -> "UnsupportedProtocol" + | ValidationError -> "ValidationError" + | Uninhabited -> "Uninhabited" +let of_string e = + match e with + | "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" -> + Some AWS_SimpleQueueService_BatchEntryIdsNotDistinct + | "AWS.SimpleQueueService.BatchRequestTooLong" -> + Some AWS_SimpleQueueService_BatchRequestTooLong + | "AWS.SimpleQueueService.EmptyBatchRequest" -> + Some AWS_SimpleQueueService_EmptyBatchRequest + | "AWS.SimpleQueueService.InvalidBatchEntryId" -> + Some AWS_SimpleQueueService_InvalidBatchEntryId + | "AWS.SimpleQueueService.MessageNotInflight" -> + Some AWS_SimpleQueueService_MessageNotInflight + | "AWS.SimpleQueueService.NonExistentQueue" -> + Some AWS_SimpleQueueService_NonExistentQueue + | "AWS.SimpleQueueService.PurgeQueueInProgress" -> + Some AWS_SimpleQueueService_PurgeQueueInProgress + | "AWS.SimpleQueueService.QueueDeletedRecently" -> + Some AWS_SimpleQueueService_QueueDeletedRecently + | "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" -> + Some AWS_SimpleQueueService_TooManyEntriesInBatchRequest + | "AWS.SimpleQueueService.UnsupportedOperation" -> + Some AWS_SimpleQueueService_UnsupportedOperation + | "AuthFailure" -> Some AuthFailure + | "Blocked" -> Some Blocked + | "DryRunOperation" -> Some DryRunOperation + | "IdempotentParameterMismatch" -> Some IdempotentParameterMismatch + | "IncompleteSignature" -> Some IncompleteSignature + | "InternalFailure" -> Some InternalFailure + | "InvalidAction" -> Some InvalidAction + | "InvalidAttributeName" -> Some InvalidAttributeName + | "InvalidClientTokenId" -> Some InvalidClientTokenId + | "InvalidIdFormat" -> Some InvalidIdFormat + | "InvalidMessageContents" -> Some InvalidMessageContents + | "InvalidParameter" -> Some InvalidParameter + | "InvalidParameterCombination" -> Some InvalidParameterCombination + | "InvalidParameterValue" -> Some InvalidParameterValue + | "InvalidQueryParameter" -> Some InvalidQueryParameter + | "MalformedQueryString" -> Some MalformedQueryString + | "MissingAction" -> Some MissingAction + | "MissingAuthenticationToken" -> Some MissingAuthenticationToken + | "MissingParameter" -> Some MissingParameter + | "OptInRequired" -> Some OptInRequired + | "OverLimit" -> Some OverLimit + | "PendingVerification" -> Some PendingVerification + | "QueueAlreadyExists" -> Some QueueAlreadyExists + | "ReceiptHandleIsInvalid" -> Some ReceiptHandleIsInvalid + | "RequestExpired" -> Some RequestExpired + | "RequestLimitExceeded" -> Some RequestLimitExceeded + | "ServiceUnavailable" -> Some ServiceUnavailable + | "Throttling" -> Some Throttling + | "UnauthorizedOperation" -> Some UnauthorizedOperation + | "UnknownParameter" -> Some UnknownParameter + | "UnsupportedProtocol" -> Some UnsupportedProtocol + | "ValidationError" -> Some ValidationError + | "Uninhabited" -> Some Uninhabited + | _ -> None \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueAttributes.ml b/libraries/sqs/lib/getQueueAttributes.ml new file mode 100644 index 000000000..ccd01be40 --- /dev/null +++ b/libraries/sqs/lib/getQueueAttributes.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = GetQueueAttributesRequest.t +type output = GetQueueAttributesResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["GetQueueAttributes"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (GetQueueAttributesRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "GetQueueAttributesResponse" (snd xml)) + (Xml.member "GetQueueAttributesResult") in + try + Util.or_error (Util.option_bind resp GetQueueAttributesResult.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed GetQueueAttributesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetQueueAttributesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = [] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueAttributes.mli b/libraries/sqs/lib/getQueueAttributes.mli new file mode 100644 index 000000000..aa1c76d7c --- /dev/null +++ b/libraries/sqs/lib/getQueueAttributes.mli @@ -0,0 +1,7 @@ +open Types +type input = GetQueueAttributesRequest.t +type output = GetQueueAttributesResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueUrl.ml b/libraries/sqs/lib/getQueueUrl.ml new file mode 100644 index 000000000..84441c6a3 --- /dev/null +++ b/libraries/sqs/lib/getQueueUrl.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = GetQueueUrlRequest.t +type output = GetQueueUrlResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["GetQueueUrl"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (GetQueueUrlRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "GetQueueUrlResponse" (snd xml)) + (Xml.member "GetQueueUrlResult") in + try + Util.or_error (Util.option_bind resp GetQueueUrlResult.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed GetQueueUrlResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing GetQueueUrlResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_NonExistentQueue] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/getQueueUrl.mli b/libraries/sqs/lib/getQueueUrl.mli new file mode 100644 index 000000000..4ddc24204 --- /dev/null +++ b/libraries/sqs/lib/getQueueUrl.mli @@ -0,0 +1,7 @@ +open Types +type input = GetQueueUrlRequest.t +type output = GetQueueUrlResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/listDeadLetterSourceQueues.ml b/libraries/sqs/lib/listDeadLetterSourceQueues.ml new file mode 100644 index 000000000..d3b130264 --- /dev/null +++ b/libraries/sqs/lib/listDeadLetterSourceQueues.ml @@ -0,0 +1,65 @@ +open Types +open Aws +type input = ListDeadLetterSourceQueuesRequest.t +type output = ListDeadLetterSourceQueuesResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); + ("Action", ["ListDeadLetterSourceQueues"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListDeadLetterSourceQueuesRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind + (Xml.member "ListDeadLetterSourceQueuesResponse" (snd xml)) + (Xml.member "ListDeadLetterSourceQueuesResult") in + try + Util.or_error + (Util.option_bind resp ListDeadLetterSourceQueuesResult.parse) + (let open Error in + BadResponse + { + body; + message = + "Could not find well formed ListDeadLetterSourceQueuesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListDeadLetterSourceQueuesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_NonExistentQueue] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/listDeadLetterSourceQueues.mli b/libraries/sqs/lib/listDeadLetterSourceQueues.mli new file mode 100644 index 000000000..3e365b9b1 --- /dev/null +++ b/libraries/sqs/lib/listDeadLetterSourceQueues.mli @@ -0,0 +1,7 @@ +open Types +type input = ListDeadLetterSourceQueuesRequest.t +type output = ListDeadLetterSourceQueuesResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/listQueues.ml b/libraries/sqs/lib/listQueues.ml new file mode 100644 index 000000000..306d233e8 --- /dev/null +++ b/libraries/sqs/lib/listQueues.ml @@ -0,0 +1,56 @@ +open Types +open Aws +type input = ListQueuesRequest.t +type output = ListQueuesResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["ListQueues"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ListQueuesRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "ListQueuesResponse" (snd xml)) + (Xml.member "ListQueuesResult") in + try + Util.or_error (Util.option_bind resp ListQueuesResult.parse) + (let open Error in + BadResponse + { body; message = "Could not find well formed ListQueuesResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ListQueuesResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = [] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/listQueues.mli b/libraries/sqs/lib/listQueues.mli new file mode 100644 index 000000000..1762b8eb0 --- /dev/null +++ b/libraries/sqs/lib/listQueues.mli @@ -0,0 +1,7 @@ +open Types +type input = ListQueuesRequest.t +type output = ListQueuesResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/purgeQueue.ml b/libraries/sqs/lib/purgeQueue.ml new file mode 100644 index 000000000..88af9e94a --- /dev/null +++ b/libraries/sqs/lib/purgeQueue.ml @@ -0,0 +1,32 @@ +open Types +open Aws +type input = PurgeQueueRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["PurgeQueue"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (PurgeQueueRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_PurgeQueueInProgress; + Errors_internal.AWS_SimpleQueueService_NonExistentQueue] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/purgeQueue.mli b/libraries/sqs/lib/purgeQueue.mli new file mode 100644 index 000000000..c6c497c99 --- /dev/null +++ b/libraries/sqs/lib/purgeQueue.mli @@ -0,0 +1,7 @@ +open Types +type input = PurgeQueueRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/receiveMessage.ml b/libraries/sqs/lib/receiveMessage.ml new file mode 100644 index 000000000..23bdb5370 --- /dev/null +++ b/libraries/sqs/lib/receiveMessage.ml @@ -0,0 +1,59 @@ +open Types +open Aws +type input = ReceiveMessageRequest.t +type output = ReceiveMessageResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["ReceiveMessage"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (ReceiveMessageRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "ReceiveMessageResponse" (snd xml)) + (Xml.member "ReceiveMessageResult") in + try + Util.or_error (Util.option_bind resp ReceiveMessageResult.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed ReceiveMessageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing ReceiveMessageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = [Errors_internal.OverLimit] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/receiveMessage.mli b/libraries/sqs/lib/receiveMessage.mli new file mode 100644 index 000000000..a4a2e442c --- /dev/null +++ b/libraries/sqs/lib/receiveMessage.mli @@ -0,0 +1,7 @@ +open Types +type input = ReceiveMessageRequest.t +type output = ReceiveMessageResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/removePermission.ml b/libraries/sqs/lib/removePermission.ml new file mode 100644 index 000000000..e5ad20977 --- /dev/null +++ b/libraries/sqs/lib/removePermission.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = RemovePermissionRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["RemovePermission"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (RemovePermissionRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/removePermission.mli b/libraries/sqs/lib/removePermission.mli new file mode 100644 index 000000000..a99b52a79 --- /dev/null +++ b/libraries/sqs/lib/removePermission.mli @@ -0,0 +1,7 @@ +open Types +type input = RemovePermissionRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessage.ml b/libraries/sqs/lib/sendMessage.ml new file mode 100644 index 000000000..07eb83f79 --- /dev/null +++ b/libraries/sqs/lib/sendMessage.ml @@ -0,0 +1,60 @@ +open Types +open Aws +type input = SendMessageRequest.t +type output = SendMessageResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append [("Version", ["2012-11-05"]); ("Action", ["SendMessage"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (SendMessageRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "SendMessageResponse" (snd xml)) + (Xml.member "SendMessageResult") in + try + Util.or_error (Util.option_bind resp SendMessageResult.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed SendMessageResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing SendMessageResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_UnsupportedOperation] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessage.mli b/libraries/sqs/lib/sendMessage.mli new file mode 100644 index 000000000..529cbf77e --- /dev/null +++ b/libraries/sqs/lib/sendMessage.mli @@ -0,0 +1,7 @@ +open Types +type input = SendMessageRequest.t +type output = SendMessageResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessageBatch.ml b/libraries/sqs/lib/sendMessageBatch.ml new file mode 100644 index 000000000..aa6e97e31 --- /dev/null +++ b/libraries/sqs/lib/sendMessageBatch.ml @@ -0,0 +1,66 @@ +open Types +open Aws +type input = SendMessageBatchRequest.t +type output = SendMessageBatchResult.t +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["SendMessageBatch"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (SendMessageBatchRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = + try + let xml = Ezxmlm.from_string body in + let resp = + Util.option_bind (Xml.member "SendMessageBatchResponse" (snd xml)) + (Xml.member "SendMessageBatchResult") in + try + Util.or_error (Util.option_bind resp SendMessageBatchResult.parse) + (let open Error in + BadResponse + { + body; + message = "Could not find well formed SendMessageBatchResult." + }) + with + | Xml.RequiredFieldMissing msg -> + let open Error in + `Error + (BadResponse + { + body; + message = + ("Error parsing SendMessageBatchResult - missing field in body or children: " + ^ msg) + }) + with + | Failure msg -> + `Error + (let open Error in + BadResponse { body; message = ("Error parsing xml: " ^ msg) }) +let parse_error code err = + let errors = + [Errors_internal.AWS_SimpleQueueService_UnsupportedOperation; + Errors_internal.AWS_SimpleQueueService_InvalidBatchEntryId; + Errors_internal.AWS_SimpleQueueService_BatchRequestTooLong; + Errors_internal.AWS_SimpleQueueService_BatchEntryIdsNotDistinct; + Errors_internal.AWS_SimpleQueueService_EmptyBatchRequest; + Errors_internal.AWS_SimpleQueueService_TooManyEntriesInBatchRequest] @ + Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/sendMessageBatch.mli b/libraries/sqs/lib/sendMessageBatch.mli new file mode 100644 index 000000000..1f946eb7c --- /dev/null +++ b/libraries/sqs/lib/sendMessageBatch.mli @@ -0,0 +1,7 @@ +open Types +type input = SendMessageBatchRequest.t +type output = SendMessageBatchResult.t +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/setQueueAttributes.ml b/libraries/sqs/lib/setQueueAttributes.ml new file mode 100644 index 000000000..5a8c3875f --- /dev/null +++ b/libraries/sqs/lib/setQueueAttributes.ml @@ -0,0 +1,30 @@ +open Types +open Aws +type input = SetQueueAttributesRequest.t +type output = unit +type error = Errors_internal.t +let service = "sqs" +let to_http service region req = + let uri = + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) + (List.append + [("Version", ["2012-11-05"]); ("Action", ["SetQueueAttributes"])] + (Util.drop_empty + (Uri.query_of_encoded + (Query.render (SetQueueAttributesRequest.to_query req))))) in + (`POST, uri, []) +let of_http body = `Ok () +let parse_error code err = + let errors = [] @ Errors_internal.common in + match Errors_internal.of_string err with + | Some var -> + if + (List.mem var errors) && + ((match Errors_internal.to_http_code var with + | Some var -> var = code + | None -> true)) + then Some var + else None + | None -> None \ No newline at end of file diff --git a/libraries/sqs/lib/setQueueAttributes.mli b/libraries/sqs/lib/setQueueAttributes.mli new file mode 100644 index 000000000..ff9fceae0 --- /dev/null +++ b/libraries/sqs/lib/setQueueAttributes.mli @@ -0,0 +1,7 @@ +open Types +type input = SetQueueAttributesRequest.t +type output = unit +type error = Errors_internal.t +include + (Aws.Call with type input := input and type output := output and type + error := error) \ No newline at end of file diff --git a/libraries/sqs/lib/types.ml b/libraries/sqs/lib/types.ml new file mode 100644 index 000000000..569d238d9 --- /dev/null +++ b/libraries/sqs/lib/types.ml @@ -0,0 +1,1968 @@ +open Aws +open Aws.BaseTypes +open CalendarLib +type calendar = Calendar.t +module BinaryList = + struct + type t = Blob.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map Blob.parse (Xml.members "BinaryListValue" xml)) + let to_query v = Query.to_query_list Blob.to_query v + let to_json v = `List (List.map Blob.to_json v) + let of_json j = Json.to_list Blob.of_json j + end +module StringList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "StringListValue" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module MessageAttributeValue = + struct + type t = + { + string_value: String.t option ; + binary_value: Blob.t option ; + string_list_values: StringList.t ; + binary_list_values: BinaryList.t ; + data_type: String.t } + let make ?string_value ?binary_value ?(string_list_values= []) + ?(binary_list_values= []) ~data_type () = + { + string_value; + binary_value; + string_list_values; + binary_list_values; + data_type + } + let parse xml = + Some + { + string_value = + (Util.option_bind (Xml.member "StringValue" xml) String.parse); + binary_value = + (Util.option_bind (Xml.member "BinaryValue" xml) Blob.parse); + string_list_values = + (Util.of_option [] + (Util.option_bind (Xml.member "StringListValue" xml) + StringList.parse)); + binary_list_values = + (Util.of_option [] + (Util.option_bind (Xml.member "BinaryListValue" xml) + BinaryList.parse)); + data_type = + (Xml.required "DataType" + (Util.option_bind (Xml.member "DataType" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("DataType", (String.to_query v.data_type))); + Some + (Query.Pair + ("BinaryListValue", + (BinaryList.to_query v.binary_list_values))); + Some + (Query.Pair + ("StringListValue", + (StringList.to_query v.string_list_values))); + Util.option_map v.binary_value + (fun f -> Query.Pair ("BinaryValue", (Blob.to_query f))); + Util.option_map v.string_value + (fun f -> Query.Pair ("StringValue", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("data_type", (String.to_json v.data_type)); + Some + ("binary_list_values", + (BinaryList.to_json v.binary_list_values)); + Some + ("string_list_values", + (StringList.to_json v.string_list_values)); + Util.option_map v.binary_value + (fun f -> ("binary_value", (Blob.to_json f))); + Util.option_map v.string_value + (fun f -> ("string_value", (String.to_json f)))]) + let of_json j = + { + string_value = + (Util.option_map (Json.lookup j "string_value") String.of_json); + binary_value = + (Util.option_map (Json.lookup j "binary_value") Blob.of_json); + string_list_values = + (StringList.of_json + (Util.of_option_exn (Json.lookup j "string_list_values"))); + binary_list_values = + (BinaryList.of_json + (Util.of_option_exn (Json.lookup j "binary_list_values"))); + data_type = + (String.of_json (Util.of_option_exn (Json.lookup j "data_type"))) + } + end +module QueueAttributeName = + struct + type t = + | Policy + | VisibilityTimeout + | MaximumMessageSize + | MessageRetentionPeriod + | ApproximateNumberOfMessages + | ApproximateNumberOfMessagesNotVisible + | CreatedTimestamp + | LastModifiedTimestamp + | QueueArn + | ApproximateNumberOfMessagesDelayed + | DelaySeconds + | ReceiveMessageWaitTimeSeconds + | RedrivePolicy + let str_to_t = + [("RedrivePolicy", RedrivePolicy); + ("ReceiveMessageWaitTimeSeconds", ReceiveMessageWaitTimeSeconds); + ("DelaySeconds", DelaySeconds); + ("ApproximateNumberOfMessagesDelayed", + ApproximateNumberOfMessagesDelayed); + ("QueueArn", QueueArn); + ("LastModifiedTimestamp", LastModifiedTimestamp); + ("CreatedTimestamp", CreatedTimestamp); + ("ApproximateNumberOfMessagesNotVisible", + ApproximateNumberOfMessagesNotVisible); + ("ApproximateNumberOfMessages", ApproximateNumberOfMessages); + ("MessageRetentionPeriod", MessageRetentionPeriod); + ("MaximumMessageSize", MaximumMessageSize); + ("VisibilityTimeout", VisibilityTimeout); + ("Policy", Policy)] + let t_to_str = + [(RedrivePolicy, "RedrivePolicy"); + (ReceiveMessageWaitTimeSeconds, "ReceiveMessageWaitTimeSeconds"); + (DelaySeconds, "DelaySeconds"); + (ApproximateNumberOfMessagesDelayed, + "ApproximateNumberOfMessagesDelayed"); + (QueueArn, "QueueArn"); + (LastModifiedTimestamp, "LastModifiedTimestamp"); + (CreatedTimestamp, "CreatedTimestamp"); + (ApproximateNumberOfMessagesNotVisible, + "ApproximateNumberOfMessagesNotVisible"); + (ApproximateNumberOfMessages, "ApproximateNumberOfMessages"); + (MessageRetentionPeriod, "MessageRetentionPeriod"); + (MaximumMessageSize, "MaximumMessageSize"); + (VisibilityTimeout, "VisibilityTimeout"); + (Policy, "Policy")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) + let make v () = v + let parse xml = + Util.option_bind (String.parse xml) + (fun s -> Util.list_find str_to_t s) + let to_query v = + Query.Value (Some (Util.of_option_exn (Util.list_find t_to_str v))) + let to_json v = + String.to_json (Util.of_option_exn (Util.list_find t_to_str v)) + let of_json j = + Util.of_option_exn (Util.list_find str_to_t (String.of_json j)) + end +module MessageAttributeMap = + struct + type t = (String.t, MessageAttributeValue.t) Hashtbl.t + let make elems () = elems + let parse xml = None + let to_query v = + Query.to_query_hashtbl String.to_string MessageAttributeValue.to_query + v + let to_json v = + `Assoc + (Hashtbl.fold + (fun k -> + fun v -> + fun acc -> + ((String.to_string k), (MessageAttributeValue.to_json v)) + :: acc) v []) + let of_json j = + Json.to_hashtbl String.of_string MessageAttributeValue.of_json j + end +module AttributeMap = + struct + type t = (QueueAttributeName.t, String.t) Hashtbl.t + let make elems () = elems + let parse xml = None + let to_query v = + Query.to_query_hashtbl QueueAttributeName.to_string String.to_query v + let to_json v = + `Assoc + (Hashtbl.fold + (fun k -> + fun v -> + fun acc -> + ((QueueAttributeName.to_string k), (String.to_json v)) :: + acc) v []) + let of_json j = + Json.to_hashtbl QueueAttributeName.of_string String.of_json j + end +module ChangeMessageVisibilityBatchRequestEntry = + struct + type t = + { + id: String.t ; + receipt_handle: String.t ; + visibility_timeout: Integer.t option } + let make ~id ~receipt_handle ?visibility_timeout () = + { id; receipt_handle; visibility_timeout } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)); + visibility_timeout = + (Util.option_bind (Xml.member "VisibilityTimeout" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.visibility_timeout + (fun f -> + Query.Pair ("VisibilityTimeout", (Integer.to_query f))); + Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.visibility_timeout + (fun f -> ("visibility_timeout", (Integer.to_json f))); + Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))); + visibility_timeout = + (Util.option_map (Json.lookup j "visibility_timeout") + Integer.of_json) + } + end +module SendMessageBatchRequestEntry = + struct + type t = + { + id: String.t ; + message_body: String.t ; + delay_seconds: Integer.t option ; + message_attributes: MessageAttributeMap.t option } + let make ~id ~message_body ?delay_seconds ?message_attributes () = + { id; message_body; delay_seconds; message_attributes } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + message_body = + (Xml.required "MessageBody" + (Util.option_bind (Xml.member "MessageBody" xml) String.parse)); + delay_seconds = + (Util.option_bind (Xml.member "DelaySeconds" xml) Integer.parse); + message_attributes = + (Util.option_bind (Xml.member "MessageAttribute" xml) + MessageAttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + Query.Pair + ("MessageAttribute", (MessageAttributeMap.to_query f))); + Util.option_map v.delay_seconds + (fun f -> Query.Pair ("DelaySeconds", (Integer.to_query f))); + Some + (Query.Pair ("MessageBody", (String.to_query v.message_body))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + ("message_attributes", (MessageAttributeMap.to_json f))); + Util.option_map v.delay_seconds + (fun f -> ("delay_seconds", (Integer.to_json f))); + Some ("message_body", (String.to_json v.message_body)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + message_body = + (String.of_json (Util.of_option_exn (Json.lookup j "message_body"))); + delay_seconds = + (Util.option_map (Json.lookup j "delay_seconds") Integer.of_json); + message_attributes = + (Util.option_map (Json.lookup j "message_attributes") + MessageAttributeMap.of_json) + } + end +module DeleteMessageBatchRequestEntry = + struct + type t = { + id: String.t ; + receipt_handle: String.t } + let make ~id ~receipt_handle () = { id; receipt_handle } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))) + } + end +module BatchResultErrorEntry = + struct + type t = + { + id: String.t ; + sender_fault: Boolean.t ; + code: String.t ; + message: String.t option } + let make ~id ~sender_fault ~code ?message () = + { id; sender_fault; code; message } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + sender_fault = + (Xml.required "SenderFault" + (Util.option_bind (Xml.member "SenderFault" xml) Boolean.parse)); + code = + (Xml.required "Code" + (Util.option_bind (Xml.member "Code" xml) String.parse)); + message = + (Util.option_bind (Xml.member "Message" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> Query.Pair ("Message", (String.to_query f))); + Some (Query.Pair ("Code", (String.to_query v.code))); + Some + (Query.Pair ("SenderFault", (Boolean.to_query v.sender_fault))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message + (fun f -> ("message", (String.to_json f))); + Some ("code", (String.to_json v.code)); + Some ("sender_fault", (Boolean.to_json v.sender_fault)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + sender_fault = + (Boolean.of_json + (Util.of_option_exn (Json.lookup j "sender_fault"))); + code = (String.of_json (Util.of_option_exn (Json.lookup j "code"))); + message = (Util.option_map (Json.lookup j "message") String.of_json) + } + end +module ChangeMessageVisibilityBatchResultEntry = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module SendMessageBatchResultEntry = + struct + type t = + { + id: String.t ; + message_id: String.t ; + m_d5_of_message_body: String.t ; + m_d5_of_message_attributes: String.t option } + let make ~id ~message_id ~m_d5_of_message_body + ?m_d5_of_message_attributes () = + { id; message_id; m_d5_of_message_body; m_d5_of_message_attributes } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)); + message_id = + (Xml.required "MessageId" + (Util.option_bind (Xml.member "MessageId" xml) String.parse)); + m_d5_of_message_body = + (Xml.required "MD5OfMessageBody" + (Util.option_bind (Xml.member "MD5OfMessageBody" xml) + String.parse)); + m_d5_of_message_attributes = + (Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.m_d5_of_message_attributes + (fun f -> + Query.Pair ("MD5OfMessageAttributes", (String.to_query f))); + Some + (Query.Pair + ("MD5OfMessageBody", + (String.to_query v.m_d5_of_message_body))); + Some (Query.Pair ("MessageId", (String.to_query v.message_id))); + Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.m_d5_of_message_attributes + (fun f -> ("m_d5_of_message_attributes", (String.to_json f))); + Some + ("m_d5_of_message_body", + (String.to_json v.m_d5_of_message_body)); + Some ("message_id", (String.to_json v.message_id)); + Some ("id", (String.to_json v.id))]) + let of_json j = + { + id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))); + message_id = + (String.of_json (Util.of_option_exn (Json.lookup j "message_id"))); + m_d5_of_message_body = + (String.of_json + (Util.of_option_exn (Json.lookup j "m_d5_of_message_body"))); + m_d5_of_message_attributes = + (Util.option_map (Json.lookup j "m_d5_of_message_attributes") + String.of_json) + } + end +module Message = + struct + type t = + { + message_id: String.t option ; + receipt_handle: String.t option ; + m_d5_of_body: String.t option ; + body: String.t option ; + attributes: AttributeMap.t option ; + m_d5_of_message_attributes: String.t option ; + message_attributes: MessageAttributeMap.t option } + let make ?message_id ?receipt_handle ?m_d5_of_body ?body ?attributes + ?m_d5_of_message_attributes ?message_attributes () = + { + message_id; + receipt_handle; + m_d5_of_body; + body; + attributes; + m_d5_of_message_attributes; + message_attributes + } + let parse xml = + Some + { + message_id = + (Util.option_bind (Xml.member "MessageId" xml) String.parse); + receipt_handle = + (Util.option_bind (Xml.member "ReceiptHandle" xml) String.parse); + m_d5_of_body = + (Util.option_bind (Xml.member "MD5OfBody" xml) String.parse); + body = (Util.option_bind (Xml.member "Body" xml) String.parse); + attributes = + (Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse); + m_d5_of_message_attributes = + (Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) + String.parse); + message_attributes = + (Util.option_bind (Xml.member "MessageAttribute" xml) + MessageAttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + Query.Pair + ("MessageAttribute", (MessageAttributeMap.to_query f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> + Query.Pair ("MD5OfMessageAttributes", (String.to_query f))); + Util.option_map v.attributes + (fun f -> Query.Pair ("Attribute", (AttributeMap.to_query f))); + Util.option_map v.body + (fun f -> Query.Pair ("Body", (String.to_query f))); + Util.option_map v.m_d5_of_body + (fun f -> Query.Pair ("MD5OfBody", (String.to_query f))); + Util.option_map v.receipt_handle + (fun f -> Query.Pair ("ReceiptHandle", (String.to_query f))); + Util.option_map v.message_id + (fun f -> Query.Pair ("MessageId", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + ("message_attributes", (MessageAttributeMap.to_json f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> ("m_d5_of_message_attributes", (String.to_json f))); + Util.option_map v.attributes + (fun f -> ("attributes", (AttributeMap.to_json f))); + Util.option_map v.body (fun f -> ("body", (String.to_json f))); + Util.option_map v.m_d5_of_body + (fun f -> ("m_d5_of_body", (String.to_json f))); + Util.option_map v.receipt_handle + (fun f -> ("receipt_handle", (String.to_json f))); + Util.option_map v.message_id + (fun f -> ("message_id", (String.to_json f)))]) + let of_json j = + { + message_id = + (Util.option_map (Json.lookup j "message_id") String.of_json); + receipt_handle = + (Util.option_map (Json.lookup j "receipt_handle") String.of_json); + m_d5_of_body = + (Util.option_map (Json.lookup j "m_d5_of_body") String.of_json); + body = (Util.option_map (Json.lookup j "body") String.of_json); + attributes = + (Util.option_map (Json.lookup j "attributes") AttributeMap.of_json); + m_d5_of_message_attributes = + (Util.option_map (Json.lookup j "m_d5_of_message_attributes") + String.of_json); + message_attributes = + (Util.option_map (Json.lookup j "message_attributes") + MessageAttributeMap.of_json) + } + end +module DeleteMessageBatchResultEntry = + struct + type t = { + id: String.t } + let make ~id () = { id } + let parse xml = + Some + { + id = + (Xml.required "Id" + (Util.option_bind (Xml.member "Id" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Id", (String.to_query v.id)))]) + let to_json v = + `Assoc (Util.list_filter_opt [Some ("id", (String.to_json v.id))]) + let of_json j = + { id = (String.of_json (Util.of_option_exn (Json.lookup j "id"))) } + end +module ChangeMessageVisibilityBatchRequestEntryList = + struct + type t = ChangeMessageVisibilityBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ChangeMessageVisibilityBatchRequestEntry.parse + (Xml.members "ChangeMessageVisibilityBatchRequestEntry" xml)) + let to_query v = + Query.to_query_list ChangeMessageVisibilityBatchRequestEntry.to_query v + let to_json v = + `List (List.map ChangeMessageVisibilityBatchRequestEntry.to_json v) + let of_json j = + Json.to_list ChangeMessageVisibilityBatchRequestEntry.of_json j + end +module SendMessageBatchRequestEntryList = + struct + type t = SendMessageBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SendMessageBatchRequestEntry.parse + (Xml.members "SendMessageBatchRequestEntry" xml)) + let to_query v = + Query.to_query_list SendMessageBatchRequestEntry.to_query v + let to_json v = `List (List.map SendMessageBatchRequestEntry.to_json v) + let of_json j = Json.to_list SendMessageBatchRequestEntry.of_json j + end +module DeleteMessageBatchRequestEntryList = + struct + type t = DeleteMessageBatchRequestEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DeleteMessageBatchRequestEntry.parse + (Xml.members "DeleteMessageBatchRequestEntry" xml)) + let to_query v = + Query.to_query_list DeleteMessageBatchRequestEntry.to_query v + let to_json v = `List (List.map DeleteMessageBatchRequestEntry.to_json v) + let of_json j = Json.to_list DeleteMessageBatchRequestEntry.of_json j + end +module BatchResultErrorEntryList = + struct + type t = BatchResultErrorEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map BatchResultErrorEntry.parse + (Xml.members "BatchResultErrorEntry" xml)) + let to_query v = Query.to_query_list BatchResultErrorEntry.to_query v + let to_json v = `List (List.map BatchResultErrorEntry.to_json v) + let of_json j = Json.to_list BatchResultErrorEntry.of_json j + end +module ChangeMessageVisibilityBatchResultEntryList = + struct + type t = ChangeMessageVisibilityBatchResultEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map ChangeMessageVisibilityBatchResultEntry.parse + (Xml.members "ChangeMessageVisibilityBatchResultEntry" xml)) + let to_query v = + Query.to_query_list ChangeMessageVisibilityBatchResultEntry.to_query v + let to_json v = + `List (List.map ChangeMessageVisibilityBatchResultEntry.to_json v) + let of_json j = + Json.to_list ChangeMessageVisibilityBatchResultEntry.of_json j + end +module SendMessageBatchResultEntryList = + struct + type t = SendMessageBatchResultEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map SendMessageBatchResultEntry.parse + (Xml.members "SendMessageBatchResultEntry" xml)) + let to_query v = + Query.to_query_list SendMessageBatchResultEntry.to_query v + let to_json v = `List (List.map SendMessageBatchResultEntry.to_json v) + let of_json j = Json.to_list SendMessageBatchResultEntry.of_json j + end +module AWSAccountIdList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "AWSAccountId" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module ActionNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "ActionName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module AttributeNameList = + struct + type t = QueueAttributeName.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map QueueAttributeName.parse (Xml.members "AttributeName" xml)) + let to_query v = Query.to_query_list QueueAttributeName.to_query v + let to_json v = `List (List.map QueueAttributeName.to_json v) + let of_json j = Json.to_list QueueAttributeName.of_json j + end +module MessageAttributeNameList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map String.parse (Xml.members "MessageAttributeName" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module QueueUrlList = + struct + type t = String.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map String.parse (Xml.members "QueueUrl" xml)) + let to_query v = Query.to_query_list String.to_query v + let to_json v = `List (List.map String.to_json v) + let of_json j = Json.to_list String.of_json j + end +module MessageList = + struct + type t = Message.t list + let make elems () = elems + let parse xml = + Util.option_all (List.map Message.parse (Xml.members "Message" xml)) + let to_query v = Query.to_query_list Message.to_query v + let to_json v = `List (List.map Message.to_json v) + let of_json j = Json.to_list Message.of_json j + end +module DeleteMessageBatchResultEntryList = + struct + type t = DeleteMessageBatchResultEntry.t list + let make elems () = elems + let parse xml = + Util.option_all + (List.map DeleteMessageBatchResultEntry.parse + (Xml.members "DeleteMessageBatchResultEntry" xml)) + let to_query v = + Query.to_query_list DeleteMessageBatchResultEntry.to_query v + let to_json v = `List (List.map DeleteMessageBatchResultEntry.to_json v) + let of_json j = Json.to_list DeleteMessageBatchResultEntry.of_json j + end +module MessageNotInflight = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteQueueRequest = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) + } + end +module InvalidIdFormat = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetQueueUrlRequest = + struct + type t = + { + queue_name: String.t ; + queue_owner_a_w_s_account_id: String.t option } + let make ~queue_name ?queue_owner_a_w_s_account_id () = + { queue_name; queue_owner_a_w_s_account_id } + let parse xml = + Some + { + queue_name = + (Xml.required "QueueName" + (Util.option_bind (Xml.member "QueueName" xml) String.parse)); + queue_owner_a_w_s_account_id = + (Util.option_bind (Xml.member "QueueOwnerAWSAccountId" xml) + String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue_owner_a_w_s_account_id + (fun f -> + Query.Pair ("QueueOwnerAWSAccountId", (String.to_query f))); + Some (Query.Pair ("QueueName", (String.to_query v.queue_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue_owner_a_w_s_account_id + (fun f -> ("queue_owner_a_w_s_account_id", (String.to_json f))); + Some ("queue_name", (String.to_json v.queue_name))]) + let of_json j = + { + queue_name = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_name"))); + queue_owner_a_w_s_account_id = + (Util.option_map (Json.lookup j "queue_owner_a_w_s_account_id") + String.of_json) + } + end +module GetQueueAttributesResult = + struct + type t = { + attributes: AttributeMap.t option } + let make ?attributes () = { attributes } + let parse xml = + Some + { + attributes = + (Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> Query.Pair ("Attribute", (AttributeMap.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> ("attributes", (AttributeMap.to_json f)))]) + let of_json j = + { + attributes = + (Util.option_map (Json.lookup j "attributes") AttributeMap.of_json) + } + end +module PurgeQueueInProgress = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module EmptyBatchRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ChangeMessageVisibilityBatchRequest = + struct + type t = + { + queue_url: String.t ; + entries: ChangeMessageVisibilityBatchRequestEntryList.t } + let make ~queue_url ~entries () = { queue_url; entries } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + entries = + (Xml.required "Entries" + (ChangeMessageVisibilityBatchRequestEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (ChangeMessageVisibilityBatchRequestEntryList.to_query + v.entries))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (ChangeMessageVisibilityBatchRequestEntryList.to_json + v.entries)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + entries = + (ChangeMessageVisibilityBatchRequestEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))) + } + end +module SendMessageBatchRequest = + struct + type t = + { + queue_url: String.t ; + entries: SendMessageBatchRequestEntryList.t } + let make ~queue_url ~entries () = { queue_url; entries } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + entries = + (Xml.required "Entries" + (SendMessageBatchRequestEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (SendMessageBatchRequestEntryList.to_query v.entries))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (SendMessageBatchRequestEntryList.to_json v.entries)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + entries = + (SendMessageBatchRequestEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))) + } + end +module DeleteMessageBatchRequest = + struct + type t = + { + queue_url: String.t ; + entries: DeleteMessageBatchRequestEntryList.t } + let make ~queue_url ~entries () = { queue_url; entries } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + entries = + (Xml.required "Entries" + (DeleteMessageBatchRequestEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Entries.member", + (DeleteMessageBatchRequestEntryList.to_query v.entries))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("entries", + (DeleteMessageBatchRequestEntryList.to_json v.entries)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + entries = + (DeleteMessageBatchRequestEntryList.of_json + (Util.of_option_exn (Json.lookup j "entries"))) + } + end +module ChangeMessageVisibilityBatchResult = + struct + type t = + { + successful: ChangeMessageVisibilityBatchResultEntryList.t ; + failed: BatchResultErrorEntryList.t } + let make ~successful ~failed () = { successful; failed } + let parse xml = + Some + { + successful = + (Xml.required "Successful" + (ChangeMessageVisibilityBatchResultEntryList.parse xml)); + failed = + (Xml.required "Failed" (BatchResultErrorEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (BatchResultErrorEntryList.to_query v.failed))); + Some + (Query.Pair + ("Successful.member", + (ChangeMessageVisibilityBatchResultEntryList.to_query + v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (BatchResultErrorEntryList.to_json v.failed)); + Some + ("successful", + (ChangeMessageVisibilityBatchResultEntryList.to_json + v.successful))]) + let of_json j = + { + successful = + (ChangeMessageVisibilityBatchResultEntryList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (BatchResultErrorEntryList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) + } + end +module RemovePermissionRequest = + struct + type t = { + queue_url: String.t ; + label: String.t } + let make ~queue_url ~label () = { queue_url; label } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + label = + (Xml.required "Label" + (Util.option_bind (Xml.member "Label" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("Label", (String.to_query v.label))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("label", (String.to_json v.label)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + label = (String.of_json (Util.of_option_exn (Json.lookup j "label"))) + } + end +module SendMessageBatchResult = + struct + type t = + { + successful: SendMessageBatchResultEntryList.t ; + failed: BatchResultErrorEntryList.t } + let make ~successful ~failed () = { successful; failed } + let parse xml = + Some + { + successful = + (Xml.required "Successful" + (SendMessageBatchResultEntryList.parse xml)); + failed = + (Xml.required "Failed" (BatchResultErrorEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (BatchResultErrorEntryList.to_query v.failed))); + Some + (Query.Pair + ("Successful.member", + (SendMessageBatchResultEntryList.to_query v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (BatchResultErrorEntryList.to_json v.failed)); + Some + ("successful", + (SendMessageBatchResultEntryList.to_json v.successful))]) + let of_json j = + { + successful = + (SendMessageBatchResultEntryList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (BatchResultErrorEntryList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) + } + end +module AddPermissionRequest = + struct + type t = + { + queue_url: String.t ; + label: String.t ; + a_w_s_account_ids: AWSAccountIdList.t ; + actions: ActionNameList.t } + let make ~queue_url ~label ~a_w_s_account_ids ~actions () = + { queue_url; label; a_w_s_account_ids; actions } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + label = + (Xml.required "Label" + (Util.option_bind (Xml.member "Label" xml) String.parse)); + a_w_s_account_ids = + (Xml.required "AWSAccountIds" (AWSAccountIdList.parse xml)); + actions = (Xml.required "Actions" (ActionNameList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Actions.member", (ActionNameList.to_query v.actions))); + Some + (Query.Pair + ("AWSAccountIds.member", + (AWSAccountIdList.to_query v.a_w_s_account_ids))); + Some (Query.Pair ("Label", (String.to_query v.label))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("actions", (ActionNameList.to_json v.actions)); + Some + ("a_w_s_account_ids", + (AWSAccountIdList.to_json v.a_w_s_account_ids)); + Some ("label", (String.to_json v.label)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + label = (String.of_json (Util.of_option_exn (Json.lookup j "label"))); + a_w_s_account_ids = + (AWSAccountIdList.of_json + (Util.of_option_exn (Json.lookup j "a_w_s_account_ids"))); + actions = + (ActionNameList.of_json + (Util.of_option_exn (Json.lookup j "actions"))) + } + end +module ChangeMessageVisibilityRequest = + struct + type t = + { + queue_url: String.t ; + receipt_handle: String.t ; + visibility_timeout: Integer.t } + let make ~queue_url ~receipt_handle ~visibility_timeout () = + { queue_url; receipt_handle; visibility_timeout } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)); + visibility_timeout = + (Xml.required "VisibilityTimeout" + (Util.option_bind (Xml.member "VisibilityTimeout" xml) + Integer.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("VisibilityTimeout", + (Integer.to_query v.visibility_timeout))); + Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("visibility_timeout", (Integer.to_json v.visibility_timeout)); + Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))); + visibility_timeout = + (Integer.of_json + (Util.of_option_exn (Json.lookup j "visibility_timeout"))) + } + end +module ReceiptHandleIsInvalid = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReceiveMessageRequest = + struct + type t = + { + queue_url: String.t ; + attribute_names: AttributeNameList.t ; + message_attribute_names: MessageAttributeNameList.t ; + max_number_of_messages: Integer.t option ; + visibility_timeout: Integer.t option ; + wait_time_seconds: Integer.t option } + let make ~queue_url ?(attribute_names= []) ?(message_attribute_names= + []) ?max_number_of_messages ?visibility_timeout ?wait_time_seconds + () = + { + queue_url; + attribute_names; + message_attribute_names; + max_number_of_messages; + visibility_timeout; + wait_time_seconds + } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + attribute_names = (Util.of_option [] (AttributeNameList.parse xml)); + message_attribute_names = + (Util.of_option [] (MessageAttributeNameList.parse xml)); + max_number_of_messages = + (Util.option_bind (Xml.member "MaxNumberOfMessages" xml) + Integer.parse); + visibility_timeout = + (Util.option_bind (Xml.member "VisibilityTimeout" xml) + Integer.parse); + wait_time_seconds = + (Util.option_bind (Xml.member "WaitTimeSeconds" xml) + Integer.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.wait_time_seconds + (fun f -> Query.Pair ("WaitTimeSeconds", (Integer.to_query f))); + Util.option_map v.visibility_timeout + (fun f -> Query.Pair ("VisibilityTimeout", (Integer.to_query f))); + Util.option_map v.max_number_of_messages + (fun f -> + Query.Pair ("MaxNumberOfMessages", (Integer.to_query f))); + Some + (Query.Pair + ("MessageAttributeNames.member", + (MessageAttributeNameList.to_query + v.message_attribute_names))); + Some + (Query.Pair + ("AttributeNames.member", + (AttributeNameList.to_query v.attribute_names))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.wait_time_seconds + (fun f -> ("wait_time_seconds", (Integer.to_json f))); + Util.option_map v.visibility_timeout + (fun f -> ("visibility_timeout", (Integer.to_json f))); + Util.option_map v.max_number_of_messages + (fun f -> ("max_number_of_messages", (Integer.to_json f))); + Some + ("message_attribute_names", + (MessageAttributeNameList.to_json v.message_attribute_names)); + Some + ("attribute_names", + (AttributeNameList.to_json v.attribute_names)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + attribute_names = + (AttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "attribute_names"))); + message_attribute_names = + (MessageAttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "message_attribute_names"))); + max_number_of_messages = + (Util.option_map (Json.lookup j "max_number_of_messages") + Integer.of_json); + visibility_timeout = + (Util.option_map (Json.lookup j "visibility_timeout") + Integer.of_json); + wait_time_seconds = + (Util.option_map (Json.lookup j "wait_time_seconds") + Integer.of_json) + } + end +module SendMessageResult = + struct + type t = + { + m_d5_of_message_body: String.t option ; + m_d5_of_message_attributes: String.t option ; + message_id: String.t option } + let make ?m_d5_of_message_body ?m_d5_of_message_attributes ?message_id + () = { m_d5_of_message_body; m_d5_of_message_attributes; message_id } + let parse xml = + Some + { + m_d5_of_message_body = + (Util.option_bind (Xml.member "MD5OfMessageBody" xml) + String.parse); + m_d5_of_message_attributes = + (Util.option_bind (Xml.member "MD5OfMessageAttributes" xml) + String.parse); + message_id = + (Util.option_bind (Xml.member "MessageId" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_id + (fun f -> Query.Pair ("MessageId", (String.to_query f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> + Query.Pair ("MD5OfMessageAttributes", (String.to_query f))); + Util.option_map v.m_d5_of_message_body + (fun f -> Query.Pair ("MD5OfMessageBody", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_id + (fun f -> ("message_id", (String.to_json f))); + Util.option_map v.m_d5_of_message_attributes + (fun f -> ("m_d5_of_message_attributes", (String.to_json f))); + Util.option_map v.m_d5_of_message_body + (fun f -> ("m_d5_of_message_body", (String.to_json f)))]) + let of_json j = + { + m_d5_of_message_body = + (Util.option_map (Json.lookup j "m_d5_of_message_body") + String.of_json); + m_d5_of_message_attributes = + (Util.option_map (Json.lookup j "m_d5_of_message_attributes") + String.of_json); + message_id = + (Util.option_map (Json.lookup j "message_id") String.of_json) + } + end +module DeleteMessageRequest = + struct + type t = { + queue_url: String.t ; + receipt_handle: String.t } + let make ~queue_url ~receipt_handle () = { queue_url; receipt_handle } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + receipt_handle = + (Xml.required "ReceiptHandle" + (Util.option_bind (Xml.member "ReceiptHandle" xml) + String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("ReceiptHandle", (String.to_query v.receipt_handle))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("receipt_handle", (String.to_json v.receipt_handle)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + receipt_handle = + (String.of_json + (Util.of_option_exn (Json.lookup j "receipt_handle"))) + } + end +module ListDeadLetterSourceQueuesRequest = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) + } + end +module QueueDeletedRecently = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SendMessageRequest = + struct + type t = + { + queue_url: String.t ; + message_body: String.t ; + delay_seconds: Integer.t option ; + message_attributes: MessageAttributeMap.t option } + let make ~queue_url ~message_body ?delay_seconds ?message_attributes + () = { queue_url; message_body; delay_seconds; message_attributes } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + message_body = + (Xml.required "MessageBody" + (Util.option_bind (Xml.member "MessageBody" xml) String.parse)); + delay_seconds = + (Util.option_bind (Xml.member "DelaySeconds" xml) Integer.parse); + message_attributes = + (Util.option_bind (Xml.member "MessageAttribute" xml) + MessageAttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + Query.Pair + ("MessageAttribute", (MessageAttributeMap.to_query f))); + Util.option_map v.delay_seconds + (fun f -> Query.Pair ("DelaySeconds", (Integer.to_query f))); + Some + (Query.Pair ("MessageBody", (String.to_query v.message_body))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.message_attributes + (fun f -> + ("message_attributes", (MessageAttributeMap.to_json f))); + Util.option_map v.delay_seconds + (fun f -> ("delay_seconds", (Integer.to_json f))); + Some ("message_body", (String.to_json v.message_body)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + message_body = + (String.of_json (Util.of_option_exn (Json.lookup j "message_body"))); + delay_seconds = + (Util.option_map (Json.lookup j "delay_seconds") Integer.of_json); + message_attributes = + (Util.option_map (Json.lookup j "message_attributes") + MessageAttributeMap.of_json) + } + end +module BatchRequestTooLong = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListDeadLetterSourceQueuesResult = + struct + type t = { + queue_urls: QueueUrlList.t } + let make ~queue_urls () = { queue_urls } + let parse xml = + Some + { queue_urls = (Xml.required "queueUrls" (QueueUrlList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("queueUrls.member", (QueueUrlList.to_query v.queue_urls)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_urls", (QueueUrlList.to_json v.queue_urls))]) + let of_json j = + { + queue_urls = + (QueueUrlList.of_json + (Util.of_option_exn (Json.lookup j "queue_urls"))) + } + end +module QueueDoesNotExist = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListQueuesRequest = + struct + type t = { + queue_name_prefix: String.t option } + let make ?queue_name_prefix () = { queue_name_prefix } + let parse xml = + Some + { + queue_name_prefix = + (Util.option_bind (Xml.member "QueueNamePrefix" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue_name_prefix + (fun f -> Query.Pair ("QueueNamePrefix", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue_name_prefix + (fun f -> ("queue_name_prefix", (String.to_json f)))]) + let of_json j = + { + queue_name_prefix = + (Util.option_map (Json.lookup j "queue_name_prefix") String.of_json) + } + end +module UnsupportedOperation = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module BatchEntryIdsNotDistinct = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module CreateQueueResult = + struct + type t = { + queue_url: String.t option } + let make ?queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.queue_url + (fun f -> Query.Pair ("QueueUrl", (String.to_query f)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.queue_url + (fun f -> ("queue_url", (String.to_json f)))]) + let of_json j = + { + queue_url = + (Util.option_map (Json.lookup j "queue_url") String.of_json) + } + end +module InvalidAttributeName = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module OverLimit = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ReceiveMessageResult = + struct + type t = { + messages: MessageList.t } + let make ?(messages= []) () = { messages } + let parse xml = + Some { messages = (Util.of_option [] (MessageList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Messages.member", (MessageList.to_query v.messages)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("messages", (MessageList.to_json v.messages))]) + let of_json j = + { + messages = + (MessageList.of_json + (Util.of_option_exn (Json.lookup j "messages"))) + } + end +module GetQueueAttributesRequest = + struct + type t = { + queue_url: String.t ; + attribute_names: AttributeNameList.t } + let make ~queue_url ?(attribute_names= []) () = + { queue_url; attribute_names } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + attribute_names = (Util.of_option [] (AttributeNameList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("AttributeNames.member", + (AttributeNameList.to_query v.attribute_names))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some + ("attribute_names", + (AttributeNameList.to_json v.attribute_names)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + attribute_names = + (AttributeNameList.of_json + (Util.of_option_exn (Json.lookup j "attribute_names"))) + } + end +module InvalidBatchEntryId = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module DeleteMessageBatchResult = + struct + type t = + { + successful: DeleteMessageBatchResultEntryList.t ; + failed: BatchResultErrorEntryList.t } + let make ~successful ~failed () = { successful; failed } + let parse xml = + Some + { + successful = + (Xml.required "Successful" + (DeleteMessageBatchResultEntryList.parse xml)); + failed = + (Xml.required "Failed" (BatchResultErrorEntryList.parse xml)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("Failed.member", + (BatchResultErrorEntryList.to_query v.failed))); + Some + (Query.Pair + ("Successful.member", + (DeleteMessageBatchResultEntryList.to_query v.successful)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("failed", (BatchResultErrorEntryList.to_json v.failed)); + Some + ("successful", + (DeleteMessageBatchResultEntryList.to_json v.successful))]) + let of_json j = + { + successful = + (DeleteMessageBatchResultEntryList.of_json + (Util.of_option_exn (Json.lookup j "successful"))); + failed = + (BatchResultErrorEntryList.of_json + (Util.of_option_exn (Json.lookup j "failed"))) + } + end +module TooManyEntriesInBatchRequest = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module ListQueuesResult = + struct + type t = { + queue_urls: QueueUrlList.t } + let make ?(queue_urls= []) () = { queue_urls } + let parse xml = + Some { queue_urls = (Util.of_option [] (QueueUrlList.parse xml)) } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair + ("QueueUrls.member", (QueueUrlList.to_query v.queue_urls)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_urls", (QueueUrlList.to_json v.queue_urls))]) + let of_json j = + { + queue_urls = + (QueueUrlList.of_json + (Util.of_option_exn (Json.lookup j "queue_urls"))) + } + end +module CreateQueueRequest = + struct + type t = { + queue_name: String.t ; + attributes: AttributeMap.t option } + let make ~queue_name ?attributes () = { queue_name; attributes } + let parse xml = + Some + { + queue_name = + (Xml.required "QueueName" + (Util.option_bind (Xml.member "QueueName" xml) String.parse)); + attributes = + (Util.option_bind (Xml.member "Attribute" xml) AttributeMap.parse) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> Query.Pair ("Attribute", (AttributeMap.to_query f))); + Some (Query.Pair ("QueueName", (String.to_query v.queue_name)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Util.option_map v.attributes + (fun f -> ("attributes", (AttributeMap.to_json f))); + Some ("queue_name", (String.to_json v.queue_name))]) + let of_json j = + { + queue_name = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_name"))); + attributes = + (Util.option_map (Json.lookup j "attributes") AttributeMap.of_json) + } + end +module InvalidMessageContents = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module SetQueueAttributesRequest = + struct + type t = { + queue_url: String.t ; + attributes: AttributeMap.t } + let make ~queue_url ~attributes () = { queue_url; attributes } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)); + attributes = + (Xml.required "Attribute" + (Util.option_bind (Xml.member "Attribute" xml) + AttributeMap.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some + (Query.Pair ("Attribute", (AttributeMap.to_query v.attributes))); + Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("attributes", (AttributeMap.to_json v.attributes)); + Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))); + attributes = + (AttributeMap.of_json + (Util.of_option_exn (Json.lookup j "attributes"))) + } + end +module PurgeQueueRequest = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) + } + end +module QueueNameExists = + struct + type t = unit + let make () = () + let parse xml = Some () + let to_query v = Query.List (Util.list_filter_opt []) + let to_json v = `Assoc (Util.list_filter_opt []) + let of_json j = () + end +module GetQueueUrlResult = + struct + type t = { + queue_url: String.t } + let make ~queue_url () = { queue_url } + let parse xml = + Some + { + queue_url = + (Xml.required "QueueUrl" + (Util.option_bind (Xml.member "QueueUrl" xml) String.parse)) + } + let to_query v = + Query.List + (Util.list_filter_opt + [Some (Query.Pair ("QueueUrl", (String.to_query v.queue_url)))]) + let to_json v = + `Assoc + (Util.list_filter_opt + [Some ("queue_url", (String.to_json v.queue_url))]) + let of_json j = + { + queue_url = + (String.of_json (Util.of_option_exn (Json.lookup j "queue_url"))) + } + end \ No newline at end of file diff --git a/libraries/sqs/lib_test/aws_sqs_test.ml b/libraries/sqs/lib_test/aws_sqs_test.ml new file mode 100644 index 000000000..f8e8ef14a --- /dev/null +++ b/libraries/sqs/lib_test/aws_sqs_test.ml @@ -0,0 +1,43 @@ +open OUnit +open Aws_sqs + +module TestSuite(Runtime : sig + type 'a m + val run_request : + region:string + -> (module Aws.Call with type input = 'input + and type output = 'output + and type error = 'error) + -> 'input + -> [`Ok of 'output | `Error of 'error Aws.Error.t] m + val un_m : 'a m -> 'a + end) = struct + + let noop_test () = + "Noop SQS test succeeds" + @?true + + let test_cases = + [ "SQS noop" >:: noop_test ] + + let rec was_successful = + function + | [] -> true + | RSuccess _::t + | RSkip _::t -> + was_successful t + | RFailure _::_ + | RError _::_ + | RTodo _::_ -> + false + let _ = + let suite = "Tests" >::: test_cases in + let verbose = ref false in + let set_verbose _ = verbose := true in + Arg.parse + [("-verbose", Arg.Unit set_verbose, "Run the test in verbose mode.");] + (fun x -> raise (Arg.Bad ("Bad argument : " ^ x))) + ("Usage: " ^ Sys.argv.(0) ^ " [-verbose]"); + if not (was_successful (run_test_tt ~verbose:!verbose suite)) then + exit 1 +end diff --git a/libraries/sqs/lib_test/dune b/libraries/sqs/lib_test/dune new file mode 100644 index 000000000..951ec66e8 --- /dev/null +++ b/libraries/sqs/lib_test/dune @@ -0,0 +1,20 @@ +(executables + (names test_async test_lwt) + (flags (:standard -w -27 -w -33)) + (modules test_async test_lwt aws_sqs_test) + (libraries aws aws_sqs aws-async aws-lwt + oUnit yojson + async cohttp-async + lwt cohttp-lwt cohttp-lwt-unix)) + +(alias + (name runtest) + (deps test_async.exe) + (locks m) + (action (run %{deps}))) + +(alias + (name runtest) + (deps test_lwt.exe) + (locks m) + (action (run %{deps}))) diff --git a/libraries/sqs/lib_test/test_async.ml b/libraries/sqs/lib_test/test_async.ml new file mode 100644 index 000000000..07393f66a --- /dev/null +++ b/libraries/sqs/lib_test/test_async.ml @@ -0,0 +1,11 @@ +open Aws_sqs_test + +module T = TestSuite(struct + type 'a m = 'a Async.Deferred.t + + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" + + let run_request = Aws_async.Runtime.run_request ~access_key ~secret_key + let un_m v = Async.Thread_safe.block_on_async_exn (fun () -> v) + end) diff --git a/libraries/sqs/lib_test/test_lwt.ml b/libraries/sqs/lib_test/test_lwt.ml new file mode 100644 index 000000000..969fadd8d --- /dev/null +++ b/libraries/sqs/lib_test/test_lwt.ml @@ -0,0 +1,11 @@ +open Aws_sqs_test + +module T = TestSuite(struct + type 'a m = 'a Lwt.t + + let access_key = Unix.getenv "AWS_ACCESS_KEY" + let secret_key = Unix.getenv "AWS_SECRET_KEY" + + let run_request = Aws_lwt.Runtime.run_request ~access_key ~secret_key + let un_m = Lwt_main.run + end) diff --git a/libraries/ssm/lib/createAssociation.ml b/libraries/ssm/lib/createAssociation.ml index ef11816a6..bb6543ac6 100644 --- a/libraries/ssm/lib/createAssociation.ml +++ b/libraries/ssm/lib/createAssociation.ml @@ -4,9 +4,11 @@ type input = CreateAssociationRequest.t type output = CreateAssociationResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["CreateAssociation"])] (Util.drop_empty diff --git a/libraries/ssm/lib/createAssociationBatch.ml b/libraries/ssm/lib/createAssociationBatch.ml index f9dbbce24..10f16ab4a 100644 --- a/libraries/ssm/lib/createAssociationBatch.ml +++ b/libraries/ssm/lib/createAssociationBatch.ml @@ -4,9 +4,11 @@ type input = CreateAssociationBatchRequest.t type output = CreateAssociationBatchResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["CreateAssociationBatch"])] diff --git a/libraries/ssm/lib/createDocument.ml b/libraries/ssm/lib/createDocument.ml index 957122f64..ababa6044 100644 --- a/libraries/ssm/lib/createDocument.ml +++ b/libraries/ssm/lib/createDocument.ml @@ -4,9 +4,11 @@ type input = CreateDocumentRequest.t type output = CreateDocumentResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["CreateDocument"])] (Util.drop_empty diff --git a/libraries/ssm/lib/deleteAssociation.ml b/libraries/ssm/lib/deleteAssociation.ml index 5d6d60f9b..9b48c50cc 100644 --- a/libraries/ssm/lib/deleteAssociation.ml +++ b/libraries/ssm/lib/deleteAssociation.ml @@ -4,9 +4,11 @@ type input = DeleteAssociationRequest.t type output = unit type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["DeleteAssociation"])] (Util.drop_empty diff --git a/libraries/ssm/lib/deleteDocument.ml b/libraries/ssm/lib/deleteDocument.ml index 0e6708cee..223b8fe5b 100644 --- a/libraries/ssm/lib/deleteDocument.ml +++ b/libraries/ssm/lib/deleteDocument.ml @@ -4,9 +4,11 @@ type input = DeleteDocumentRequest.t type output = unit type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["DeleteDocument"])] (Util.drop_empty diff --git a/libraries/ssm/lib/describeAssociation.ml b/libraries/ssm/lib/describeAssociation.ml index 89aad7d7d..18185d8f7 100644 --- a/libraries/ssm/lib/describeAssociation.ml +++ b/libraries/ssm/lib/describeAssociation.ml @@ -4,9 +4,11 @@ type input = DescribeAssociationRequest.t type output = DescribeAssociationResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["DescribeAssociation"])] (Util.drop_empty diff --git a/libraries/ssm/lib/describeDocument.ml b/libraries/ssm/lib/describeDocument.ml index 94f2ef7fb..c48577992 100644 --- a/libraries/ssm/lib/describeDocument.ml +++ b/libraries/ssm/lib/describeDocument.ml @@ -4,9 +4,11 @@ type input = DescribeDocumentRequest.t type output = DescribeDocumentResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["DescribeDocument"])] (Util.drop_empty diff --git a/libraries/ssm/lib/getDocument.ml b/libraries/ssm/lib/getDocument.ml index ff52dd452..8c3019b43 100644 --- a/libraries/ssm/lib/getDocument.ml +++ b/libraries/ssm/lib/getDocument.ml @@ -4,9 +4,11 @@ type input = GetDocumentRequest.t type output = GetDocumentResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["GetDocument"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/ssm/lib/listAssociations.ml b/libraries/ssm/lib/listAssociations.ml index 62be8bd8d..b83d013ee 100644 --- a/libraries/ssm/lib/listAssociations.ml +++ b/libraries/ssm/lib/listAssociations.ml @@ -4,9 +4,11 @@ type input = ListAssociationsRequest.t type output = ListAssociationsResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["ListAssociations"])] (Util.drop_empty diff --git a/libraries/ssm/lib/listDocuments.ml b/libraries/ssm/lib/listDocuments.ml index 3147b8fe5..2182d6be5 100644 --- a/libraries/ssm/lib/listDocuments.ml +++ b/libraries/ssm/lib/listDocuments.ml @@ -4,9 +4,11 @@ type input = ListDocumentsRequest.t type output = ListDocumentsResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["ListDocuments"])] (Util.drop_empty diff --git a/libraries/ssm/lib/types.ml b/libraries/ssm/lib/types.ml index 86068aca3..2ca175bd3 100644 --- a/libraries/ssm/lib/types.ml +++ b/libraries/ssm/lib/types.ml @@ -12,6 +12,8 @@ module AssociationStatusName = [("Failed", Failed); ("Success", Success); ("Pending", Pending)] let t_to_str = [(Failed, "Failed"); (Success, "Success"); (Pending, "Pending")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -30,6 +32,8 @@ module AssociationFilterKey = | Name let str_to_t = [("Name", Name); ("InstanceId", InstanceId)] let t_to_str = [(Name, "Name"); (InstanceId, "InstanceId")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -47,6 +51,8 @@ module DocumentFilterKey = | Name let str_to_t = [("Name", Name)] let t_to_str = [(Name, "Name")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -156,6 +162,8 @@ module Fault = [("Unknown", Unknown); ("Server", Server); ("Client", Client)] let t_to_str = [(Unknown, "Unknown"); (Server, "Server"); (Client, "Client")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) @@ -299,6 +307,8 @@ module DocumentStatus = [("Deleting", Deleting); ("Active", Active); ("Creating", Creating)] let t_to_str = [(Deleting, "Deleting"); (Active, "Active"); (Creating, "Creating")] + let to_string e = Util.of_option_exn (Util.list_find t_to_str e) + let of_string s = Util.of_option_exn (Util.list_find str_to_t s) let make v () = v let parse xml = Util.option_bind (String.parse xml) diff --git a/libraries/ssm/lib/updateAssociationStatus.ml b/libraries/ssm/lib/updateAssociationStatus.ml index 6ed07b939..08f185345 100644 --- a/libraries/ssm/lib/updateAssociationStatus.ml +++ b/libraries/ssm/lib/updateAssociationStatus.ml @@ -4,9 +4,11 @@ type input = UpdateAssociationStatusRequest.t type output = UpdateAssociationStatusResult.t type error = Errors_internal.t let service = "ssm" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://ssm.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2014-11-06"]); ("Action", ["UpdateAssociationStatus"])] diff --git a/libraries/ssm/lib_test/aws_ssm_test.ml b/libraries/ssm/lib_test/aws_ssm_test.ml index d428baa79..5e102fd30 100644 --- a/libraries/ssm/lib_test/aws_ssm_test.ml +++ b/libraries/ssm/lib_test/aws_ssm_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop SSM test succeeds" - @?false + @?true let test_cases = [ "SSM noop" >:: noop_test ] diff --git a/libraries/sts/lib/assumeRole.ml b/libraries/sts/lib/assumeRole.ml index c76a14ff9..3f9295446 100644 --- a/libraries/sts/lib/assumeRole.ml +++ b/libraries/sts/lib/assumeRole.ml @@ -4,9 +4,11 @@ type input = AssumeRoleRequest.t type output = AssumeRoleResponse.t type error = Errors_internal.t let service = "sts" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sts.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-06-15"]); ("Action", ["AssumeRole"])] (Util.drop_empty (Uri.query_of_encoded diff --git a/libraries/sts/lib/assumeRoleWithSAML.ml b/libraries/sts/lib/assumeRoleWithSAML.ml index ecbe8836a..15f24ea3c 100644 --- a/libraries/sts/lib/assumeRoleWithSAML.ml +++ b/libraries/sts/lib/assumeRoleWithSAML.ml @@ -4,9 +4,11 @@ type input = AssumeRoleWithSAMLRequest.t type output = AssumeRoleWithSAMLResponse.t type error = Errors_internal.t let service = "sts" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sts.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-06-15"]); ("Action", ["AssumeRoleWithSAML"])] (Util.drop_empty diff --git a/libraries/sts/lib/assumeRoleWithWebIdentity.ml b/libraries/sts/lib/assumeRoleWithWebIdentity.ml index 83b33c291..307e7df93 100644 --- a/libraries/sts/lib/assumeRoleWithWebIdentity.ml +++ b/libraries/sts/lib/assumeRoleWithWebIdentity.ml @@ -4,9 +4,11 @@ type input = AssumeRoleWithWebIdentityRequest.t type output = AssumeRoleWithWebIdentityResponse.t type error = Errors_internal.t let service = "sts" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sts.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-06-15"]); ("Action", ["AssumeRoleWithWebIdentity"])] diff --git a/libraries/sts/lib/decodeAuthorizationMessage.ml b/libraries/sts/lib/decodeAuthorizationMessage.ml index 93f7f2e82..fb5d07ebc 100644 --- a/libraries/sts/lib/decodeAuthorizationMessage.ml +++ b/libraries/sts/lib/decodeAuthorizationMessage.ml @@ -4,9 +4,11 @@ type input = DecodeAuthorizationMessageRequest.t type output = DecodeAuthorizationMessageResponse.t type error = Errors_internal.t let service = "sts" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sts.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-06-15"]); ("Action", ["DecodeAuthorizationMessage"])] diff --git a/libraries/sts/lib/getFederationToken.ml b/libraries/sts/lib/getFederationToken.ml index e6fa0850a..e980eec71 100644 --- a/libraries/sts/lib/getFederationToken.ml +++ b/libraries/sts/lib/getFederationToken.ml @@ -4,9 +4,11 @@ type input = GetFederationTokenRequest.t type output = GetFederationTokenResponse.t type error = Errors_internal.t let service = "sts" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sts.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-06-15"]); ("Action", ["GetFederationToken"])] (Util.drop_empty diff --git a/libraries/sts/lib/getSessionToken.ml b/libraries/sts/lib/getSessionToken.ml index 6614e0d42..bf427f1fe 100644 --- a/libraries/sts/lib/getSessionToken.ml +++ b/libraries/sts/lib/getSessionToken.ml @@ -4,9 +4,11 @@ type input = GetSessionTokenRequest.t type output = GetSessionTokenResponse.t type error = Errors_internal.t let service = "sts" -let to_http req = +let to_http service region req = let uri = - Uri.add_query_params (Uri.of_string "https://sts.amazonaws.com") + Uri.add_query_params + (Uri.of_string + (Aws.Util.of_option_exn (Endpoints.url_of service region))) (List.append [("Version", ["2011-06-15"]); ("Action", ["GetSessionToken"])] (Util.drop_empty diff --git a/libraries/sts/lib_test/aws_sts_test.ml b/libraries/sts/lib_test/aws_sts_test.ml index 170f085f7..8dd504be6 100644 --- a/libraries/sts/lib_test/aws_sts_test.ml +++ b/libraries/sts/lib_test/aws_sts_test.ml @@ -15,7 +15,7 @@ module TestSuite(Runtime : sig let noop_test () = "Noop STS test succeeds" - @?false + @?true let test_cases = [ "STS noop" >:: noop_test ] diff --git a/lwt/runtime.ml b/lwt/runtime.ml index 4e7aa3114..1dfa75d18 100644 --- a/lwt/runtime.ml +++ b/lwt/runtime.ml @@ -46,7 +46,7 @@ let run_request (inp : M.input) = let meth, uri, headers = - Aws.Signing.sign_request ~access_key ~secret_key ~service:M.service ~region (M.to_http inp) + Aws.Signing.sign_request ~access_key ~secret_key ~service:M.service ~region (M.to_http M.service region inp) in let open Cohttp in let headers = Header.of_list headers in diff --git a/src/dune b/src/dune index 60043f1de..ce8c476a4 100644 --- a/src/dune +++ b/src/dune @@ -1,8 +1,8 @@ -(executable - (name aws_gen) - (public_name aws-gen) +(executables + (names aws_gen endpoint_gen) + (public_names aws-gen endpoint-gen) (package aws-gen) (preprocess (pps ppx_tools_versioned.metaquot_404)) (libraries yojson cmdliner unix ppx_tools_versioned - ocaml-migrate-parsetree ocamlgraph)) + ocaml-migrate-parsetree ocamlgraph atdgen str)) diff --git a/src/endpoint_gen.ml b/src/endpoint_gen.ml new file mode 100644 index 000000000..0635b79f0 --- /dev/null +++ b/src/endpoint_gen.ml @@ -0,0 +1,86 @@ +open Cmdliner + +let () a b = Filename.concat a b +let log s = Printf.eprintf (s ^^ "\n%!") + +let var_replace hostname svc_name region dns_suffix = + let hostname = Str.replace_first (Str.regexp_string {|{region}|}) region hostname in + let hostname = Str.replace_first (Str.regexp_string {|{service}|}) svc_name hostname in + Str.replace_first (Str.regexp_string {|{dnsSuffix}|}) dns_suffix hostname + +let write_endpoint + svc_name + dns_suffix + (default_hostname : string option) + ((region, endpoint) : (string * Endpoints_t.endpoint)) = Syntax.( + let host = match (endpoint.hostname, default_hostname) with + | (None, None) -> (ident "None") + | (None, Some(hostname)) + | (Some(hostname), _) -> (app1 "Some" (str (var_replace hostname svc_name region dns_suffix))) in + (region, host) +) + +let write_service + dns_suffix + (partition_defaults : Endpoints_t.partition_defaults) + ((svc_name, svc) : (string * Endpoints_t.service)) = Syntax.( + (svc_name, (matchstrs + (ident "region") + (svc.endpoints |> List.map (write_endpoint svc_name dns_suffix partition_defaults.hostname)) + (ident "None"))) +) + +let write_partition (p : Endpoints_t.partition) = Syntax.( + let_ "endpoint_of" + (fun2 "svc_name" "region" + (matchstrs + (ident "svc_name") + (p.services |> List.map (write_service p.dns_suffix p.defaults)) + (ident "None"))) +) + +let write_url_of = Syntax.( + let_ "url_of" + (fun2 "svc_name" "region" + (matchoption + (app2 "endpoint_of" (ident "svc_name") (ident "region")) + (app1 "Some" (app2 "^" (str "https://") (ident "var"))) + (ident "None") + )) +) + +let main input outdir = + log "Start processing endpoints"; + + let inc = open_in input in + let n = in_channel_length inc in + let endpoint_data = really_input_string inc n in + let endpoints = Endpoints_j.endpoints_of_string endpoint_data in + let aws = endpoints.partitions + |> List.find (fun p -> String.equal Endpoints_t.(p.partition) "aws") in + let outfile = (outdir "endpoints.ml") in + let syntax = write_partition aws in + Util.Printing.write_structure outfile [syntax; write_url_of]; + close_in inc; + +module CommandLine = struct + let input = + let doc = "JSON file specifying AWS endpoints to generate" in + Arg.(required & opt (some non_dir_file) None & info ["i"; "input-file"] ~docv:"Filename" ~doc) + + let outdir = + let doc = "directory where generated library should be put" in + Arg.(required & opt (some dir) None & info ["o"; "output-directory"] ~docv:"Directory" ~doc) + + let gen_t = Term.(pure main $ input $ outdir) + + let info = + let doc = "Generate the endpoints mapping for AWS resources." in + Term.info "endpoint-gen" ~version:"0.0.1" ~doc +end + +(** entrypoint *) +let () = + match Term.eval CommandLine.(gen_t, info) with + | `Error _ -> exit 1 + | _ -> exit 0 diff --git a/src/endpoints.atd b/src/endpoints.atd new file mode 100644 index 000000000..2a5d2f0c3 --- /dev/null +++ b/src/endpoints.atd @@ -0,0 +1,37 @@ +type region = { + description: string; +} + +type partition_defaults = { + ?hostname: string nullable; + protocols: string list; + signature_versions : string list; +} + +type service_defaults = { + ?protocols: string list option; + ?ssl_common_name: string nullable; +} + +type endpoint = { + ?hostname: string nullable; +} + +type service = { + ?defaults: service_defaults option; + endpoints: (string * endpoint) list ; +} + +type partition = { + defaults: partition_defaults; + dns_suffix : string; + partition: string; + partition_name : string; + region_regex : string; + regions: (string * region) list ; + services: (string * service) list ; +} + +type endpoints = { + partitions: partition list; +} diff --git a/src/endpoints_j.ml b/src/endpoints_j.ml new file mode 100644 index 000000000..4686b0c8a --- /dev/null +++ b/src/endpoints_j.ml @@ -0,0 +1,1464 @@ +(* Auto-generated from "endpoints.atd" *) +[@@@ocaml.warning "-27-32-35-39"] + +type service_defaults = Endpoints_t.service_defaults = { + protocols: string list option; + ssl_common_name: string option +} + +type endpoint = Endpoints_t.endpoint = { hostname: string option } + +type service = Endpoints_t.service = { + defaults: service_defaults option; + endpoints: (string * endpoint) list +} + +type region = Endpoints_t.region = { description: string } + +type partition_defaults = Endpoints_t.partition_defaults = { + hostname: string option; + protocols: string list; + signature_versions: string list +} + +type partition = Endpoints_t.partition = { + defaults: partition_defaults; + dns_suffix: string; + partition: string; + partition_name: string; + region_regex: string; + regions: (string * region) list; + services: (string * service) list +} + +type endpoints = Endpoints_t.endpoints = { partitions: partition list } + +let write__2 = ( + Atdgen_runtime.Oj_run.write_list ( + Yojson.Safe.write_string + ) +) +let string_of__2 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__2 ob x; + Bi_outbuf.contents ob +let read__2 = ( + Atdgen_runtime.Oj_run.read_list ( + Atdgen_runtime.Oj_run.read_string + ) +) +let _2_of_string s = + read__2 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__3 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__2 + ) +) +let string_of__3 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__3 ob x; + Bi_outbuf.contents ob +let read__3 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__2 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__2 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) +let _3_of_string s = + read__3 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__1 = ( + Atdgen_runtime.Oj_run.write_nullable ( + Yojson.Safe.write_string + ) +) +let string_of__1 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__1 ob x; + Bi_outbuf.contents ob +let read__1 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + (if Yojson.Safe.read_null_if_possible p lb then None + else Some (( + Atdgen_runtime.Oj_run.read_string + ) p lb) : _ option) +) +let _1_of_string s = + read__1 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_service_defaults : _ -> service_defaults -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + (match x.protocols with None -> () | Some x -> + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"protocols\":"; + ( + write__2 + ) + ob x; + ); + (match x.ssl_common_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"ssl_common_name\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Bi_outbuf.add_char ob '}'; +) +let string_of_service_defaults ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_service_defaults ob x; + Bi_outbuf.contents ob +let read_service_defaults = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_protocols = ref (None) in + let field_ssl_common_name = ref (None) in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 9 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = '_' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'm' && String.unsafe_get s (pos+14) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_protocols := ( + Some ( + ( + read__2 + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_ssl_common_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 9 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = '_' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = '_' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'm' && String.unsafe_get s (pos+14) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_protocols := ( + Some ( + ( + read__2 + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_ssl_common_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + protocols = !field_protocols; + ssl_common_name = !field_ssl_common_name; + } + : service_defaults) + ) +) +let service_defaults_of_string s = + read_service_defaults (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_endpoint : _ -> endpoint -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + (match x.hostname with None -> () | Some x -> + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"hostname\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Bi_outbuf.add_char ob '}'; +) +let string_of_endpoint ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_endpoint ob x; + Bi_outbuf.contents ob +let read_endpoint = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_hostname = ref (None) in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + if len = 8 && String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 0 + ) + else ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hostname := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + if len = 8 && String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 0 + ) + else ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hostname := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + hostname = !field_hostname; + } + : endpoint) + ) +) +let endpoint_of_string s = + read_endpoint (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__5 = ( + Atdgen_runtime.Oj_run.write_assoc_list ( + Yojson.Safe.write_string + ) ( + write_endpoint + ) +) +let string_of__5 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__5 ob x; + Bi_outbuf.contents ob +let read__5 = ( + Atdgen_runtime.Oj_run.read_assoc_list ( + Atdgen_runtime.Oj_run.read_string + ) ( + read_endpoint + ) +) +let _5_of_string s = + read__5 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__4 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_service_defaults + ) +) +let string_of__4 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__4 ob x; + Bi_outbuf.contents ob +let read__4 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_service_defaults + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_service_defaults + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) +let _4_of_string s = + read__4 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_service : _ -> service -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + (match x.defaults with None -> () | Some x -> + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"defaults\":"; + ( + write_service_defaults + ) + ob x; + ); + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"endpoints\":"; + ( + write__5 + ) + ob x.endpoints; + Bi_outbuf.add_char ob '}'; +) +let string_of_service ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_service ob x; + Bi_outbuf.contents ob +let read_service = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_defaults = ref (None) in + let field_endpoints = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let bits0 = ref 0 in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 8 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_defaults := ( + Some ( + ( + read_service_defaults + ) p lb + ) + ); + ) + | 1 -> + field_endpoints := ( + ( + read__5 + ) p lb + ); + bits0 := !bits0 lor 0x1; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 8 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_defaults := ( + Some ( + ( + read_service_defaults + ) p lb + ) + ); + ) + | 1 -> + field_endpoints := ( + ( + read__5 + ) p lb + ); + bits0 := !bits0 lor 0x1; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + if !bits0 <> 0x1 then Atdgen_runtime.Oj_run.missing_fields p [| !bits0 |] [| "endpoints" |]; + ( + { + defaults = !field_defaults; + endpoints = !field_endpoints; + } + : service) + ) +) +let service_of_string s = + read_service (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_region : _ -> region -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"description\":"; + ( + Yojson.Safe.write_string + ) + ob x.description; + Bi_outbuf.add_char ob '}'; +) +let string_of_region ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_region ob x; + Bi_outbuf.contents ob +let read_region = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_description = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let bits0 = ref 0 in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + if len = 11 && String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_description := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x1; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + if len = 11 && String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_description := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x1; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + if !bits0 <> 0x1 then Atdgen_runtime.Oj_run.missing_fields p [| !bits0 |] [| "description" |]; + ( + { + description = !field_description; + } + : region) + ) +) +let region_of_string s = + read_region (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_partition_defaults : _ -> partition_defaults -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + (match x.hostname with None -> () | Some x -> + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"hostname\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"protocols\":"; + ( + write__2 + ) + ob x.protocols; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"signatureVersions\":"; + ( + write__2 + ) + ob x.signature_versions; + Bi_outbuf.add_char ob '}'; +) +let string_of_partition_defaults ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_partition_defaults ob x; + Bi_outbuf.contents ob +let read_partition_defaults = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_hostname = ref (None) in + let field_protocols = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_signature_versions = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let bits0 = ref 0 in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 8 -> ( + if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'V' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hostname := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + field_protocols := ( + ( + read__2 + ) p lb + ); + bits0 := !bits0 lor 0x1; + | 2 -> + field_signature_versions := ( + ( + read__2 + ) p lb + ); + bits0 := !bits0 lor 0x2; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 8 -> ( + if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'V' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hostname := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + field_protocols := ( + ( + read__2 + ) p lb + ); + bits0 := !bits0 lor 0x1; + | 2 -> + field_signature_versions := ( + ( + read__2 + ) p lb + ); + bits0 := !bits0 lor 0x2; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + if !bits0 <> 0x3 then Atdgen_runtime.Oj_run.missing_fields p [| !bits0 |] [| "protocols"; "signature_versions" |]; + ( + { + hostname = !field_hostname; + protocols = !field_protocols; + signature_versions = !field_signature_versions; + } + : partition_defaults) + ) +) +let partition_defaults_of_string s = + read_partition_defaults (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__7 = ( + Atdgen_runtime.Oj_run.write_assoc_list ( + Yojson.Safe.write_string + ) ( + write_service + ) +) +let string_of__7 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__7 ob x; + Bi_outbuf.contents ob +let read__7 = ( + Atdgen_runtime.Oj_run.read_assoc_list ( + Atdgen_runtime.Oj_run.read_string + ) ( + read_service + ) +) +let _7_of_string s = + read__7 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__6 = ( + Atdgen_runtime.Oj_run.write_assoc_list ( + Yojson.Safe.write_string + ) ( + write_region + ) +) +let string_of__6 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__6 ob x; + Bi_outbuf.contents ob +let read__6 = ( + Atdgen_runtime.Oj_run.read_assoc_list ( + Atdgen_runtime.Oj_run.read_string + ) ( + read_region + ) +) +let _6_of_string s = + read__6 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_partition : _ -> partition -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"defaults\":"; + ( + write_partition_defaults + ) + ob x.defaults; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"dnsSuffix\":"; + ( + Yojson.Safe.write_string + ) + ob x.dns_suffix; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"partition\":"; + ( + Yojson.Safe.write_string + ) + ob x.partition; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"partitionName\":"; + ( + Yojson.Safe.write_string + ) + ob x.partition_name; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"regionRegex\":"; + ( + Yojson.Safe.write_string + ) + ob x.region_regex; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"regions\":"; + ( + write__6 + ) + ob x.regions; + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"services\":"; + ( + write__7 + ) + ob x.services; + Bi_outbuf.add_char ob '}'; +) +let string_of_partition ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_partition ob x; + Bi_outbuf.contents ob +let read_partition = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_defaults = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_dns_suffix = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_partition = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_partition_name = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_region_regex = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_regions = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let field_services = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let bits0 = ref 0 in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'S' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'x' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'R' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 4 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'N' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'm' && String.unsafe_get s (pos+12) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_defaults := ( + ( + read_partition_defaults + ) p lb + ); + bits0 := !bits0 lor 0x1; + | 1 -> + field_dns_suffix := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x2; + | 2 -> + field_partition := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x4; + | 3 -> + field_partition_name := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x8; + | 4 -> + field_region_regex := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x10; + | 5 -> + field_regions := ( + ( + read__6 + ) p lb + ); + bits0 := !bits0 lor 0x20; + | 6 -> + field_services := ( + ( + read__7 + ) p lb + ); + bits0 := !bits0 lor 0x40; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + match len with + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'S' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'x' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'R' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 4 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'N' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'm' && String.unsafe_get s (pos+12) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_defaults := ( + ( + read_partition_defaults + ) p lb + ); + bits0 := !bits0 lor 0x1; + | 1 -> + field_dns_suffix := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x2; + | 2 -> + field_partition := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x4; + | 3 -> + field_partition_name := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x8; + | 4 -> + field_region_regex := ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ); + bits0 := !bits0 lor 0x10; + | 5 -> + field_regions := ( + ( + read__6 + ) p lb + ); + bits0 := !bits0 lor 0x20; + | 6 -> + field_services := ( + ( + read__7 + ) p lb + ); + bits0 := !bits0 lor 0x40; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + if !bits0 <> 0x7f then Atdgen_runtime.Oj_run.missing_fields p [| !bits0 |] [| "defaults"; "dns_suffix"; "partition"; "partition_name"; "region_regex"; "regions"; "services" |]; + ( + { + defaults = !field_defaults; + dns_suffix = !field_dns_suffix; + partition = !field_partition; + partition_name = !field_partition_name; + region_regex = !field_region_regex; + regions = !field_regions; + services = !field_services; + } + : partition) + ) +) +let partition_of_string s = + read_partition (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__8 = ( + Atdgen_runtime.Oj_run.write_list ( + write_partition + ) +) +let string_of__8 ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write__8 ob x; + Bi_outbuf.contents ob +let read__8 = ( + Atdgen_runtime.Oj_run.read_list ( + read_partition + ) +) +let _8_of_string s = + read__8 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_endpoints : _ -> endpoints -> _ = ( + fun ob x -> + Bi_outbuf.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Bi_outbuf.add_char ob ','; + Bi_outbuf.add_string ob "\"partitions\":"; + ( + write__8 + ) + ob x.partitions; + Bi_outbuf.add_char ob '}'; +) +let string_of_endpoints ?(len = 1024) x = + let ob = Bi_outbuf.create len in + write_endpoints ob x; + Bi_outbuf.contents ob +let read_endpoints = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_partitions = ref (Obj.magic (Sys.opaque_identity 0.0)) in + let bits0 = ref 0 in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + if len = 10 && String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 0 + ) + else ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_partitions := ( + ( + read__8 + ) p lb + ); + bits0 := !bits0 lor 0x1; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg "out-of-bounds substring position or length"; + if len = 10 && String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 0 + ) + else ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_partitions := ( + ( + read__8 + ) p lb + ); + bits0 := !bits0 lor 0x1; + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + if !bits0 <> 0x1 then Atdgen_runtime.Oj_run.missing_fields p [| !bits0 |] [| "partitions" |]; + ( + { + partitions = !field_partitions; + } + : endpoints) + ) +) +let endpoints_of_string s = + read_endpoints (Yojson.Safe.init_lexer ()) (Lexing.from_string s) diff --git a/src/endpoints_j.mli b/src/endpoints_j.mli new file mode 100644 index 000000000..e5be5f999 --- /dev/null +++ b/src/endpoints_j.mli @@ -0,0 +1,175 @@ +(* Auto-generated from "endpoints.atd" *) +[@@@ocaml.warning "-27-32-35-39"] + +type service_defaults = Endpoints_t.service_defaults = { + protocols: string list option; + ssl_common_name: string option +} + +type endpoint = Endpoints_t.endpoint = { hostname: string option } + +type service = Endpoints_t.service = { + defaults: service_defaults option; + endpoints: (string * endpoint) list +} + +type region = Endpoints_t.region = { description: string } + +type partition_defaults = Endpoints_t.partition_defaults = { + hostname: string option; + protocols: string list; + signature_versions: string list +} + +type partition = Endpoints_t.partition = { + defaults: partition_defaults; + dns_suffix: string; + partition: string; + partition_name: string; + region_regex: string; + regions: (string * region) list; + services: (string * service) list +} + +type endpoints = Endpoints_t.endpoints = { partitions: partition list } + +val write_service_defaults : + Bi_outbuf.t -> service_defaults -> unit + (** Output a JSON value of type {!service_defaults}. *) + +val string_of_service_defaults : + ?len:int -> service_defaults -> string + (** Serialize a value of type {!service_defaults} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_service_defaults : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> service_defaults + (** Input JSON data of type {!service_defaults}. *) + +val service_defaults_of_string : + string -> service_defaults + (** Deserialize JSON data of type {!service_defaults}. *) + +val write_endpoint : + Bi_outbuf.t -> endpoint -> unit + (** Output a JSON value of type {!endpoint}. *) + +val string_of_endpoint : + ?len:int -> endpoint -> string + (** Serialize a value of type {!endpoint} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_endpoint : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> endpoint + (** Input JSON data of type {!endpoint}. *) + +val endpoint_of_string : + string -> endpoint + (** Deserialize JSON data of type {!endpoint}. *) + +val write_service : + Bi_outbuf.t -> service -> unit + (** Output a JSON value of type {!service}. *) + +val string_of_service : + ?len:int -> service -> string + (** Serialize a value of type {!service} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_service : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> service + (** Input JSON data of type {!service}. *) + +val service_of_string : + string -> service + (** Deserialize JSON data of type {!service}. *) + +val write_region : + Bi_outbuf.t -> region -> unit + (** Output a JSON value of type {!region}. *) + +val string_of_region : + ?len:int -> region -> string + (** Serialize a value of type {!region} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_region : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> region + (** Input JSON data of type {!region}. *) + +val region_of_string : + string -> region + (** Deserialize JSON data of type {!region}. *) + +val write_partition_defaults : + Bi_outbuf.t -> partition_defaults -> unit + (** Output a JSON value of type {!partition_defaults}. *) + +val string_of_partition_defaults : + ?len:int -> partition_defaults -> string + (** Serialize a value of type {!partition_defaults} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_partition_defaults : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> partition_defaults + (** Input JSON data of type {!partition_defaults}. *) + +val partition_defaults_of_string : + string -> partition_defaults + (** Deserialize JSON data of type {!partition_defaults}. *) + +val write_partition : + Bi_outbuf.t -> partition -> unit + (** Output a JSON value of type {!partition}. *) + +val string_of_partition : + ?len:int -> partition -> string + (** Serialize a value of type {!partition} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_partition : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> partition + (** Input JSON data of type {!partition}. *) + +val partition_of_string : + string -> partition + (** Deserialize JSON data of type {!partition}. *) + +val write_endpoints : + Bi_outbuf.t -> endpoints -> unit + (** Output a JSON value of type {!endpoints}. *) + +val string_of_endpoints : + ?len:int -> endpoints -> string + (** Serialize a value of type {!endpoints} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_endpoints : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> endpoints + (** Input JSON data of type {!endpoints}. *) + +val endpoints_of_string : + string -> endpoints + (** Deserialize JSON data of type {!endpoints}. *) + diff --git a/src/endpoints_t.ml b/src/endpoints_t.ml new file mode 100644 index 000000000..2dd861dcb --- /dev/null +++ b/src/endpoints_t.ml @@ -0,0 +1,34 @@ +(* Auto-generated from "endpoints.atd" *) + [@@@ocaml.warning "-27-32-35-39"] + +type service_defaults = { + protocols: string list option; + ssl_common_name: string option +} + +type endpoint = { hostname: string option } + +type service = { + defaults: service_defaults option; + endpoints: (string * endpoint) list +} + +type region = { description: string } + +type partition_defaults = { + hostname: string option; + protocols: string list; + signature_versions: string list +} + +type partition = { + defaults: partition_defaults; + dns_suffix: string; + partition: string; + partition_name: string; + region_regex: string; + regions: (string * region) list; + services: (string * service) list +} + +type endpoints = { partitions: partition list } diff --git a/src/endpoints_t.mli b/src/endpoints_t.mli new file mode 100644 index 000000000..2dd861dcb --- /dev/null +++ b/src/endpoints_t.mli @@ -0,0 +1,34 @@ +(* Auto-generated from "endpoints.atd" *) + [@@@ocaml.warning "-27-32-35-39"] + +type service_defaults = { + protocols: string list option; + ssl_common_name: string option +} + +type endpoint = { hostname: string option } + +type service = { + defaults: service_defaults option; + endpoints: (string * endpoint) list +} + +type region = { description: string } + +type partition_defaults = { + hostname: string option; + protocols: string list; + signature_versions: string list +} + +type partition = { + defaults: partition_defaults; + dns_suffix: string; + partition: string; + partition_name: string; + region_regex: string; + regions: (string * region) list; + services: (string * service) list +} + +type endpoints = { partitions: partition list } diff --git a/src/generate.ml b/src/generate.ml index 59b5e2026..0720e1a9b 100644 --- a/src/generate.ml +++ b/src/generate.ml @@ -43,6 +43,13 @@ let is_list ~shapes ~shp = | _ -> false with Not_found -> false +let is_flat_list ~shapes ~shp = + try + match (StringTable.find shp shapes).Shape.content with + | Shape.List (_,_,true) -> true + | _ -> false + with Not_found -> false + let toposort (shapes : Shape.t StringTable.t) = let open Graph in let module G = Imperative.Digraph.ConcreteBidirectional(struct @@ -62,7 +69,7 @@ let toposort (shapes : Shape.t StringTable.t) = match data.Shape.content with | Shape.Structure members -> List.iter (fun mem -> add_edge data mem.Structure.shape) members - | Shape.List (s,_) -> add_edge data s + | Shape.List (s,_,_) -> add_edge data s | Shape.Map ((ks,_), (vs,_)) -> add_edge data ks; add_edge data vs | Shape.Enum _ -> ()) shapes; @@ -90,7 +97,7 @@ let types is_ec2 shapes = mkrecty (List.map (fun m -> (m.Structure.field_name, m.Structure.shape ^ ".t", m.Structure.required || is_list ~shapes ~shp:m.Structure.shape)) members) - | Shape.List (shp, _) -> + | Shape.List (shp, _, _flatten) -> Syntax.tylet "t" (Syntax.ty1 "list" (shp ^ ".t")) | Shape.Map ((kshp, _loc), (vshp, _)) -> Syntax.tylet "t" (Syntax.ty2 "Hashtbl.t" (kshp ^ ".t") (vshp ^ ".t")) @@ -123,7 +130,19 @@ let types is_ec2 shapes = | Shape.Enum opts -> [let_ "str_to_t" (list (List.map (fun o -> pair (str o) (ident (Util.to_variant_name o))) opts)); let_ "t_to_str" - (list (List.map (fun o -> pair (ident (Util.to_variant_name o)) (str o)) opts)) + (list (List.map (fun o -> pair (ident (Util.to_variant_name o)) (str o)) opts)); + let_ "to_string" + (fun_ "e" + (app1 "Util.of_option_exn" + (app2 "Util.list_find" + (ident "t_to_str") + (ident "e")))); + let_ "of_string" + (fun_ "s" + (app1 "Util.of_option_exn" + (app2 "Util.list_find" + (ident "str_to_t") + (ident "s")))) ] | _ -> [] in @@ -137,7 +156,13 @@ let types is_ec2 shapes = | Some name -> name | None -> mem.Structure.name in - let b = Syntax.(app2 "Util.option_bind" + let b = if is_flat_list ~shapes ~shp:mem.Structure.shape then + Syntax.( + (app1 (mem.Structure.shape ^ ".parse") + (ident "xml")) + ) + else + Syntax.(app2 "Util.option_bind" (app2 "Xml.member" (str loc_name) (ident "xml")) (ident (mem.Structure.shape ^ ".parse"))) in @@ -157,16 +182,16 @@ let types is_ec2 shapes = Syntax.(let_ "parse" (fun_ "xml" (ident "None"))) - | Shape.List (shp, loc_name) -> + | Shape.List (shp, loc_name, _flatten) -> let item_name = match loc_name with | None -> "member" | Some nm -> nm in - Syntax.(let_ "parse" - (fun_ "xml" - (app1 "Util.option_all" - (app2 "List.map" - (ident (shp ^ ".parse")) - (app2 "Xml.members" (str item_name) (ident "xml")))))) + Syntax.(let_ "parse" + (fun_ "xml" + (app1 "Util.option_all" + (app2 "List.map" + (ident (shp ^ ".parse")) + (app2 "Xml.members" (str item_name) (ident "xml")))))) | Shape.Enum _opts -> Syntax.(let_ "parse" (fun_ "xml" @@ -201,10 +226,10 @@ let types is_ec2 shapes = then app1 "Some" (q (ident ("v." ^ mem.Structure.field_name))) else app2 "Util.option_map" (ident ("v." ^ mem.Structure.field_name)) (fun_ "f" (q (ident "f"))))) s)))) - | Shape.List (shp,_) -> + | Shape.List (shp,_,_flatten) -> (app2 "Query.to_query_list" (ident (shp ^ ".to_query")) (ident "v")) - | Shape.Map ((shp,_),_) -> - (app2 "Query.to_query_hashtbl" (ident (shp ^ ".to_query")) (ident "v")) + | Shape.Map ((key_shp,_),(val_shp,_)) -> + (app3 "Query.to_query_hashtbl" (ident (key_shp ^ ".to_string")) (ident (val_shp ^ ".to_query")) (ident "v")) | Shape.Enum _ -> (app1 "Query.Value" (app1 "Some" @@ -232,16 +257,16 @@ let types is_ec2 shapes = (fun_ "f" (q (ident "f"))) ) s)))) - | Shape.List (shp,_) -> + | Shape.List (shp,_,_flatten) -> (variant1 "List" (app2 "List.map" (ident (shp ^ ".to_json")) (ident "v"))) - | Shape.Map ((_,_),_) -> + | Shape.Map ((key_shp,_),(val_shp,_)) -> (variant1 "Assoc" (app3 "Hashtbl.fold" (fun3 "k" "v" "acc" - (list_expr (pair (ident "k") (app1 "String.to_json" (ident "v"))) (ident "acc"))) + (list_expr (pair (app1 (key_shp ^ ".to_string") (ident "k")) (app1 (val_shp ^ ".to_json") (ident "v"))) (ident "acc"))) (ident "v") (list []))) | Shape.Enum _ -> @@ -268,8 +293,8 @@ let types is_ec2 shapes = else fun v -> app2 "Util.option_map" v (ident (mem.Structure.shape ^ ".of_json"))) (app2 "Json.lookup" (ident "j") (str mem.Structure.field_name)))) s) - | Shape.List (shp,_) -> app2 "Json.to_list" (ident (shp ^ ".of_json")) (ident "j") - | Shape.Map ((_kshp,_),(vshp,_)) -> app2 "Json.to_hashtbl" (ident (vshp ^ ".of_json")) (ident "j") + | Shape.List (shp,_,_flatten) -> app2 "Json.to_list" (ident (shp ^ ".of_json")) (ident "j") + | Shape.Map ((key_shp,_),(val_shp,_)) -> app3 "Json.to_hashtbl" (ident (key_shp ^ ".of_string")) (ident (val_shp ^ ".of_json")) (ident "j") | Shape.Enum _ -> (app1 "Util.of_option_exn" (app2 "Util.list_find" @@ -302,7 +327,8 @@ let op service version _shapes op = letin "uri" (app2 "Uri.add_query_params" - (app1 "Uri.of_string" (str ("https://" ^ service ^ ".amazonaws.com"))) + (app1 "Uri.of_string" + (app1 "Aws.Util.of_option_exn" (app2 "Endpoints.url_of" (ident "service") (ident "region")))) (match op.Operation.input_shape with | None -> defaults | Some input_shape -> @@ -376,7 +402,7 @@ let op service version _shapes op = ; tylet "output" (mkty op.Operation.output_shape) ; tylet "error" (ty0 "Errors_internal.t") ; let_ "service" (str service) - ; let_ "to_http" (fun_ "req" to_body) + ; let_ "to_http" (fun3 "service" "region" "req" to_body) ; let_ "of_http" (fun_ "body" of_body) ; let_ "parse_error" (fun2 "code" "err" op_error_parse) ]) diff --git a/src/reading.ml b/src/reading.ml index eaeab6209..75f8ef58f 100644 --- a/src/reading.ml +++ b/src/reading.ml @@ -74,13 +74,16 @@ let shape ((nm, j) : (string * Yojson.Basic.t)) : Shape.parsed = (nm, "structure", Some (Shape.Structure (List.map (parse_member required) member))) | `String "list" -> let member = Json.member_exn "member" j in + let flattened = match Json.member "flattened" j with + | `Bool true -> true + | _ -> false in let shape = Json.member_exn "shape" member |> Json.to_string in let loc_name = match Json.member "locationName" member with | `Null -> None | loc_name -> Some (Json.to_string loc_name) in - (nm, "list", Some (Shape.List(shape, loc_name))) + (nm, "list", Some (Shape.List(shape, loc_name, flattened))) | `String "map" -> let key = Json.member_exn "key" j in let key_shape = Json.member_exn "shape" key |> Json.to_string in diff --git a/src/structures.ml b/src/structures.ml index 8d69eb817..803c03a42 100644 --- a/src/structures.ml +++ b/src/structures.ml @@ -13,7 +13,7 @@ end module Shape = struct type contents = | Structure of Structure.member list - | List of string * string option + | List of string * string option * bool | Enum of string list | Map of (string * string option) * (string * string option) diff --git a/src/structures.mli b/src/structures.mli index 550dba542..13cae858d 100644 --- a/src/structures.mli +++ b/src/structures.mli @@ -86,7 +86,7 @@ module Shape : sig type contents = | Structure of Structure.member list - | List of string * string option + | List of string * string option * bool | Enum of string list | Map of (string * string option) * (string * string option) diff --git a/src/util.ml b/src/util.ml index 1f5d8d94f..570fc50dd 100644 --- a/src/util.ml +++ b/src/util.ml @@ -205,8 +205,8 @@ let inline_shapes (ops : Operation.t list) (shapes : Shape.parsed StringTable.t) Shape.Structure (List.map (fun member -> { member with Structure.shape = replace_shape member.Structure.shape }) ms) - | Some (Shape.List (shp, ln)) -> - Shape.List (replace_shape shp, ln) + | Some (Shape.List (shp, ln, flatten)) -> + Shape.List (replace_shape shp, ln, flatten) | Some (Shape.Map ((kshp, kln), (vshp, vln))) -> Shape.Map ((replace_shape kshp, kln), (replace_shape vshp, vln)) | Some (Shape.Enum opts) -> Shape.Enum opts