Class: Merge::Accounting::LinkToken
- Inherits:
-
Object
- Object
- Merge::Accounting::LinkToken
- Defined in:
- lib/merge_ruby_client/accounting/types/link_token.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #integration_name ⇒ String readonly
- #link_token ⇒ String readonly
- #magic_link_url ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Accounting::LinkToken
Deserialize a JSON object to an instance of LinkToken.
-
.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(link_token:, integration_name: OMIT, magic_link_url: OMIT, additional_properties: nil) ⇒ Merge::Accounting::LinkToken constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of LinkToken to a JSON object.
Constructor Details
#initialize(link_token:, integration_name: OMIT, magic_link_url: OMIT, additional_properties: nil) ⇒ Merge::Accounting::LinkToken
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 28 def initialize(link_token:, integration_name: OMIT, magic_link_url: OMIT, additional_properties: nil) @link_token = link_token @integration_name = integration_name if integration_name != OMIT @magic_link_url = magic_link_url if magic_link_url != OMIT @additional_properties = additional_properties @_field_set = { "link_token": link_token, "integration_name": integration_name, "magic_link_url": magic_link_url }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 16 def additional_properties @additional_properties end |
#integration_name ⇒ String (readonly)
12 13 14 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 12 def integration_name @integration_name end |
#link_token ⇒ String (readonly)
10 11 12 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 10 def link_token @link_token end |
#magic_link_url ⇒ String (readonly)
14 15 16 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 14 def magic_link_url @magic_link_url end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Accounting::LinkToken
Deserialize a JSON object to an instance of LinkToken
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 46 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) link_token = parsed_json["link_token"] integration_name = parsed_json["integration_name"] magic_link_url = parsed_json["magic_link_url"] new( link_token: link_token, integration_name: integration_name, magic_link_url: magic_link_url, 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.
73 74 75 76 77 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 73 def self.validate_raw(obj:) obj.link_token.is_a?(String) != false || raise("Passed value for field obj.link_token is not the expected type, validation failed.") obj.integration_name&.is_a?(String) != false || raise("Passed value for field obj.integration_name is not the expected type, validation failed.") obj.magic_link_url&.is_a?(String) != false || raise("Passed value for field obj.magic_link_url is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of LinkToken to a JSON object
63 64 65 |
# File 'lib/merge_ruby_client/accounting/types/link_token.rb', line 63 def to_json(*_args) @_field_set&.to_json end |