Class: Merge::Accounting::AccountDetailsAndActions

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

Overview

# The LinkedAccount Object

### Description
The `LinkedAccount` object is used to represent an end user's link with a
specific integration.
### Usage Example
View a list of your organization's `LinkedAccount` objects.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, status:, end_user_organization_name:, end_user_email_address:, webhook_listener_url:, account_type:, category: OMIT, status_detail: OMIT, end_user_origin_id: OMIT, subdomain: OMIT, is_duplicate: OMIT, integration: OMIT, additional_properties: nil) ⇒ Merge::Accounting::AccountDetailsAndActions

Parameters:

  • id (String)
  • category (Merge::Accounting::CategoryEnum) (defaults to: OMIT)
  • status (Merge::Accounting::AccountDetailsAndActionsStatusEnum)
  • status_detail (String) (defaults to: OMIT)
  • end_user_origin_id (String) (defaults to: OMIT)
  • end_user_organization_name (String)
  • end_user_email_address (String)
  • subdomain (String) (defaults to: OMIT)

    The tenant or domain the customer has provided access to.

  • webhook_listener_url (String)
  • 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.

  • integration (Merge::Accounting::AccountDetailsAndActionsIntegration) (defaults to: OMIT)
  • account_type (String)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
95
96
97
98
99
100
101
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 70

def initialize(id:, status:, end_user_organization_name:, end_user_email_address:, webhook_listener_url:,
               account_type:, category: OMIT, status_detail: OMIT, end_user_origin_id: OMIT, subdomain: OMIT, is_duplicate: OMIT, integration: OMIT, additional_properties: nil)
  @id = id
  @category = category if category != OMIT
  @status = status
  @status_detail = status_detail if status_detail != OMIT
  @end_user_origin_id = end_user_origin_id if end_user_origin_id != OMIT
  @end_user_organization_name = end_user_organization_name
  @end_user_email_address = end_user_email_address
  @subdomain = subdomain if subdomain != OMIT
  @webhook_listener_url = webhook_listener_url
  @is_duplicate = is_duplicate if is_duplicate != OMIT
  @integration = integration if integration != OMIT
  @account_type = 
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "category": category,
    "status": status,
    "status_detail": status_detail,
    "end_user_origin_id": end_user_origin_id,
    "end_user_organization_name": end_user_organization_name,
    "end_user_email_address": end_user_email_address,
    "subdomain": subdomain,
    "webhook_listener_url": webhook_listener_url,
    "is_duplicate": is_duplicate,
    "integration": integration,
    "account_type": 
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_typeString (readonly)

Returns:

  • (String)


44
45
46
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 44

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



46
47
48
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 46

def additional_properties
  @additional_properties
end

#categoryMerge::Accounting::CategoryEnum (readonly)



21
22
23
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 21

def category
  @category
end

#end_user_email_addressString (readonly)

Returns:

  • (String)


31
32
33
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 31

def end_user_email_address
  @end_user_email_address
end

#end_user_organization_nameString (readonly)

Returns:

  • (String)


29
30
31
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 29

def end_user_organization_name
  @end_user_organization_name
end

#end_user_origin_idString (readonly)

Returns:

  • (String)


27
28
29
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 27

def end_user_origin_id
  @end_user_origin_id
end

#idString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 19

def id
  @id
end

#integrationMerge::Accounting::AccountDetailsAndActionsIntegration (readonly)



42
43
44
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 42

def integration
  @integration
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.



40
41
42
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 40

def is_duplicate
  @is_duplicate
end

#statusMerge::Accounting::AccountDetailsAndActionsStatusEnum (readonly)



23
24
25
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 23

def status
  @status
end

#status_detailString (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 25

def status_detail
  @status_detail
end

#subdomainString (readonly)

Returns The tenant or domain the customer has provided access to.

Returns:

  • (String)

    The tenant or domain the customer has provided access to.



33
34
35
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 33

def subdomain
  @subdomain
end

#webhook_listener_urlString (readonly)

Returns:

  • (String)


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

def webhook_listener_url
  @webhook_listener_url
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Accounting::AccountDetailsAndActions

Deserialize a JSON object to an instance of AccountDetailsAndActions

Parameters:

  • json_object (String)

Returns:



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 107

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  category = parsed_json["category"]
  status = parsed_json["status"]
  status_detail = parsed_json["status_detail"]
  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"]
  subdomain = parsed_json["subdomain"]
  webhook_listener_url = parsed_json["webhook_listener_url"]
  is_duplicate = parsed_json["is_duplicate"]
  if parsed_json["integration"].nil?
    integration = nil
  else
    integration = parsed_json["integration"].to_json
    integration = Merge::Accounting::AccountDetailsAndActionsIntegration.from_json(json_object: integration)
  end
   = parsed_json["account_type"]
  new(
    id: id,
    category: category,
    status: status,
    status_detail: status_detail,
    end_user_origin_id: end_user_origin_id,
    end_user_organization_name: end_user_organization_name,
    end_user_email_address: end_user_email_address,
    subdomain: subdomain,
    webhook_listener_url: webhook_listener_url,
    is_duplicate: is_duplicate,
    integration: integration,
    account_type: ,
    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)


157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 157

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.category&.is_a?(Merge::Accounting::CategoryEnum) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
  obj.status.is_a?(Merge::Accounting::AccountDetailsAndActionsStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.status_detail&.is_a?(String) != false || raise("Passed value for field obj.status_detail 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.subdomain&.is_a?(String) != false || raise("Passed value for field obj.subdomain 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.integration.nil? || Merge::Accounting::AccountDetailsAndActionsIntegration.validate_raw(obj: obj.integration)
  obj..is_a?(String) != false || raise("Passed value for field obj.account_type is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AccountDetailsAndActions to a JSON object

Returns:

  • (String)


147
148
149
# File 'lib/merge_ruby_client/accounting/types/account_details_and_actions.rb', line 147

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