Class: Courier::Automations::AutomationSendListStep
- Inherits:
-
Object
- Object
- Courier::Automations::AutomationSendListStep
- Defined in:
- lib/trycourier/automations/types/automation_send_list_step.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#additional_properties ⇒ Object
readonly
Returns the value of attribute additional_properties.
-
#brand ⇒ Object
readonly
Returns the value of attribute brand.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#if_ ⇒ Object
readonly
Returns the value of attribute if_.
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#override ⇒ Object
readonly
Returns the value of attribute override.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Automations::AutomationSendListStep
Deserialize a JSON object to an instance of AutomationSendListStep.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(action:, list:, brand: nil, data: nil, override: nil, template: nil, if_: nil, ref: nil, additional_properties: nil) ⇒ Automations::AutomationSendListStep constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of AutomationSendListStep to a JSON object.
Constructor Details
#initialize(action:, list:, brand: nil, data: nil, override: nil, template: nil, if_: nil, ref: nil, additional_properties: nil) ⇒ Automations::AutomationSendListStep
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 20 def initialize(action:, list:, brand: nil, data: nil, override: nil, template: nil, if_: nil, ref: nil, additional_properties: nil) # @type [String] @action = action # @type [String] @brand = brand # @type [Hash{String => String}] @data = data # @type [String] @list = list # @type [Hash{String => String}] @override = override # @type [String] @template = template # @type [String] @if_ = if_ # @type [String] @ref = ref # @type [OpenStruct] Additional properties unmapped to the current class definition @additional_properties = additional_properties end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def action @action end |
#additional_properties ⇒ Object (readonly)
Returns the value of attribute additional_properties.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def additional_properties @additional_properties end |
#brand ⇒ Object (readonly)
Returns the value of attribute brand.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def brand @brand end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def data @data end |
#if_ ⇒ Object (readonly)
Returns the value of attribute if_.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def if_ @if_ end |
#list ⇒ Object (readonly)
Returns the value of attribute list.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def list @list end |
#override ⇒ Object (readonly)
Returns the value of attribute override.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def override @override end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def ref @ref end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 8 def template @template end |
Class Method Details
.from_json(json_object:) ⇒ Automations::AutomationSendListStep
Deserialize a JSON object to an instance of AutomationSendListStep
46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) JSON.parse(json_object) action = struct.action brand = struct.brand data = struct.data list = struct.list override = struct.override template = struct.template if_ = struct.if ref = struct.ref new(action: action, brand: brand, data: data, list: list, override: override, template: template, if_: if_, ref: ref, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 81 def self.validate_raw(obj:) obj.action.is_a?(String) != false || raise("Passed value for field obj.action is not the expected type, validation failed.") obj.brand&.is_a?(String) != false || raise("Passed value for field obj.brand is not the expected type, validation failed.") obj.data&.is_a?(Hash) != false || raise("Passed value for field obj.data is not the expected type, validation failed.") obj.list.is_a?(String) != false || raise("Passed value for field obj.list is not the expected type, validation failed.") obj.override&.is_a?(Hash) != false || raise("Passed value for field obj.override is not the expected type, validation failed.") obj.template&.is_a?(String) != false || raise("Passed value for field obj.template is not the expected type, validation failed.") obj.if_&.is_a?(String) != false || raise("Passed value for field obj.if_ is not the expected type, validation failed.") obj.ref&.is_a?(String) != false || raise("Passed value for field obj.ref is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ JSON
Serialize an instance of AutomationSendListStep to a JSON object
64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/trycourier/automations/types/automation_send_list_step.rb', line 64 def to_json(*_args) { "action": @action, "brand": @brand, "data": @data, "list": @list, "override": @override, "template": @template, "if": @if_, "ref": @ref }.to_json end |