Class: AWSCDK::Lambda::VersionWeight
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Lambda::VersionWeight
- Defined in:
- lambda/version_weight.rb
Overview
A version/weight pair for routing traffic to Lambda functions.
Instance Attribute Summary collapse
-
#version ⇒ AWSCDK::Lambda::IVersion
readonly
The version to route traffic to.
-
#weight ⇒ Numeric
readonly
How much weight to assign to this version (0..1).
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(version:, weight:) ⇒ VersionWeight
constructor
A new instance of VersionWeight.
- #to_jsii ⇒ Object
Constructor Details
#initialize(version:, weight:) ⇒ VersionWeight
Returns a new instance of VersionWeight.
9 10 11 12 13 14 |
# File 'lambda/version_weight.rb', line 9 def initialize(version:, weight:) @version = version Jsii::Type.check_type(@version, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfbGFtYmRhLklWZXJzaW9uIn0=")), "version") @weight = weight Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") end |
Instance Attribute Details
#version ⇒ AWSCDK::Lambda::IVersion (readonly)
The version to route traffic to.
19 20 21 |
# File 'lambda/version_weight.rb', line 19 def version @version end |
#weight ⇒ Numeric (readonly)
How much weight to assign to this version (0..1).
23 24 25 |
# File 'lambda/version_weight.rb', line 23 def weight @weight end |
Class Method Details
.jsii_properties ⇒ Object
25 26 27 28 29 30 |
# File 'lambda/version_weight.rb', line 25 def self.jsii_properties { :version => "version", :weight => "weight", } end |
Instance Method Details
#to_jsii ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lambda/version_weight.rb', line 32 def to_jsii result = {} result.merge!({ "version" => @version, "weight" => @weight, }) result.compact end |