amazonka-apigateway-1.6.0: Amazon API Gateway SDK.

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

Network.AWS.APIGateway.ImportRestAPI

Contents

Description

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

Synopsis

Creating a Request

importRestAPI #

Creates a value of ImportRestAPI with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • iraFailOnWarnings - 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 .
  • iraParameters - 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 orendpointConfigurationTypes=REGIONAL . 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://pathto/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://pathto/imported-api-body.json @
  • iraBody - [Required] The POST request body containing external API definitions. Currently, only Swagger definition JSON files are supported. The maximum size of the API definition file is 2MB.

data ImportRestAPI #

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

See: importRestAPI smart constructor.

Instances

Eq ImportRestAPI # 
Data ImportRestAPI # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ImportRestAPI -> c ImportRestAPI #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ImportRestAPI #

toConstr :: ImportRestAPI -> Constr #

dataTypeOf :: ImportRestAPI -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ImportRestAPI) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ImportRestAPI) #

gmapT :: (forall b. Data b => b -> b) -> ImportRestAPI -> ImportRestAPI #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ImportRestAPI -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ImportRestAPI -> r #

gmapQ :: (forall d. Data d => d -> u) -> ImportRestAPI -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ImportRestAPI -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ImportRestAPI -> m ImportRestAPI #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ImportRestAPI -> m ImportRestAPI #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ImportRestAPI -> m ImportRestAPI #

Show ImportRestAPI # 
Generic ImportRestAPI # 

Associated Types

type Rep ImportRestAPI :: * -> * #

Hashable ImportRestAPI # 
NFData ImportRestAPI # 

Methods

rnf :: ImportRestAPI -> () #

AWSRequest ImportRestAPI # 
ToBody ImportRestAPI # 
ToHeaders ImportRestAPI # 
ToPath ImportRestAPI # 
ToQuery ImportRestAPI # 
type Rep ImportRestAPI # 
type Rep ImportRestAPI = D1 * (MetaData "ImportRestAPI" "Network.AWS.APIGateway.ImportRestAPI" "amazonka-apigateway-1.6.0-6sEXF2HuGsL3K99fRnfViy" False) (C1 * (MetaCons "ImportRestAPI'" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "_iraFailOnWarnings") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Bool))) ((:*:) * (S1 * (MetaSel (Just Symbol "_iraParameters") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe (Map Text Text)))) (S1 * (MetaSel (Just Symbol "_iraBody") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * ByteString)))))
type Rs ImportRestAPI # 

Request Lenses

iraFailOnWarnings :: Lens' ImportRestAPI (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 .

iraParameters :: Lens' ImportRestAPI (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 orendpointConfigurationTypes=REGIONAL . 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://pathto/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://pathto/imported-api-body.json @

iraBody :: Lens' ImportRestAPI ByteString #

Required
The POST request body containing external API definitions. Currently, only Swagger definition JSON files are supported. The maximum size of the API definition file is 2MB.

Destructuring the Response

restAPI :: RestAPI #

Creates a value of RestAPI with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

  • raMinimumCompressionSize - 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.
  • raBinaryMediaTypes - The list of binary media types supported by the RestApi . By default, the RestApi supports only UTF-8-encoded text payloads.
  • raWarnings - The warning messages reported when failonwarnings is turned on during API import.
  • raCreatedDate - The timestamp when the API was created.
  • raName - The API's name.
  • raVersion - A version identifier for the API.
  • raApiKeySource - 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.
  • raId - The API's identifier. This identifier is unique across all of your APIs in API Gateway.
  • raPolicy - Method
  • raEndpointConfiguration - The endpoint configuration of this RestApi showing the endpoint types of the API.
  • raDescription - The API's description.

data RestAPI #

Represents a REST API.

Create an API

See: restAPI smart constructor.

Instances

Eq RestAPI # 

Methods

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

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

Data RestAPI # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> RestAPI -> c RestAPI #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c RestAPI #

toConstr :: RestAPI -> Constr #

dataTypeOf :: RestAPI -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c RestAPI) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c RestAPI) #

gmapT :: (forall b. Data b => b -> b) -> RestAPI -> RestAPI #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RestAPI -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RestAPI -> r #

gmapQ :: (forall d. Data d => d -> u) -> RestAPI -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RestAPI -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RestAPI -> m RestAPI #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RestAPI -> m RestAPI #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RestAPI -> m RestAPI #

Read RestAPI # 
Show RestAPI # 
Generic RestAPI # 

Associated Types

type Rep RestAPI :: * -> * #

Methods

from :: RestAPI -> Rep RestAPI x #

to :: Rep RestAPI x -> RestAPI #

Hashable RestAPI # 

Methods

hashWithSalt :: Int -> RestAPI -> Int #

hash :: RestAPI -> Int #

FromJSON RestAPI # 
NFData RestAPI # 

Methods

rnf :: RestAPI -> () #

type Rep RestAPI # 
type Rep RestAPI = D1 * (MetaData "RestAPI" "Network.AWS.APIGateway.Types.Product" "amazonka-apigateway-1.6.0-6sEXF2HuGsL3K99fRnfViy" False) (C1 * (MetaCons "RestAPI'" PrefixI True) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_raMinimumCompressionSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Int))) (S1 * (MetaSel (Just Symbol "_raBinaryMediaTypes") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [Text])))) ((:*:) * (S1 * (MetaSel (Just Symbol "_raWarnings") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [Text]))) ((:*:) * (S1 * (MetaSel (Just Symbol "_raCreatedDate") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe POSIX))) (S1 * (MetaSel (Just Symbol "_raName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text)))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "_raVersion") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "_raApiKeySource") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe APIKeySourceType))) (S1 * (MetaSel (Just Symbol "_raId") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))))) ((:*:) * (S1 * (MetaSel (Just Symbol "_raPolicy") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))) ((:*:) * (S1 * (MetaSel (Just Symbol "_raEndpointConfiguration") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe EndpointConfiguration))) (S1 * (MetaSel (Just Symbol "_raDescription") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Text))))))))

Response Lenses

raMinimumCompressionSize :: Lens' RestAPI (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.

raBinaryMediaTypes :: Lens' RestAPI [Text] #

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

raWarnings :: Lens' RestAPI [Text] #

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

raCreatedDate :: Lens' RestAPI (Maybe UTCTime) #

The timestamp when the API was created.

raName :: Lens' RestAPI (Maybe Text) #

The API's name.

raVersion :: Lens' RestAPI (Maybe Text) #

A version identifier for the API.

raApiKeySource :: Lens' RestAPI (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.

raId :: Lens' RestAPI (Maybe Text) #

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

raEndpointConfiguration :: Lens' RestAPI (Maybe EndpointConfiguration) #

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

raDescription :: Lens' RestAPI (Maybe Text) #

The API's description.