Class: Gusto::Flows::Flow
- Inherits:
-
Object
- Object
- Gusto::Flows::Flow
- Defined in:
- lib/fern_gusto/flows/types/flow.rb
Overview
The representation of a flow in Gusto white-label UI.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #expires_at ⇒ String readonly
- #url ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(url: OMIT, expires_at: OMIT, additional_properties: nil) ⇒ Gusto::Flows::Flow constructor
- #to_json ⇒ String
Constructor Details
#initialize(url: OMIT, expires_at: OMIT, additional_properties: nil) ⇒ Gusto::Flows::Flow
25 26 27 28 29 30 31 32 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 25 def initialize(url: OMIT, expires_at: OMIT, additional_properties: nil) @url = url if url != OMIT @expires_at = expires_at if expires_at != OMIT @additional_properties = additional_properties @_field_set = { "url": url, "expires_at": expires_at }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
14 15 16 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 14 def additional_properties @additional_properties end |
#expires_at ⇒ String (readonly)
12 13 14 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 12 def expires_at @expires_at end |
#url ⇒ String (readonly)
10 11 12 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 10 def url @url end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Flows::Flow
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 37 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) url = parsed_json["url"] expires_at = parsed_json["expires_at"] new( url: url, expires_at: expires_at, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
60 61 62 63 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 60 def self.validate_raw(obj:) obj.url&.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.") obj.expires_at&.is_a?(String) != false || raise("Passed value for field obj.expires_at is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
51 52 53 |
# File 'lib/fern_gusto/flows/types/flow.rb', line 51 def to_json @_field_set&.to_json end |