Class: Courier::Automations::AutomationCancelStep
- Inherits:
-
Object
- Object
- Courier::Automations::AutomationCancelStep
- Defined in:
- lib/trycourier/automations/types/automation_cancel_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.
-
#cancelation_token ⇒ Object
readonly
Returns the value of attribute cancelation_token.
-
#if_ ⇒ Object
readonly
Returns the value of attribute if_.
-
#ref ⇒ Object
readonly
Returns the value of attribute ref.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Automations::AutomationCancelStep
Deserialize a JSON object to an instance of AutomationCancelStep.
-
.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:, cancelation_token: nil, if_: nil, ref: nil, additional_properties: nil) ⇒ Automations::AutomationCancelStep constructor
-
#to_json(*_args) ⇒ JSON
Serialize an instance of AutomationCancelStep to a JSON object.
Constructor Details
#initialize(action:, cancelation_token: nil, if_: nil, ref: nil, additional_properties: nil) ⇒ Automations::AutomationCancelStep
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 16 def initialize(action:, cancelation_token: nil, if_: nil, ref: nil, additional_properties: nil) # @type [String] @action = action # @type [String] @cancelation_token = cancelation_token # @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_cancel_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_cancel_step.rb', line 8 def additional_properties @additional_properties end |
#cancelation_token ⇒ Object (readonly)
Returns the value of attribute cancelation_token.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 8 def cancelation_token @cancelation_token end |
#if_ ⇒ Object (readonly)
Returns the value of attribute if_.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 8 def if_ @if_ end |
#ref ⇒ Object (readonly)
Returns the value of attribute ref.
8 9 10 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 8 def ref @ref end |
Class Method Details
.from_json(json_object:) ⇒ Automations::AutomationCancelStep
Deserialize a JSON object to an instance of AutomationCancelStep
33 34 35 36 37 38 39 40 41 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 33 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) JSON.parse(json_object) action = struct.action cancelation_token = struct.cancelation_token if_ = struct.if ref = struct.ref new(action: action, cancelation_token: cancelation_token, 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.
54 55 56 57 58 59 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 54 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.cancelation_token&.is_a?(String) != false || raise("Passed value for field obj.cancelation_token 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 AutomationCancelStep to a JSON object
46 47 48 |
# File 'lib/trycourier/automations/types/automation_cancel_step.rb', line 46 def to_json(*_args) { "action": @action, "cancelation_token": @cancelation_token, "if": @if_, "ref": @ref }.to_json end |