Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.
Synopsis
- data PutRestApi = PutRestApi' {
- failOnWarnings :: Maybe Bool
- mode :: Maybe PutMode
- parameters :: Maybe (HashMap Text Text)
- restApiId :: Text
- body :: ByteString
- newPutRestApi :: Text -> ByteString -> PutRestApi
- putRestApi_failOnWarnings :: Lens' PutRestApi (Maybe Bool)
- putRestApi_mode :: Lens' PutRestApi (Maybe PutMode)
- putRestApi_parameters :: Lens' PutRestApi (Maybe (HashMap Text Text))
- putRestApi_restApiId :: Lens' PutRestApi Text
- putRestApi_body :: Lens' PutRestApi ByteString
- data RestApi = RestApi' {
- apiKeySource :: Maybe ApiKeySourceType
- binaryMediaTypes :: Maybe [Text]
- createdDate :: Maybe POSIX
- description :: Maybe Text
- disableExecuteApiEndpoint :: Maybe Bool
- endpointConfiguration :: Maybe EndpointConfiguration
- id :: Maybe Text
- minimumCompressionSize :: Maybe Int
- name :: Maybe Text
- policy :: Maybe Text
- tags :: Maybe (HashMap Text Text)
- version :: Maybe Text
- warnings :: Maybe [Text]
- newRestApi :: RestApi
- restApi_apiKeySource :: Lens' RestApi (Maybe ApiKeySourceType)
- restApi_binaryMediaTypes :: Lens' RestApi (Maybe [Text])
- restApi_createdDate :: Lens' RestApi (Maybe UTCTime)
- restApi_description :: Lens' RestApi (Maybe Text)
- restApi_disableExecuteApiEndpoint :: Lens' RestApi (Maybe Bool)
- restApi_endpointConfiguration :: Lens' RestApi (Maybe EndpointConfiguration)
- restApi_id :: Lens' RestApi (Maybe Text)
- restApi_minimumCompressionSize :: Lens' RestApi (Maybe Int)
- restApi_name :: Lens' RestApi (Maybe Text)
- restApi_policy :: Lens' RestApi (Maybe Text)
- restApi_tags :: Lens' RestApi (Maybe (HashMap Text Text))
- restApi_version :: Lens' RestApi (Maybe Text)
- restApi_warnings :: Lens' RestApi (Maybe [Text])
Creating a Request
data PutRestApi Source #
A PUT request to update an existing API, with external API definitions specified as the request body.
See: newPutRestApi
smart constructor.
PutRestApi' | |
|
Instances
Create a value of PutRestApi
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:failOnWarnings:PutRestApi'
, putRestApi_failOnWarnings
- A query parameter to indicate whether to rollback the API update
(true
) or not (false
) when a warning is encountered. The default
value is false
.
$sel:mode:PutRestApi'
, putRestApi_mode
- The mode
query parameter to specify the update mode. Valid values are
"merge" and "overwrite". By default, the update mode is "merge".
$sel:parameters:PutRestApi'
, putRestApi_parameters
- Custom header parameters as part of the request. For example, to exclude
DocumentationParts from an imported API, set ignore=documentation
as a
parameters
value, as in the AWS CLI command of
aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
.
PutRestApi
, putRestApi_restApiId
- The string identifier of the associated RestApi.
$sel:body:PutRestApi'
, putRestApi_body
- The PUT request body containing external API definitions. Currently,
only OpenAPI definition JSON/YAML files are supported. The maximum size
of the API definition file is 6MB.
Request Lenses
putRestApi_failOnWarnings :: Lens' PutRestApi (Maybe Bool) Source #
A query parameter to indicate whether to rollback the API update
(true
) or not (false
) when a warning is encountered. The default
value is false
.
putRestApi_mode :: Lens' PutRestApi (Maybe PutMode) Source #
The mode
query parameter to specify the update mode. Valid values are
"merge" and "overwrite". By default, the update mode is "merge".
putRestApi_parameters :: Lens' PutRestApi (Maybe (HashMap Text Text)) Source #
Custom header parameters as part of the request. For example, to exclude
DocumentationParts from an imported API, set ignore=documentation
as a
parameters
value, as in the AWS CLI command of
aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
.
putRestApi_restApiId :: Lens' PutRestApi Text Source #
The string identifier of the associated RestApi.
putRestApi_body :: Lens' PutRestApi ByteString Source #
The PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.
Destructuring the Response
Represents a REST API.
See: newRestApi
smart constructor.
RestApi' | |
|
Instances
newRestApi :: RestApi Source #
Create a value of RestApi
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:apiKeySource:RestApi'
, restApi_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.
$sel:binaryMediaTypes:RestApi'
, restApi_binaryMediaTypes
- The list of binary media types supported by the RestApi. By default, the
RestApi supports only UTF-8-encoded text payloads.
$sel:createdDate:RestApi'
, restApi_createdDate
- The timestamp when the API was created.
$sel:description:RestApi'
, restApi_description
- The API's description.
$sel:disableExecuteApiEndpoint:RestApi'
, 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.
$sel:endpointConfiguration:RestApi'
, restApi_endpointConfiguration
- The endpoint configuration of this RestApi showing the endpoint types of
the API.
$sel:id:RestApi'
, restApi_id
- The API's identifier. This identifier is unique across all of your APIs
in API Gateway.
$sel:minimumCompressionSize:RestApi'
, restApi_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.
$sel:name:RestApi'
, restApi_name
- The API's name.
$sel:policy:RestApi'
, restApi_policy
- A stringified JSON policy document that applies to this RestApi
regardless of the caller and Method configuration.
$sel:tags:RestApi'
, restApi_tags
- The collection of tags. Each tag element is associated with a given
resource.
$sel:version:RestApi'
, restApi_version
- A version identifier for the API.
$sel:warnings:RestApi'
, restApi_warnings
- The warning messages reported when failonwarnings
is turned on during
API import.
Response Lenses
restApi_apiKeySource :: Lens' RestApi (Maybe ApiKeySourceType) Source #
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.
restApi_binaryMediaTypes :: Lens' RestApi (Maybe [Text]) Source #
The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
restApi_createdDate :: Lens' RestApi (Maybe UTCTime) Source #
The timestamp when the API was created.
restApi_disableExecuteApiEndpoint :: Lens' RestApi (Maybe Bool) Source #
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.
restApi_endpointConfiguration :: Lens' RestApi (Maybe EndpointConfiguration) Source #
The endpoint configuration of this RestApi showing the endpoint types of the API.
restApi_id :: Lens' RestApi (Maybe Text) Source #
The API's identifier. This identifier is unique across all of your APIs in API Gateway.
restApi_minimumCompressionSize :: Lens' RestApi (Maybe Int) Source #
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.
restApi_policy :: Lens' RestApi (Maybe Text) Source #
A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.