Class: AWSCDK::APIGateway::RequestValidatorProps

Inherits:
RequestValidatorOptions
  • Object
show all
Defined in:
api_gateway/request_validator_props.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_validator_name: nil, validate_request_body: nil, validate_request_parameters: nil, rest_api:) ⇒ RequestValidatorProps

Returns a new instance of RequestValidatorProps.

Parameters:

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

    The name of this request validator.

  • validate_request_body (Boolean, nil) (defaults to: nil)

    Indicates whether to validate the request body according to the configured schema for the targeted API and method.

  • validate_request_parameters (Boolean, nil) (defaults to: nil)

    Indicates whether to validate request parameters.

  • rest_api (AWSCDK::APIGateway::IRestAPI)

    The rest API that this model is part of.



10
11
12
13
14
15
16
17
18
19
# File 'api_gateway/request_validator_props.rb', line 10

def initialize(request_validator_name: nil, validate_request_body: nil, validate_request_parameters: nil, rest_api:)
  @request_validator_name = request_validator_name
  Jsii::Type.check_type(@request_validator_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "requestValidatorName") unless @request_validator_name.nil?
  @validate_request_body = validate_request_body
  Jsii::Type.check_type(@validate_request_body, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "validateRequestBody") unless @validate_request_body.nil?
  @validate_request_parameters = validate_request_parameters
  Jsii::Type.check_type(@validate_request_parameters, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "validateRequestParameters") unless @validate_request_parameters.nil?
  @rest_api = rest_api
  Jsii::Type.check_type(@rest_api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JUmVzdEFwaSJ9")), "restApi")
end

Instance Attribute Details

#request_validator_nameString? (readonly)

Note:

Default: None

The name of this request validator.

Returns:

  • (String, nil)


25
26
27
# File 'api_gateway/request_validator_props.rb', line 25

def request_validator_name
  @request_validator_name
end

#rest_apiAWSCDK::APIGateway::IRestAPI (readonly)

The rest API that this model is part of.

The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating its hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.



44
45
46
# File 'api_gateway/request_validator_props.rb', line 44

def rest_api
  @rest_api
end

#validate_request_bodyBoolean? (readonly)

Note:

Default: false

Indicates whether to validate the request body according to the configured schema for the targeted API and method.

Returns:

  • (Boolean, nil)


30
31
32
# File 'api_gateway/request_validator_props.rb', line 30

def validate_request_body
  @validate_request_body
end

#validate_request_parametersBoolean? (readonly)

Note:

Default: false

Indicates whether to validate request parameters.

Returns:

  • (Boolean, nil)


35
36
37
# File 'api_gateway/request_validator_props.rb', line 35

def validate_request_parameters
  @validate_request_parameters
end

Class Method Details

.jsii_propertiesObject



46
47
48
49
50
51
52
53
# File 'api_gateway/request_validator_props.rb', line 46

def self.jsii_properties
  {
    :request_validator_name => "requestValidatorName",
    :validate_request_body => "validateRequestBody",
    :validate_request_parameters => "validateRequestParameters",
    :rest_api => "restApi",
  }
end

Instance Method Details

#to_jsiiObject



55
56
57
58
59
60
61
62
63
64
65
# File 'api_gateway/request_validator_props.rb', line 55

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "requestValidatorName" => @request_validator_name,
    "validateRequestBody" => @validate_request_body,
    "validateRequestParameters" => @validate_request_parameters,
    "restApi" => @rest_api,
  })
  result.compact
end