Class: AWSCDK::APIGateway::CfnMethodProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/cfn_method_props.rb

Overview

Properties for defining a CfnMethod.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_method:, resource_id:, rest_api_id:, api_key_required: nil, authorization_scopes: nil, authorization_type: nil, authorizer_id: nil, integration: nil, method_responses: nil, operation_name: nil, request_models: nil, request_parameters: nil, request_validator_id: nil) ⇒ CfnMethodProps

Returns a new instance of CfnMethodProps.

Parameters:



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
# File 'api_gateway/cfn_method_props.rb', line 22

def initialize(http_method:, resource_id:, rest_api_id:, api_key_required: nil, authorization_scopes: nil, authorization_type: nil, authorizer_id: nil, integration: nil, method_responses: nil, operation_name: nil, request_models: nil, request_parameters: nil, request_validator_id: nil)
  @http_method = http_method
  Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpMethod")
  @resource_id = resource_id
  Jsii::Type.check_type(@resource_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXNvdXJjZVJlZiJ9XX19")), "resourceId")
  @rest_api_id = rest_api_id
  Jsii::Type.check_type(@rest_api_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXN0QXBpUmVmIn1dfX0=")), "restApiId")
  @api_key_required = api_key_required
  Jsii::Type.check_type(@api_key_required, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "apiKeyRequired") unless @api_key_required.nil?
  @authorization_scopes = authorization_scopes
  Jsii::Type.check_type(@authorization_scopes, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "authorizationScopes") unless @authorization_scopes.nil?
  @authorization_type = authorization_type
  Jsii::Type.check_type(@authorization_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "authorizationType") unless @authorization_type.nil?
  @authorizer_id = authorizer_id
  Jsii::Type.check_type(@authorizer_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklBdXRob3JpemVyUmVmIn1dfX0=")), "authorizerId") unless @authorizer_id.nil?
  @integration = integration.is_a?(Hash) ? ::AWSCDK::APIGateway::CfnMethod::IntegrationProperty.new(**integration.transform_keys(&:to_sym)) : integration
  Jsii::Type.check_type(@integration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5LkNmbk1ldGhvZC5JbnRlZ3JhdGlvblByb3BlcnR5In1dfX0=")), "integration") unless @integration.nil?
  @method_responses = method_responses
  Jsii::Type.check_type(@method_responses, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5DZm5NZXRob2QuTWV0aG9kUmVzcG9uc2VQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "methodResponses") unless @method_responses.nil?
  @operation_name = operation_name
  Jsii::Type.check_type(@operation_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operationName") unless @operation_name.nil?
  @request_models = request_models
  Jsii::Type.check_type(@request_models, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "requestModels") unless @request_models.nil?
  @request_parameters = request_parameters
  Jsii::Type.check_type(@request_parameters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7InByaW1pdGl2ZSI6ImJvb2xlYW4ifSx7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn1dfX0sImtpbmQiOiJtYXAifX1dfX0=")), "requestParameters") unless @request_parameters.nil?
  @request_validator_id = request_validator_id
  Jsii::Type.check_type(@request_validator_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXF1ZXN0VmFsaWRhdG9yUmVmIn1dfX0=")), "requestValidatorId") unless @request_validator_id.nil?
end

Instance Attribute Details

#api_key_requiredBoolean, ... (readonly)

A boolean flag specifying whether a valid ApiKey is required to invoke this method.



70
71
72
# File 'api_gateway/cfn_method_props.rb', line 70

def api_key_required
  @api_key_required
end

#authorization_scopesArray<String>? (readonly)

A list of authorization scopes configured on the method.

The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation. The authorization works by matching the method scopes against the scopes parsed from the access token in the incoming request. The method invocation is authorized if any method scopes matches a claimed scope in the access token. Otherwise, the invocation is not authorized. When the method scope is configured, the client must provide an access token instead of an identity token for authorization purposes.



77
78
79
# File 'api_gateway/cfn_method_props.rb', line 77

def authorization_scopes
  @authorization_scopes
end

#authorization_typeString? (readonly)

The method's authorization type.

This parameter is required. For valid values, see Method in the API Gateway API Reference .

If you specify the AuthorizerId property, specify CUSTOM or COGNITO_USER_POOLS for this property.



86
87
88
# File 'api_gateway/cfn_method_props.rb', line 86

def authorization_type
  @authorization_type
end

#authorizer_idString, ... (readonly)

The identifier of an authorizer to use on this method.

The method's authorization type must be CUSTOM or COGNITO_USER_POOLS .



93
94
95
# File 'api_gateway/cfn_method_props.rb', line 93

def authorizer_id
  @authorizer_id
end

#http_methodString (readonly)

The method's HTTP verb.



55
56
57
# File 'api_gateway/cfn_method_props.rb', line 55

def http_method
  @http_method
end

#integrationAWSCDK::IResolvable, ... (readonly)

Represents an HTTP , HTTP_PROXY , AWS , AWS_PROXY , or Mock integration.



98
99
100
# File 'api_gateway/cfn_method_props.rb', line 98

def integration
  @integration
end

#method_responsesAWSCDK::IResolvable, ... (readonly)

Gets a method response associated with a given HTTP status code.



103
104
105
# File 'api_gateway/cfn_method_props.rb', line 103

def method_responses
  @method_responses
end

#operation_nameString? (readonly)

A human-friendly operation identifier for the method.

For example, you can assign the operation_name of ListPets for the GET /pets method in the PetStore example.



110
111
112
# File 'api_gateway/cfn_method_props.rb', line 110

def operation_name
  @operation_name
end

#request_modelsAWSCDK::IResolvable, ... (readonly)

A key-value map specifying data schemas, represented by Model resources, (as the mapped value) of the request payloads of given content types (as the mapping key).



115
116
117
# File 'api_gateway/cfn_method_props.rb', line 115

def request_models
  @request_models
end

#request_parametersAWSCDK::IResolvable, ... (readonly)

A key-value map defining required or optional method request parameters that can be accepted by API Gateway.

A key is a method request parameter name matching the pattern of method.request.{location}.{name} , where location is querystring , path , or header and name is a valid and unique parameter name. The value associated with the key is a Boolean flag indicating whether the parameter is required ( true ) or optional ( false ). The method request parameter names defined here are available in Integration to be mapped to integration request parameters or templates.



122
123
124
# File 'api_gateway/cfn_method_props.rb', line 122

def request_parameters
  @request_parameters
end

#request_validator_idString, ... (readonly)

The identifier of a RequestValidator for request validation.



127
128
129
# File 'api_gateway/cfn_method_props.rb', line 127

def request_validator_id
  @request_validator_id
end

#resource_idString, AWSCDK::Interfaces::AWSApigateway::IResourceRef (readonly)

The Resource identifier for the MethodResponse resource.



60
61
62
# File 'api_gateway/cfn_method_props.rb', line 60

def resource_id
  @resource_id
end

#rest_api_idString, AWSCDK::Interfaces::AWSApigateway::IRestAPIRef (readonly)

The string identifier of the associated RestApi.



65
66
67
# File 'api_gateway/cfn_method_props.rb', line 65

def rest_api_id
  @rest_api_id
end

Class Method Details

.jsii_propertiesObject



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'api_gateway/cfn_method_props.rb', line 129

def self.jsii_properties
  {
    :http_method => "httpMethod",
    :resource_id => "resourceId",
    :rest_api_id => "restApiId",
    :api_key_required => "apiKeyRequired",
    :authorization_scopes => "authorizationScopes",
    :authorization_type => "authorizationType",
    :authorizer_id => "authorizerId",
    :integration => "integration",
    :method_responses => "methodResponses",
    :operation_name => "operationName",
    :request_models => "requestModels",
    :request_parameters => "requestParameters",
    :request_validator_id => "requestValidatorId",
  }
end

Instance Method Details

#to_jsiiObject



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'api_gateway/cfn_method_props.rb', line 147

def to_jsii
  result = {}
  result.merge!({
    "httpMethod" => @http_method,
    "resourceId" => @resource_id,
    "restApiId" => @rest_api_id,
    "apiKeyRequired" => @api_key_required,
    "authorizationScopes" => @authorization_scopes,
    "authorizationType" => @authorization_type,
    "authorizerId" => @authorizer_id,
    "integration" => @integration,
    "methodResponses" => @method_responses,
    "operationName" => @operation_name,
    "requestModels" => @request_models,
    "requestParameters" => @request_parameters,
    "requestValidatorId" => @request_validator_id,
  })
  result.compact
end