libZSservicesZSamazonka-apigatewayZSamazonka-apigateway
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.APIGateway.ImportRestApi

Description

A feature of the API Gateway control service for creating a new API from an external API definition file.

Synopsis

Creating a Request

data ImportRestApi Source #

A POST request to import an API to API Gateway using an input of an API definition file.

See: newImportRestApi smart constructor.

Constructors

ImportRestApi' 

Fields

  • failOnWarnings :: Maybe Bool

    A query parameter to indicate whether to rollback the API creation (true) or not (false) when a warning is encountered. The default value is false.

  • parameters :: Maybe (HashMap Text Text)

    A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.

    To exclude DocumentationParts from the import, set parameters as ignore=documentation.

    To configure the endpoint type, set parameters as endpointConfigurationTypes=EDGE, endpointConfigurationTypes=REGIONAL, or endpointConfigurationTypes=PRIVATE. The default endpoint type is EDGE.

    To handle imported basepath, set parameters as basepath=ignore, basepath=prepend or basepath=split.

    For example, the AWS CLI command to exclude documentation from the imported API is:

    aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'

    The AWS CLI command to set the regional endpoint on the imported API is:

    aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json'
  • body :: ByteString
    Required
    The POST 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.

Instances

Instances details
Eq ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

Show ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

Generic ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

Associated Types

type Rep ImportRestApi :: Type -> Type #

NFData ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

Methods

rnf :: ImportRestApi -> () #

Hashable ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

AWSRequest ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

Associated Types

type AWSResponse ImportRestApi #

ToBody ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

ToHeaders ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

ToPath ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

ToQuery ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

type Rep ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

