Class: AWSCDK::APIGateway::CfnGatewayResponseProps

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

Overview

Properties for defining a CfnGatewayResponse.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_type:, rest_api_id:, response_parameters: nil, response_templates: nil, status_code: nil) ⇒ CfnGatewayResponseProps

Returns a new instance of CfnGatewayResponseProps.

Parameters:

  • response_type (String)

    The response type of the associated GatewayResponse.

  • rest_api_id (String, AWSCDK::Interfaces::AWSApigateway::IRestAPIRef)

    The string identifier of the associated RestApi.

  • response_parameters (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.

  • response_templates (AWSCDK::IResolvable, Hash{String => String}, nil) (defaults to: nil)

    Response templates of the GatewayResponse as a string-to-string map of key-value pairs.

  • status_code (String, nil) (defaults to: nil)

    The HTTP status code for this GatewayResponse.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'api_gateway/cfn_gateway_response_props.rb', line 14

def initialize(response_type:, rest_api_id:, response_parameters: nil, response_templates: nil, status_code: nil)
  @response_type = response_type
  Jsii::Type.check_type(@response_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "responseType")
  @rest_api_id = rest_api_id
  Jsii::Type.check_type(@rest_api_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXN0QXBpUmVmIn1dfX0=")), "restApiId")
  @response_parameters = response_parameters
  Jsii::Type.check_type(@response_parameters, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "responseParameters") unless @response_parameters.nil?
  @response_templates = response_templates
  Jsii::Type.check_type(@response_templates, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsicHJpbWl0aXZlIjoic3RyaW5nIn0sImtpbmQiOiJtYXAifX1dfX0=")), "responseTemplates") unless @response_templates.nil?
  @status_code = status_code
  Jsii::Type.check_type(@status_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statusCode") unless @status_code.nil?
end

Instance Attribute Details

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

Response parameters (paths, query strings and headers) of the GatewayResponse as a string-to-string map of key-value pairs.



41
42
43
# File 'api_gateway/cfn_gateway_response_props.rb', line 41

def response_parameters
  @response_parameters
end

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

Response templates of the GatewayResponse as a string-to-string map of key-value pairs.



46
47
48
# File 'api_gateway/cfn_gateway_response_props.rb', line 46

def response_templates
  @response_templates
end

#response_typeString (readonly)

The response type of the associated GatewayResponse.



31
32
33
# File 'api_gateway/cfn_gateway_response_props.rb', line 31

def response_type
  @response_type
end

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

The string identifier of the associated RestApi.



36
37
38
# File 'api_gateway/cfn_gateway_response_props.rb', line 36

def rest_api_id
  @rest_api_id
end

#status_codeString? (readonly)

The HTTP status code for this GatewayResponse.



51
52
53
# File 'api_gateway/cfn_gateway_response_props.rb', line 51

def status_code
  @status_code
end

Class Method Details

.jsii_propertiesObject



53
54
55
56
57
58
59
60
61
# File 'api_gateway/cfn_gateway_response_props.rb', line 53

def self.jsii_properties
  {
    :response_type => "responseType",
    :rest_api_id => "restApiId",
    :response_parameters => "responseParameters",
    :response_templates => "responseTemplates",
    :status_code => "statusCode",
  }
end

Instance Method Details

#to_jsiiObject



63
64
65
66
67
68
69
70
71
72
73
# File 'api_gateway/cfn_gateway_response_props.rb', line 63

def to_jsii
  result = {}
  result.merge!({
    "responseType" => @response_type,
    "restApiId" => @rest_api_id,
    "responseParameters" => @response_parameters,
    "responseTemplates" => @response_templates,
    "statusCode" => @status_code,
  })
  result.compact
end