Class: Merge::Accounting::AccountDetails
- Inherits:
-
Object
- Object
- Merge::Accounting::AccountDetails
- Defined in:
- lib/merge_ruby_client/accounting/types/account_details.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #account_type ⇒ String readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #category ⇒ Merge::Accounting::CategoryEnum readonly
-
#completed_at ⇒ DateTime
readonly
The time at which account completes the linking flow.
- #end_user_email_address ⇒ String readonly
- #end_user_organization_name ⇒ String readonly
- #end_user_origin_id ⇒ String readonly
- #id ⇒ String readonly
- #integration ⇒ String readonly
- #integration_slug ⇒ String readonly
-
#is_duplicate ⇒ Boolean
readonly
Whether a Production Linked Account’s credentials match another existing Production Linked Account.
- #status ⇒ String readonly
- #webhook_listener_url ⇒ String readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Accounting::AccountDetails
Deserialize a JSON object to an instance of AccountDetails.
-
.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(id: OMIT, integration: OMIT, integration_slug: OMIT, category: OMIT, end_user_origin_id: OMIT, end_user_organization_name: OMIT, end_user_email_address: OMIT, status: OMIT, webhook_listener_url: OMIT, is_duplicate: OMIT, account_type: OMIT, completed_at: OMIT, additional_properties: nil) ⇒ Merge::Accounting::AccountDetails constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of AccountDetails to a JSON object.
Constructor Details
#initialize(id: OMIT, integration: OMIT, integration_slug: OMIT, category: OMIT, end_user_origin_id: OMIT, end_user_organization_name: OMIT, end_user_email_address: OMIT, status: OMIT, webhook_listener_url: OMIT, is_duplicate: OMIT, account_type: OMIT, completed_at: OMIT, additional_properties: nil) ⇒ Merge::Accounting::AccountDetails
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 63 def initialize(id: OMIT, integration: OMIT, integration_slug: OMIT, category: OMIT, end_user_origin_id: OMIT, end_user_organization_name: OMIT, end_user_email_address: OMIT, status: OMIT, webhook_listener_url: OMIT, is_duplicate: OMIT, account_type: OMIT, completed_at: OMIT, additional_properties: nil) @id = id if id != OMIT @integration = integration if integration != OMIT @integration_slug = integration_slug if integration_slug != OMIT @category = category if category != OMIT @end_user_origin_id = end_user_origin_id if end_user_origin_id != OMIT @end_user_organization_name = end_user_organization_name if end_user_organization_name != OMIT @end_user_email_address = end_user_email_address if end_user_email_address != OMIT @status = status if status != OMIT @webhook_listener_url = webhook_listener_url if webhook_listener_url != OMIT @is_duplicate = is_duplicate if is_duplicate != OMIT @account_type = account_type if account_type != OMIT @completed_at = completed_at if completed_at != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "integration": integration, "integration_slug": integration_slug, "category": category, "end_user_origin_id": end_user_origin_id, "end_user_organization_name": end_user_organization_name, "end_user_email_address": end_user_email_address, "status": status, "webhook_listener_url": webhook_listener_url, "is_duplicate": is_duplicate, "account_type": account_type, "completed_at": completed_at }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account_type ⇒ String (readonly)
35 36 37 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 35 def account_type @account_type end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
39 40 41 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 39 def additional_properties @additional_properties end |
#category ⇒ Merge::Accounting::CategoryEnum (readonly)
18 19 20 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 18 def category @category end |
#completed_at ⇒ DateTime (readonly)
Returns The time at which account completes the linking flow.
37 38 39 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 37 def completed_at @completed_at end |
#end_user_email_address ⇒ String (readonly)
24 25 26 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 24 def end_user_email_address @end_user_email_address end |
#end_user_organization_name ⇒ String (readonly)
22 23 24 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 22 def end_user_organization_name @end_user_organization_name end |
#end_user_origin_id ⇒ String (readonly)
20 21 22 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 20 def end_user_origin_id @end_user_origin_id end |
#id ⇒ String (readonly)
12 13 14 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 12 def id @id end |
#integration ⇒ String (readonly)
14 15 16 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 14 def integration @integration end |
#integration_slug ⇒ String (readonly)
16 17 18 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 16 def integration_slug @integration_slug end |
#is_duplicate ⇒ Boolean (readonly)
Returns Whether a Production Linked Account’s credentials match another existing Production Linked Account. This field is ‘null` for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets.
33 34 35 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 33 def is_duplicate @is_duplicate end |
#status ⇒ String (readonly)
26 27 28 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 26 def status @status end |
#webhook_listener_url ⇒ String (readonly)
28 29 30 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 28 def webhook_listener_url @webhook_listener_url end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Accounting::AccountDetails
Deserialize a JSON object to an instance of AccountDetails
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 100 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] integration = parsed_json["integration"] integration_slug = parsed_json["integration_slug"] category = parsed_json["category"] end_user_origin_id = parsed_json["end_user_origin_id"] end_user_organization_name = parsed_json["end_user_organization_name"] end_user_email_address = parsed_json["end_user_email_address"] status = parsed_json["status"] webhook_listener_url = parsed_json["webhook_listener_url"] is_duplicate = parsed_json["is_duplicate"] account_type = parsed_json["account_type"] completed_at = (DateTime.parse(parsed_json["completed_at"]) unless parsed_json["completed_at"].nil?) new( id: id, integration: integration, integration_slug: integration_slug, category: category, end_user_origin_id: end_user_origin_id, end_user_organization_name: end_user_organization_name, end_user_email_address: end_user_email_address, status: status, webhook_listener_url: webhook_listener_url, is_duplicate: is_duplicate, account_type: account_type, completed_at: completed_at, 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.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 145 def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.integration&.is_a?(String) != false || raise("Passed value for field obj.integration is not the expected type, validation failed.") obj.integration_slug&.is_a?(String) != false || raise("Passed value for field obj.integration_slug is not the expected type, validation failed.") obj.category&.is_a?(Merge::Accounting::CategoryEnum) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") obj.end_user_origin_id&.is_a?(String) != false || raise("Passed value for field obj.end_user_origin_id is not the expected type, validation failed.") obj.end_user_organization_name&.is_a?(String) != false || raise("Passed value for field obj.end_user_organization_name is not the expected type, validation failed.") obj.end_user_email_address&.is_a?(String) != false || raise("Passed value for field obj.end_user_email_address is not the expected type, validation failed.") obj.status&.is_a?(String) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.webhook_listener_url&.is_a?(String) != false || raise("Passed value for field obj.webhook_listener_url is not the expected type, validation failed.") obj.is_duplicate&.is_a?(Boolean) != false || raise("Passed value for field obj.is_duplicate is not the expected type, validation failed.") obj.account_type&.is_a?(String) != false || raise("Passed value for field obj.account_type is not the expected type, validation failed.") obj.completed_at&.is_a?(DateTime) != false || raise("Passed value for field obj.completed_at is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of AccountDetails to a JSON object
135 136 137 |
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 135 def to_json(*_args) @_field_set&.to_json end |