Class: Merge::Accounting::AccountDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/accounting/types/account_details.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • id (String) (defaults to: OMIT)
  • integration (String) (defaults to: OMIT)
  • integration_slug (String) (defaults to: OMIT)
  • category (Merge::Accounting::CategoryEnum) (defaults to: OMIT)
  • end_user_origin_id (String) (defaults to: OMIT)
  • end_user_organization_name (String) (defaults to: OMIT)
  • end_user_email_address (String) (defaults to: OMIT)
  • status (String) (defaults to: OMIT)
  • webhook_listener_url (String) (defaults to: OMIT)
  • is_duplicate (Boolean) (defaults to: OMIT)

    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.

  • account_type (String) (defaults to: OMIT)
  • completed_at (DateTime) (defaults to: OMIT)

    The time at which account completes the linking flow.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 =  if  != 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": ,
    "completed_at": completed_at
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_typeString (readonly)

Returns:

  • (String)


35
36
37
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 35

def 
  @account_type
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#categoryMerge::Accounting::CategoryEnum (readonly)



18
19
20
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 18

def category
  @category
end

#completed_atDateTime (readonly)

Returns The time at which account completes the linking flow.

Returns:

  • (DateTime)

    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_addressString (readonly)

Returns:

  • (String)


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_nameString (readonly)

Returns:

  • (String)


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_idString (readonly)

Returns:

  • (String)


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

#idString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 12

def id
  @id
end

#integrationString (readonly)

Returns:

  • (String)


14
15
16
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 14

def integration
  @integration
end

#integration_slugString (readonly)

Returns:

  • (String)


16
17
18
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 16

def integration_slug
  @integration_slug
end

#is_duplicateBoolean (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.

Returns:

  • (Boolean)

    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

#statusString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 26

def status
  @status
end

#webhook_listener_urlString (readonly)

Returns:

  • (String)


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

Parameters:

  • json_object (String)

Returns:



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"]
   = 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: ,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.&.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

Returns:

  • (String)


135
136
137
# File 'lib/merge_ruby_client/accounting/types/account_details.rb', line 135

def to_json(*_args)
  @_field_set&.to_json
end