/
api_gateway.jl
4884 lines (4415 loc) · 158 KB
/
api_gateway.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: api_gateway
using AWS.Compat
using AWS.UUIDs
"""
create_api_key()
create_api_key(params::Dict{String,<:Any})
Create an ApiKey resource.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"customerId"`: An AWS Marketplace customer identifier , when integrating with the AWS
SaaS Marketplace.
- `"description"`: The description of the ApiKey.
- `"enabled"`: Specifies whether the ApiKey can be used by callers.
- `"generateDistinctId"`: Specifies whether (true) or not (false) the key identifier is
distinct from the created API key value. This parameter is deprecated and should not be
used.
- `"name"`: The name of the ApiKey.
- `"stageKeys"`: DEPRECATED FOR USAGE PLANS - Specifies stages associated with the API key.
- `"tags"`: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The
tag key can be up to 128 characters and must not start with aws:. The tag value can be up
to 256 characters.
- `"value"`: Specifies a value of the API key.
"""
function create_api_key(; aws_config::AbstractAWSConfig=global_aws_config())
return api_gateway(
"POST", "/apikeys"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
function create_api_key(
params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST", "/apikeys", params; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
)
end
"""
create_authorizer(name, restapi_id, type)
create_authorizer(name, restapi_id, type, params::Dict{String,<:Any})
Adds a new Authorizer resource to an existing RestApi resource.
# Arguments
- `name`: The name of the authorizer.
- `restapi_id`: The string identifier of the associated RestApi.
- `type`: The authorizer type. Valid values are TOKEN for a Lambda function using a single
authorization token submitted in a custom header, REQUEST for a Lambda function using
incoming request parameters, and COGNITO_USER_POOLS for using an Amazon Cognito user pool.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"authType"`: Optional customer-defined field, used in OpenAPI imports and exports
without functional impact.
- `"authorizerCredentials"`: Specifies the required credentials as an IAM role for API
Gateway to invoke the authorizer. To specify an IAM role for API Gateway to assume, use the
role's Amazon Resource Name (ARN). To use resource-based permissions on the Lambda
function, specify null.
- `"authorizerResultTtlInSeconds"`: The TTL in seconds of cached authorizer results. If it
equals 0, authorization caching is disabled. If it is greater than 0, API Gateway will
cache authorizer responses. If this field is not set, the default value is 300. The maximum
value is 3600, or 1 hour.
- `"authorizerUri"`: Specifies the authorizer's Uniform Resource Identifier (URI). For
TOKEN or REQUEST authorizers, this must be a well-formed Lambda function URI, for example,
arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:{acco
unt_id}:function:{lambda_function_name}/invocations. In general, the URI has this form
arn:aws:apigateway:{region}:lambda:path/{service_api}, where {region} is the same as the
region hosting the Lambda function, path indicates that the remaining substring in the URI
should be treated as the path to the resource, including the initial /. For Lambda
functions, this is usually of the form /2015-03-31/functions/[FunctionARN]/invocations.
- `"identitySource"`: The identity source for which authorization is requested. For a TOKEN
or COGNITO_USER_POOLS authorizer, this is required and specifies the request header mapping
expression for the custom header holding the authorization token submitted by the client.
For example, if the token header name is Auth, the header mapping expression is
method.request.header.Auth. For the REQUEST authorizer, this is required when authorization
caching is enabled. The value is a comma-separated string of one or more mapping
expressions of the specified request parameters. For example, if an Auth header, a Name
query string parameter are defined as identity sources, this value is
method.request.header.Auth, method.request.querystring.Name. These parameters will be used
to derive the authorization caching key and to perform runtime validation of the REQUEST
authorizer by verifying all of the identity-related request parameters are present, not
null and non-empty. Only when this is true does the authorizer invoke the authorizer Lambda
function, otherwise, it returns a 401 Unauthorized response without calling the Lambda
function. The valid value is a string of comma-separated mapping expressions of the
specified request parameters. When the authorization caching is not enabled, this property
is optional.
- `"identityValidationExpression"`: A validation expression for the incoming identity
token. For TOKEN authorizers, this value is a regular expression. For COGNITO_USER_POOLS
authorizers, API Gateway will match the aud field of the incoming token from the client
against the specified regular expression. It will invoke the authorizer's Lambda function
when there is a match. Otherwise, it will return a 401 Unauthorized response without
calling the Lambda function. The validation expression does not apply to the REQUEST
authorizer.
- `"providerARNs"`: A list of the Amazon Cognito user pool ARNs for the COGNITO_USER_POOLS
authorizer. Each element is of this format:
arn:aws:cognito-idp:{region}:{account_id}:userpool/{user_pool_id}. For a TOKEN or REQUEST
authorizer, this is not defined.
"""
function create_authorizer(
name, restapi_id, type; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/authorizers",
Dict{String,Any}("name" => name, "type" => type);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_authorizer(
name,
restapi_id,
type,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/authorizers",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("name" => name, "type" => type), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_base_path_mapping(domain_name, rest_api_id)
create_base_path_mapping(domain_name, rest_api_id, params::Dict{String,<:Any})
Creates a new BasePathMapping resource.
# Arguments
- `domain_name`: The domain name of the BasePathMapping resource to create.
- `rest_api_id`: The string identifier of the associated RestApi.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"basePath"`: The base path name that callers of the API must provide as part of the URL
after the domain name. This value must be unique for all of the mappings across a single
API. Specify '(none)' if you do not want callers to specify a base path name after the
domain name.
- `"stage"`: The name of the API's stage that you want to use for this mapping. Specify
'(none)' if you want callers to explicitly specify the stage name after any base path name.
"""
function create_base_path_mapping(
domain_name, restApiId; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/domainnames/$(domain_name)/basepathmappings",
Dict{String,Any}("restApiId" => restApiId);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_base_path_mapping(
domain_name,
restApiId,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/domainnames/$(domain_name)/basepathmappings",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("restApiId" => restApiId), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_deployment(restapi_id)
create_deployment(restapi_id, params::Dict{String,<:Any})
Creates a Deployment resource, which makes a specified RestApi callable over the internet.
# Arguments
- `restapi_id`: The string identifier of the associated RestApi.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"cacheClusterEnabled"`: Enables a cache cluster for the Stage resource specified in the
input.
- `"cacheClusterSize"`: The stage's cache capacity in GB. For more information about
choosing a cache size, see Enabling API caching to enhance responsiveness.
- `"canarySettings"`: The input configuration for the canary deployment when the deployment
is a canary release deployment.
- `"description"`: The description for the Deployment resource to create.
- `"stageDescription"`: The description of the Stage resource for the Deployment resource
to create.
- `"stageName"`: The name of the Stage resource for the Deployment resource to create.
- `"tracingEnabled"`: Specifies whether active tracing with X-ray is enabled for the Stage.
- `"variables"`: A map that defines the stage variables for the Stage resource that is
associated with the new deployment. Variable names can have alphanumeric and underscore
characters, and the values must match [A-Za-z0-9-._~:/?#&=,]+.
"""
function create_deployment(restapi_id; aws_config::AbstractAWSConfig=global_aws_config())
return api_gateway(
"POST",
"/restapis/$(restapi_id)/deployments";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_deployment(
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/deployments",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_documentation_part(location, properties, restapi_id)
create_documentation_part(location, properties, restapi_id, params::Dict{String,<:Any})
Creates a documentation part.
# Arguments
- `location`: The location of the targeted API entity of the to-be-created documentation
part.
- `properties`: The new documentation content map of the targeted API entity. Enclosed
key-value pairs are API-specific, but only OpenAPI-compliant key-value pairs can be
exported and, hence, published.
- `restapi_id`: The string identifier of the associated RestApi.
"""
function create_documentation_part(
location, properties, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/documentation/parts",
Dict{String,Any}("location" => location, "properties" => properties);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_documentation_part(
location,
properties,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/documentation/parts",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}("location" => location, "properties" => properties),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_documentation_version(documentation_version, restapi_id)
create_documentation_version(documentation_version, restapi_id, params::Dict{String,<:Any})
Creates a documentation version
# Arguments
- `documentation_version`: The version identifier of the new snapshot.
- `restapi_id`: The string identifier of the associated RestApi.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"description"`: A description about the new documentation snapshot.
- `"stageName"`: The stage name to be associated with the new documentation snapshot.
"""
function create_documentation_version(
documentationVersion, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/documentation/versions",
Dict{String,Any}("documentationVersion" => documentationVersion);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_documentation_version(
documentationVersion,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/documentation/versions",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}("documentationVersion" => documentationVersion),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_domain_name(domain_name)
create_domain_name(domain_name, params::Dict{String,<:Any})
Creates a new domain name.
# Arguments
- `domain_name`: The name of the DomainName resource.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"certificateArn"`: The reference to an AWS-managed certificate that will be used by
edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported
source.
- `"certificateBody"`: [Deprecated] The body of the server certificate that will be used by
edge-optimized endpoint for this domain name provided by your certificate authority.
- `"certificateChain"`: [Deprecated] The intermediate certificates and optionally the root
certificate, one after the other without any blank lines, used by an edge-optimized
endpoint for this domain name. If you include the root certificate, your certificate chain
must start with intermediate certificates and end with the root certificate. Use the
intermediate certificates that were provided by your certificate authority. Do not include
any intermediaries that are not in the chain of trust path.
- `"certificateName"`: The user-friendly name of the certificate that will be used by
edge-optimized endpoint for this domain name.
- `"certificatePrivateKey"`: [Deprecated] Your edge-optimized endpoint's domain name
certificate's private key.
- `"endpointConfiguration"`: The endpoint configuration of this DomainName showing the
endpoint types of the domain name.
- `"mutualTlsAuthentication"`:
- `"ownershipVerificationCertificateArn"`: The ARN of the public certificate issued by ACM
to validate ownership of your custom domain. Only required when configuring mutual TLS and
using an ACM imported or private CA certificate ARN as the regionalCertificateArn.
- `"regionalCertificateArn"`: The reference to an AWS-managed certificate that will be used
by regional endpoint for this domain name. AWS Certificate Manager is the only supported
source.
- `"regionalCertificateName"`: The user-friendly name of the certificate that will be used
by regional endpoint for this domain name.
- `"securityPolicy"`: The Transport Layer Security (TLS) version + cipher suite for this
DomainName. The valid values are TLS_1_0 and TLS_1_2.
- `"tags"`: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The
tag key can be up to 128 characters and must not start with aws:. The tag value can be up
to 256 characters.
"""
function create_domain_name(domainName; aws_config::AbstractAWSConfig=global_aws_config())
return api_gateway(
"POST",
"/domainnames",
Dict{String,Any}("domainName" => domainName);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_domain_name(
domainName,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/domainnames",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("domainName" => domainName), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_model(content_type, name, restapi_id)
create_model(content_type, name, restapi_id, params::Dict{String,<:Any})
Adds a new Model resource to an existing RestApi resource.
# Arguments
- `content_type`: The content-type for the model.
- `name`: The name of the model. Must be alphanumeric.
- `restapi_id`: The RestApi identifier under which the Model will be created.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"description"`: The description of the model.
- `"schema"`: The schema for the model. For application/json models, this should be JSON
schema draft 4 model.
"""
function create_model(
contentType, name, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/models",
Dict{String,Any}("contentType" => contentType, "name" => name);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_model(
contentType,
name,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/models",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}("contentType" => contentType, "name" => name),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_request_validator(restapi_id)
create_request_validator(restapi_id, params::Dict{String,<:Any})
Creates a RequestValidator of a given RestApi.
# Arguments
- `restapi_id`: The string identifier of the associated RestApi.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"name"`: The name of the to-be-created RequestValidator.
- `"validateRequestBody"`: A Boolean flag to indicate whether to validate request body
according to the configured model schema for the method (true) or not (false).
- `"validateRequestParameters"`: A Boolean flag to indicate whether to validate request
parameters, true, or not false.
"""
function create_request_validator(
restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/requestvalidators";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_request_validator(
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/requestvalidators",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_resource(parent_id, path_part, restapi_id)
create_resource(parent_id, path_part, restapi_id, params::Dict{String,<:Any})
Creates a Resource resource.
# Arguments
- `parent_id`: The parent resource's identifier.
- `path_part`: The last path segment for this resource.
- `restapi_id`: The string identifier of the associated RestApi.
"""
function create_resource(
parent_id, pathPart, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/resources/$(parent_id)",
Dict{String,Any}("pathPart" => pathPart);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_resource(
parent_id,
pathPart,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/resources/$(parent_id)",
Dict{String,Any}(
mergewith(_merge, Dict{String,Any}("pathPart" => pathPart), params)
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_rest_api(name)
create_rest_api(name, params::Dict{String,<:Any})
Creates a new RestApi resource.
# Arguments
- `name`: The name of the RestApi.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"apiKeySource"`: The source of the API key for metering requests according to a usage
plan. Valid values are: >HEADER to read the API key from the X-API-Key header of a
request. AUTHORIZER to read the API key from the UsageIdentifierKey from a custom
authorizer.
- `"binaryMediaTypes"`: The list of binary media types supported by the RestApi. By
default, the RestApi supports only UTF-8-encoded text payloads.
- `"cloneFrom"`: The ID of the RestApi that you want to clone from.
- `"description"`: The description of the RestApi.
- `"disableExecuteApiEndpoint"`: Specifies whether clients can invoke your API by using the
default execute-api endpoint. By default, clients can invoke your API with the default
https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a
custom domain name to invoke your API, disable the default endpoint
- `"endpointConfiguration"`: The endpoint configuration of this RestApi showing the
endpoint types of the API.
- `"minimumCompressionSize"`: A nullable integer that is used to enable compression (with
non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a
null value) on an API. When compression is enabled, compression or decompression is not
applied on the payload if the payload size is smaller than this value. Setting it to zero
allows compression for any payload size.
- `"policy"`: A stringified JSON policy document that applies to this RestApi regardless of
the caller and Method configuration.
- `"tags"`: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The
tag key can be up to 128 characters and must not start with aws:. The tag value can be up
to 256 characters.
- `"version"`: A version identifier for the API.
"""
function create_rest_api(name; aws_config::AbstractAWSConfig=global_aws_config())
return api_gateway(
"POST",
"/restapis",
Dict{String,Any}("name" => name);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_rest_api(
name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis",
Dict{String,Any}(mergewith(_merge, Dict{String,Any}("name" => name), params));
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_stage(deployment_id, restapi_id, stage_name)
create_stage(deployment_id, restapi_id, stage_name, params::Dict{String,<:Any})
Creates a new Stage resource that references a pre-existing Deployment for the API.
# Arguments
- `deployment_id`: The identifier of the Deployment resource for the Stage resource.
- `restapi_id`: The string identifier of the associated RestApi.
- `stage_name`: The name for the Stage resource. Stage names can only contain alphanumeric
characters, hyphens, and underscores. Maximum length is 128 characters.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"cacheClusterEnabled"`: Whether cache clustering is enabled for the stage.
- `"cacheClusterSize"`: The stage's cache capacity in GB. For more information about
choosing a cache size, see Enabling API caching to enhance responsiveness.
- `"canarySettings"`: The canary deployment settings of this stage.
- `"description"`: The description of the Stage resource.
- `"documentationVersion"`: The version of the associated API documentation.
- `"tags"`: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The
tag key can be up to 128 characters and must not start with aws:. The tag value can be up
to 256 characters.
- `"tracingEnabled"`: Specifies whether active tracing with X-ray is enabled for the Stage.
- `"variables"`: A map that defines the stage variables for the new Stage resource.
Variable names can have alphanumeric and underscore characters, and the values must match
[A-Za-z0-9-._~:/?#&=,]+.
"""
function create_stage(
deploymentId, restapi_id, stageName; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/stages",
Dict{String,Any}("deploymentId" => deploymentId, "stageName" => stageName);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_stage(
deploymentId,
restapi_id,
stageName,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/restapis/$(restapi_id)/stages",
Dict{String,Any}(
mergewith(
_merge,
Dict{String,Any}("deploymentId" => deploymentId, "stageName" => stageName),
params,
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_usage_plan(name)
create_usage_plan(name, params::Dict{String,<:Any})
Creates a usage plan with the throttle and quota limits, as well as the associated API
stages, specified in the payload.
# Arguments
- `name`: The name of the usage plan.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"apiStages"`: The associated API stages of the usage plan.
- `"description"`: The description of the usage plan.
- `"quota"`: The quota of the usage plan.
- `"tags"`: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The
tag key can be up to 128 characters and must not start with aws:. The tag value can be up
to 256 characters.
- `"throttle"`: The throttling limits of the usage plan.
"""
function create_usage_plan(name; aws_config::AbstractAWSConfig=global_aws_config())
return api_gateway(
"POST",
"/usageplans",
Dict{String,Any}("name" => name);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_usage_plan(
name, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/usageplans",
Dict{String,Any}(mergewith(_merge, Dict{String,Any}("name" => name), params));
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_usage_plan_key(key_id, key_type, usageplan_id)
create_usage_plan_key(key_id, key_type, usageplan_id, params::Dict{String,<:Any})
Creates a usage plan key for adding an existing API key to a usage plan.
# Arguments
- `key_id`: The identifier of a UsagePlanKey resource for a plan customer.
- `key_type`: The type of a UsagePlanKey resource for a plan customer.
- `usageplan_id`: The Id of the UsagePlan resource representing the usage plan containing
the to-be-created UsagePlanKey resource representing a plan customer.
"""
function create_usage_plan_key(
keyId, keyType, usageplanId; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/usageplans/$(usageplanId)/keys",
Dict{String,Any}("keyId" => keyId, "keyType" => keyType);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_usage_plan_key(
keyId,
keyType,
usageplanId,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/usageplans/$(usageplanId)/keys",
Dict{String,Any}(
mergewith(
_merge, Dict{String,Any}("keyId" => keyId, "keyType" => keyType), params
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
create_vpc_link(name, target_arns)
create_vpc_link(name, target_arns, params::Dict{String,<:Any})
Creates a VPC link, under the caller's account in a selected region, in an asynchronous
operation that typically takes 2-4 minutes to complete and become operational. The caller
must have permissions to create and update VPC Endpoint services.
# Arguments
- `name`: The name used to label and identify the VPC link.
- `target_arns`: The ARN of the network load balancer of the VPC targeted by the VPC link.
The network load balancer must be owned by the same AWS account of the API owner.
# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"description"`: The description of the VPC link.
- `"tags"`: The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The
tag key can be up to 128 characters and must not start with aws:. The tag value can be up
to 256 characters.
"""
function create_vpc_link(
name, targetArns; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"POST",
"/vpclinks",
Dict{String,Any}("name" => name, "targetArns" => targetArns);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function create_vpc_link(
name,
targetArns,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"POST",
"/vpclinks",
Dict{String,Any}(
mergewith(
_merge, Dict{String,Any}("name" => name, "targetArns" => targetArns), params
),
);
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_api_key(api__key)
delete_api_key(api__key, params::Dict{String,<:Any})
Deletes the ApiKey resource.
# Arguments
- `api__key`: The identifier of the ApiKey resource to be deleted.
"""
function delete_api_key(api_Key; aws_config::AbstractAWSConfig=global_aws_config())
return api_gateway(
"DELETE",
"/apikeys/$(api_Key)";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_api_key(
api_Key, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"DELETE",
"/apikeys/$(api_Key)",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_authorizer(authorizer_id, restapi_id)
delete_authorizer(authorizer_id, restapi_id, params::Dict{String,<:Any})
Deletes an existing Authorizer resource.
# Arguments
- `authorizer_id`: The identifier of the Authorizer resource.
- `restapi_id`: The string identifier of the associated RestApi.
"""
function delete_authorizer(
authorizer_id, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"DELETE",
"/restapis/$(restapi_id)/authorizers/$(authorizer_id)";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_authorizer(
authorizer_id,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"DELETE",
"/restapis/$(restapi_id)/authorizers/$(authorizer_id)",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_base_path_mapping(base_path, domain_name)
delete_base_path_mapping(base_path, domain_name, params::Dict{String,<:Any})
Deletes the BasePathMapping resource.
# Arguments
- `base_path`: The base path name of the BasePathMapping resource to delete. To specify an
empty base path, set this parameter to '(none)'.
- `domain_name`: The domain name of the BasePathMapping resource to delete.
"""
function delete_base_path_mapping(
base_path, domain_name; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"DELETE",
"/domainnames/$(domain_name)/basepathmappings/$(base_path)";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_base_path_mapping(
base_path,
domain_name,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"DELETE",
"/domainnames/$(domain_name)/basepathmappings/$(base_path)",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_client_certificate(clientcertificate_id)
delete_client_certificate(clientcertificate_id, params::Dict{String,<:Any})
Deletes the ClientCertificate resource.
# Arguments
- `clientcertificate_id`: The identifier of the ClientCertificate resource to be deleted.
"""
function delete_client_certificate(
clientcertificate_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"DELETE",
"/clientcertificates/$(clientcertificate_id)";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_client_certificate(
clientcertificate_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"DELETE",
"/clientcertificates/$(clientcertificate_id)",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_deployment(deployment_id, restapi_id)
delete_deployment(deployment_id, restapi_id, params::Dict{String,<:Any})
Deletes a Deployment resource. Deleting a deployment will only succeed if there are no
Stage resources associated with it.
# Arguments
- `deployment_id`: The identifier of the Deployment resource to delete.
- `restapi_id`: The string identifier of the associated RestApi.
"""
function delete_deployment(
deployment_id, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"DELETE",
"/restapis/$(restapi_id)/deployments/$(deployment_id)";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_deployment(
deployment_id,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"DELETE",
"/restapis/$(restapi_id)/deployments/$(deployment_id)",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_documentation_part(part_id, restapi_id)
delete_documentation_part(part_id, restapi_id, params::Dict{String,<:Any})
Deletes a documentation part
# Arguments
- `part_id`: The identifier of the to-be-deleted documentation part.
- `restapi_id`: The string identifier of the associated RestApi.
"""
function delete_documentation_part(
part_id, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(
"DELETE",
"/restapis/$(restapi_id)/documentation/parts/$(part_id)";
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
function delete_documentation_part(
part_id,
restapi_id,
params::AbstractDict{String};
aws_config::AbstractAWSConfig=global_aws_config(),
)
return api_gateway(
"DELETE",
"/restapis/$(restapi_id)/documentation/parts/$(part_id)",
params;
aws_config=aws_config,
feature_set=SERVICE_FEATURE_SET,
)
end
"""
delete_documentation_version(doc_version, restapi_id)
delete_documentation_version(doc_version, restapi_id, params::Dict{String,<:Any})
Deletes a documentation version.
# Arguments
- `doc_version`: The version identifier of a to-be-deleted documentation snapshot.
- `restapi_id`: The string identifier of the associated RestApi.
"""
function delete_documentation_version(
doc_version, restapi_id; aws_config::AbstractAWSConfig=global_aws_config()
)
return api_gateway(