type Rep ImportRestApi = D1 ('MetaData "ImportRestApi" "Amazonka.APIGateway.ImportRestApi" "libZSservicesZSamazonka-apigatewayZSamazonka-apigateway" 'False) (C1 ('MetaCons "ImportRestApi'" 'PrefixI 'True) (S1 ('MetaSel ('Just "failOnWarnings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "parameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text Text))) :*: S1 ('MetaSel ('Just "body") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString))))
type AWSResponse ImportRestApi Source # 
Instance details

Defined in Amazonka.APIGateway.ImportRestApi

newImportRestApi Source #

Create a value of ImportRestApi 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:ImportRestApi', importRestApi_failOnWarnings - A query parameter to indicate whether to rollback the API creation (true) or not (false) when a warning is encountered. The default value is false.

$sel:parameters:ImportRestApi', importRestApi_parameters - A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.

To exclude DocumentationParts from the import, set parameters as ignore=documentation.

To configure the endpoint type, set parameters as endpointConfigurationTypes=EDGE, endpointConfigurationTypes=REGIONAL, or endpointConfigurationTypes=PRIVATE. The default endpoint type is EDGE.

To handle imported basepath, set parameters as basepath=ignore, basepath=prepend or basepath=split.

For example, the AWS CLI command to exclude documentation from the imported API is:

aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'

The AWS CLI command to set the regional endpoint on the imported API is:

aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json'

$sel:body:ImportRestApi', importRestApi_body - [Required] The POST 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

importRestApi_failOnWarnings :: Lens' ImportRestApi (Maybe Bool) Source #

A query parameter to indicate whether to rollback the API creation (true) or not (false) when a warning is encountered. The default value is false.

importRestApi_parameters :: Lens' ImportRestApi (Maybe (HashMap Text Text)) Source #

A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.

To exclude DocumentationParts from the import, set parameters as ignore=documentation.

To configure the endpoint type, set parameters as endpointConfigurationTypes=EDGE, endpointConfigurationTypes=REGIONAL, or endpointConfigurationTypes=PRIVATE. The default endpoint type is EDGE.

To handle imported basepath, set parameters as basepath=ignore, basepath=prepend or basepath=split.

For example, the AWS CLI command to exclude documentation from the imported API is:

aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'

The AWS CLI command to set the regional endpoint on the imported API is:

aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json'

importRestApi_body :: Lens' ImportRestApi ByteString Source #

Required
The POST 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

data RestApi Source #

Represents a REST API.

Create an API

See: newRestApi smart constructor.

Constructors

RestApi' 

Fields

  • minimumCompressionSize :: Maybe Int

    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.

  • disableExecuteApiEndpoint :: Maybe Bool

    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.

  • binaryMediaTypes :: Maybe [Text]

    The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.

  • warnings :: Maybe [Text]

    The warning messages reported when failonwarnings is turned on during API import.

  • createdDate :: Maybe POSIX

    The timestamp when the API was created.

  • name :: Maybe Text

    The API's name.

  • version :: Maybe Text

    A version identifier for the API.

  • apiKeySource :: Maybe ApiKeySourceType

    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.
  • id :: Maybe Text

    The API's identifier. This identifier is unique across all of your APIs in API Gateway.

  • policy :: Maybe Text

    A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.

  • endpointConfiguration :: Maybe EndpointConfiguration

    The endpoint configuration of this RestApi showing the endpoint types of the API.

  • description :: Maybe Text

    The API's description.

  • tags :: Maybe (HashMap Text Text)

    The collection of tags. Each tag element is associated with a given resource.

Instances

Instances details
Eq RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

Methods

(==) :: RestApi -> RestApi -> Bool #

(/=) :: RestApi -> RestApi -> Bool #

Read RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

Show RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

Generic RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

Associated Types

type Rep RestApi :: Type -> Type #

Methods

from :: RestApi -> Rep RestApi x #

to :: Rep RestApi x -> RestApi #

NFData RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

Methods

rnf :: RestApi -> () #

Hashable RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

Methods

hashWithSalt :: Int -> RestApi -> Int #

hash :: RestApi -> Int #

FromJSON RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

type Rep RestApi Source # 
Instance details

Defined in Amazonka.APIGateway.Types.RestApi

type Rep RestApi = D1 ('MetaData "RestApi" "Amazonka.APIGateway.Types.RestApi" "libZSservicesZSamazonka-apigatewayZSamazonka-apigateway" 'False) (C1 ('MetaCons "RestApi'" 'PrefixI 'True) (((S1 ('MetaSel ('Just "minimumCompressionSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "disableExecuteApiEndpoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "binaryMediaTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])))) :*: (S1 ('MetaSel ('Just "warnings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [Text])) :*: (S1 ('MetaSel ('Just "createdDate") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) :*: ((S1 ('MetaSel ('Just "version") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "apiKeySource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ApiKeySourceType)) :*: S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "policy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "endpointConfiguration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe EndpointConfiguration))) :*: (S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "tags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (HashMap Text Text))))))))

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: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: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: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:warnings:RestApi', restApi_warnings - The warning messages reported when failonwarnings is turned on during API import.

$sel:createdDate:RestApi', restApi_createdDate - The timestamp when the API was created.

$sel:name:RestApi', restApi_name - The API's name.

$sel:version:RestApi', restApi_version - A version identifier for the API.

$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:id:RestApi', restApi_id - The API's identifier. This identifier is unique across all of your APIs in API Gateway.

$sel:policy:RestApi', restApi_policy - A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.

$sel:endpointConfiguration:RestApi', restApi_endpointConfiguration - The endpoint configuration of this RestApi showing the endpoint types of the API.

$sel:description:RestApi', restApi_description - The API's description.

$sel:tags:RestApi', restApi_tags - The collection of tags. Each tag element is associated with a given resource.

Response Lenses

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_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_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_warnings :: Lens' RestApi (Maybe [Text]) Source #

The warning messages reported when failonwarnings is turned on during API import.

restApi_createdDate :: Lens' RestApi (Maybe UTCTime) Source #

The timestamp when the API was created.

restApi_version :: Lens' RestApi (Maybe Text) Source #

A version identifier for the API.

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_id :: Lens' RestApi (Maybe Text) Source #

The API's identifier. This identifier is unique across all of your APIs in API Gateway.

restApi_policy :: Lens' RestApi (Maybe Text) Source #

A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.

restApi_endpointConfiguration :: Lens' RestApi (Maybe EndpointConfiguration) Source #

The endpoint configuration of this RestApi showing the endpoint types of the API.

restApi_description :: Lens' RestApi (Maybe Text) Source #

The API's description.

restApi_tags :: Lens' RestApi (Maybe (HashMap Text Text)) Source #

The collection of tags. Each tag element is associated with a given resource.