Class: AWSCDK::APIGatewayv2::UsagePlanProps

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

Overview

Properties for defining an API Gateway Usage Plan for WebSocket APIs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UsagePlanProps.

Parameters:



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

def initialize(api_stages: nil, description: nil, quota: nil, throttle: nil, usage_plan_name: 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?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.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?
  @usage_plan_name = usage_plan_name
  Jsii::Type.check_type(@usage_plan_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "usagePlanName") unless @usage_plan_name.nil?
end

Instance Attribute Details

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

Note:

Default: none

API Stages to be associated with the usage plan.



29
30
31
# File 'api_gatewayv2/usage_plan_props.rb', line 29

def api_stages
  @api_stages
end

#descriptionString? (readonly)

Note:

Default: none

Represents usage plan purpose.

Returns:

  • (String, nil)


34
35
36
# File 'api_gatewayv2/usage_plan_props.rb', line 34

def description
  @description
end

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

Note:

Default: none

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



39
40
41
# File 'api_gatewayv2/usage_plan_props.rb', line 39

def quota
  @quota
end

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

Note:

Default: none

Overall throttle settings for the API.



44
45
46
# File 'api_gatewayv2/usage_plan_props.rb', line 44

def throttle
  @throttle
end

#usage_plan_nameString? (readonly)

Note:

Default: none

Name for this usage plan.

Returns:

  • (String, nil)


49
50
51
# File 'api_gatewayv2/usage_plan_props.rb', line 49

def usage_plan_name
  @usage_plan_name
end

Class Method Details

.jsii_propertiesObject



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

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

Instance Method Details

#to_jsiiObject



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

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