Class: AWSCDK::APIGatewayv2::RateLimitedAPIKeyProps

Inherits:
APIKeyProps
  • Object
show all
Defined in:
api_gatewayv2/rate_limited_api_key_props.rb

Overview

RateLimitedApiKey properties.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: nil, api_stages: nil, quota: nil, throttle: nil) ⇒ RateLimitedAPIKeyProps

Returns a new instance of RateLimitedAPIKeyProps.

Parameters:

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

    A name for the API key.

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

    A description of the purpose of the API key.

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

    The value of the API key.

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

    An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

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

    Indicates whether the API key can be used by clients.

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

    Specifies whether the key identifier is distinct from the created API key value.

  • api_stages (Array<AWSCDK::APIGatewayv2::UsagePlanPerAPIStage>, nil) (defaults to: nil)

    API Stages to be associated with the RateLimitedApiKey.

  • quota (AWSCDK::APIGatewayv2::QuotaSettings, nil) (defaults to: nil)

    Number of requests clients can make in a given time period.

  • throttle (AWSCDK::APIGatewayv2::ThrottleSettings, nil) (defaults to: nil)

    Overall throttle settings for the API.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 16

def initialize(api_key_name: nil, description: nil, value: nil, customer_id: nil, enabled: nil, generate_distinct_id: nil, api_stages: nil, quota: nil, throttle: nil)
  @api_key_name = api_key_name
  Jsii::Type.check_type(@api_key_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiKeyName") unless @api_key_name.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @value = value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "value") unless @value.nil?
  @customer_id = customer_id
  Jsii::Type.check_type(@customer_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "customerId") unless @customer_id.nil?
  @enabled = enabled
  Jsii::Type.check_type(@enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "enabled") unless @enabled.nil?
  @generate_distinct_id = generate_distinct_id
  Jsii::Type.check_type(@generate_distinct_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "generateDistinctId") unless @generate_distinct_id.nil?
  @api_stages = api_stages.is_a?(Array) ? api_stages.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::UsagePlanPerAPIStage.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : api_stages
  Jsii::Type.check_type(@api_stages, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5djIuVXNhZ2VQbGFuUGVyQXBpU3RhZ2UifSwia2luZCI6ImFycmF5In19")), "apiStages") unless @api_stages.nil?
  @quota = quota.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::QuotaSettings.new(**quota.transform_keys(&:to_sym)) : quota
  Jsii::Type.check_type(@quota, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLlF1b3RhU2V0dGluZ3MifQ==")), "quota") unless @quota.nil?
  @throttle = throttle.is_a?(Hash) ? ::AWSCDK::APIGatewayv2::ThrottleSettings.new(**throttle.transform_keys(&:to_sym)) : throttle
  Jsii::Type.check_type(@throttle, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheXYyLlRocm90dGxlU2V0dGluZ3MifQ==")), "throttle") unless @throttle.nil?
end

Instance Attribute Details

#api_key_nameString? (readonly)

Note:

Default: automatically generated name

A name for the API key.

If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the API key name.

Returns:

  • (String, nil)


43
44
45
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 43

def api_key_name
  @api_key_name
end

#api_stagesArray<AWSCDK::APIGatewayv2::UsagePlanPerAPIStage>? (readonly)

Note:

Default: none

API Stages to be associated with the RateLimitedApiKey.



75
76
77
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 75

def api_stages
  @api_stages
end

#customer_idString? (readonly)

Note:

Default: none

An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace.

Returns:

  • (String, nil)


60
61
62
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 60

def customer_id
  @customer_id
end

#descriptionString? (readonly)

Note:

Default: none

A description of the purpose of the API key.

Returns:

  • (String, nil)


48
49
50
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 48

def description
  @description
end

#enabledBoolean? (readonly)

Note:

Default: true

Indicates whether the API key can be used by clients.

Returns:

  • (Boolean, nil)


65
66
67
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 65

def enabled
  @enabled
end

#generate_distinct_idBoolean? (readonly)

Note:

Default: false

Specifies whether the key identifier is distinct from the created API key value.

Returns:

  • (Boolean, nil)


70
71
72
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 70

def generate_distinct_id
  @generate_distinct_id
end

#quotaAWSCDK::APIGatewayv2::QuotaSettings? (readonly)

Note:

Default: none

Number of requests clients can make in a given time period.



80
81
82
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 80

def quota
  @quota
end

#throttleAWSCDK::APIGatewayv2::ThrottleSettings? (readonly)

Note:

Default: none

Overall throttle settings for the API.



85
86
87
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 85

def throttle
  @throttle
end

#valueString? (readonly)

Note:

Default: none

The value of the API key.

Must be at least 20 characters long.

Returns:

  • (String, nil)


55
56
57
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 55

def value
  @value
end

Class Method Details

.jsii_propertiesObject



87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 87

def self.jsii_properties
  {
    :api_key_name => "apiKeyName",
    :description => "description",
    :value => "value",
    :customer_id => "customerId",
    :enabled => "enabled",
    :generate_distinct_id => "generateDistinctId",
    :api_stages => "apiStages",
    :quota => "quota",
    :throttle => "throttle",
  }
end

Instance Method Details

#to_jsiiObject



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'api_gatewayv2/rate_limited_api_key_props.rb', line 101

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "apiKeyName" => @api_key_name,
    "description" => @description,
    "value" => @value,
    "customerId" => @customer_id,
    "enabled" => @enabled,
    "generateDistinctId" => @generate_distinct_id,
    "apiStages" => @api_stages,
    "quota" => @quota,
    "throttle" => @throttle,
  })
  result.compact
end