Class: Humidifier::SdkPayload
- Inherits:
-
Object
- Object
- Humidifier::SdkPayload
- Extended by:
- Forwardable
- Defined in:
- lib/humidifier/sdk_payload.rb
Overview
The payload sent to the shim methods, representing the stack and the options
Defined Under Namespace
Classes: TemplateTooLargeError
Constant Summary collapse
- MAX_TEMPLATE_BODY_SIZE =
The maximum size a template body can be before it has to be put somewhere and referenced through a URL
51_200- MAX_TEMPLATE_URL_SIZE =
The maximum size a template body can be inside of an S3 bucket
460_800- MAX_WAIT =
The maximum amount of time that Humidifier should wait for a stack to complete a CRUD operation
600
Instance Attribute Summary collapse
-
#max_wait ⇒ Object
Returns the value of attribute max_wait.
-
#options ⇒ Object
Returns the value of attribute options.
-
#stack ⇒ Object
Returns the value of attribute stack.
Instance Method Summary collapse
-
#==(other) ⇒ Object
True if the stack and options are the same as the other (used for testing).
-
#create_change_set_params ⇒ Object
Param set for the #create_change_set SDK method.
-
#create_params ⇒ Object
Param set for the #create_stack SDK method.
-
#delete_params ⇒ Object
Param set for the #delete_stack SDK method.
-
#initialize(stack, options) ⇒ SdkPayload
constructor
A new instance of SdkPayload.
-
#merge(new_options) ⇒ Object
Merge in options.
-
#template_body ⇒ Object
The body of the template.
-
#update_params ⇒ Object
Param set for the #update_stack SDK method.
-
#validate_params ⇒ Object
Param set for the #validate_template SDK method.
Constructor Details
#initialize(stack, options) ⇒ SdkPayload
Returns a new instance of SdkPayload.
31 32 33 34 35 |
# File 'lib/humidifier/sdk_payload.rb', line 31 def initialize(stack, ) self.stack = stack self. = self.max_wait = .delete(:max_wait) || MAX_WAIT end |
Instance Attribute Details
#max_wait ⇒ Object
Returns the value of attribute max_wait.
26 27 28 |
# File 'lib/humidifier/sdk_payload.rb', line 26 def max_wait @max_wait end |
#options ⇒ Object
Returns the value of attribute options.
26 27 28 |
# File 'lib/humidifier/sdk_payload.rb', line 26 def end |
#stack ⇒ Object
Returns the value of attribute stack.
26 27 28 |
# File 'lib/humidifier/sdk_payload.rb', line 26 def stack @stack end |
Instance Method Details
#==(other) ⇒ Object
True if the stack and options are the same as the other (used for testing)
38 39 40 |
# File 'lib/humidifier/sdk_payload.rb', line 38 def ==(other) stack == other.stack && == other. end |
#create_change_set_params ⇒ Object
Param set for the #create_change_set SDK method
57 58 59 |
# File 'lib/humidifier/sdk_payload.rb', line 57 def create_change_set_params { stack_name: stack.identifier }.merge(template_param).merge() end |
#create_params ⇒ Object
Param set for the #create_stack SDK method
62 63 64 |
# File 'lib/humidifier/sdk_payload.rb', line 62 def create_params { stack_name: stack.name }.merge(template_param).merge() end |
#delete_params ⇒ Object
Param set for the #delete_stack SDK method
67 68 69 |
# File 'lib/humidifier/sdk_payload.rb', line 67 def delete_params { stack_name: stack.identifier }.merge() end |
#merge(new_options) ⇒ Object
Merge in options
43 44 45 |
# File 'lib/humidifier/sdk_payload.rb', line 43 def merge() self. = .merge() end |
#template_body ⇒ Object
The body of the template
48 49 50 |
# File 'lib/humidifier/sdk_payload.rb', line 48 def template_body @template_body ||= stack.to_cf end |
#update_params ⇒ Object
Param set for the #update_stack SDK method
72 73 74 |
# File 'lib/humidifier/sdk_payload.rb', line 72 def update_params { stack_name: stack.identifier }.merge(template_param).merge() end |
#validate_params ⇒ Object
Param set for the #validate_template SDK method
77 78 79 |
# File 'lib/humidifier/sdk_payload.rb', line 77 def validate_params template_param.merge() end |