Class: AWSCDK::APIGateway::UsagePlanProps

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_stages: nil, description: nil, name: nil, quota: nil, throttle: nil) ⇒ UsagePlanProps

Returns a new instance of UsagePlanProps.

Parameters:



11
12
13
14
15
16
17
18
19
20
21
22
# File 'api_gateway/usage_plan_props.rb', line 11

def initialize(api_stages: nil, description: nil, name: nil, quota: nil, throttle: nil)
  @api_stages = api_stages.is_a?(Array) ? api_stages.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::APIGateway::UsagePlanPerAPIStage.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : api_stages
  Jsii::Type.check_type(@api_stages, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5LlVzYWdlUGxhblBlckFwaVN0YWdlIn0sImtpbmQiOiJhcnJheSJ9fQ==")), "apiStages") unless @api_stages.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @quota = quota.is_a?(Hash) ? ::AWSCDK::APIGateway::QuotaSettings.new(**quota.transform_keys(&:to_sym)) : quota
  Jsii::Type.check_type(@quota, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5RdW90YVNldHRpbmdzIn0=")), "quota") unless @quota.nil?
  @throttle = throttle.is_a?(Hash) ? ::AWSCDK::APIGateway::ThrottleSettings.new(**throttle.transform_keys(&:to_sym)) : throttle
  Jsii::Type.check_type(@throttle, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5UaHJvdHRsZVNldHRpbmdzIn0=")), "throttle") unless @throttle.nil?
end

Instance Attribute Details

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

Note:

Default: none

API Stages to be associated with the usage plan.



28
29
30
# File 'api_gateway/usage_plan_props.rb', line 28

def api_stages
  @api_stages
end

#descriptionString? (readonly)

Note:

Default: none

Represents usage plan purpose.

Returns:

  • (String, nil)


33
34
35
# File 'api_gateway/usage_plan_props.rb', line 33

def description
  @description
end

#nameString? (readonly)

Note:

Default: none

Name for this usage plan.

Returns:

  • (String, nil)


38
39
40
# File 'api_gateway/usage_plan_props.rb', line 38

def name
  @name
end

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

Note:

Default: none

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



43
44
45
# File 'api_gateway/usage_plan_props.rb', line 43

def quota
  @quota
end

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

Note:

Default: none

Overall throttle settings for the API.



48
49
50
# File 'api_gateway/usage_plan_props.rb', line 48

def throttle
  @throttle
end

Class Method Details

.jsii_propertiesObject



50
51
52
53
54
55
56
57
58
# File 'api_gateway/usage_plan_props.rb', line 50

def self.jsii_properties
  {
    :api_stages => "apiStages",
    :description => "description",
    :name => "name",
    :quota => "quota",
    :throttle => "throttle",
  }
end

Instance Method Details

#to_jsiiObject



60
61
62
63
64
65
66
67
68
69
70
# File 'api_gateway/usage_plan_props.rb', line 60

def to_jsii
  result = {}
  result.merge!({
    "apiStages" => @api_stages,
    "description" => @description,
    "name" => @name,
    "quota" => @quota,
    "throttle" => @throttle,
  })
  result.compact
end