Class: Merge::Ticketing::AccountDetailsAndActions

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/ticketing/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:, completed_at:, category: OMIT, status_detail: OMIT, end_user_origin_id: OMIT, subdomain: OMIT, is_duplicate: OMIT, integration: OMIT, integration_specific_fields: OMIT, additional_properties: nil) ⇒ Merge::Ticketing::AccountDetailsAndActions

Parameters:

  • id (String)
  • category (Merge::Ticketing::CategoryEnum) (defaults to: OMIT)
  • status (Merge::Ticketing::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::Ticketing::AccountDetailsAndActionsIntegration) (defaults to: OMIT)
  • account_type (String)
  • completed_at (DateTime)
  • integration_specific_fields (Hash{String => Object}) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 77

def initialize(id:, status:, end_user_organization_name:, end_user_email_address:, webhook_listener_url:,
               account_type:, completed_at:, category: OMIT, status_detail: OMIT, end_user_origin_id: OMIT, subdomain: OMIT, is_duplicate: OMIT, integration: OMIT, integration_specific_fields: 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 = 
  @completed_at = completed_at
  @integration_specific_fields = integration_specific_fields if integration_specific_fields != OMIT
  @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": ,
    "completed_at": completed_at,
    "integration_specific_fields": integration_specific_fields
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_typeString (readonly)

Returns:

  • (String)


45
46
47
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 45

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



51
52
53
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 51

def additional_properties
  @additional_properties
end

#categoryMerge::Ticketing::CategoryEnum (readonly)



22
23
24
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 22

def category
  @category
end

#completed_atDateTime (readonly)

Returns:

  • (DateTime)


47
48
49
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 47

def completed_at
  @completed_at
end

#end_user_email_addressString (readonly)

Returns:

  • (String)


32
33
34
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 32

def end_user_email_address
  @end_user_email_address
end

#end_user_organization_nameString (readonly)

Returns:

  • (String)


30
31
32
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 30

def end_user_organization_name
  @end_user_organization_name
end

#end_user_origin_idString (readonly)

Returns:

  • (String)


28
29
30
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 28

def end_user_origin_id
  @end_user_origin_id
end

#idString (readonly)

Returns:

  • (String)


20
21
22
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 20

def id
  @id
end

#integrationMerge::Ticketing::AccountDetailsAndActionsIntegration (readonly)



43
44
45
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 43

def integration
  @integration
end

#integration_specific_fieldsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


49
50
51
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 49

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



41
42
43
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 41

def is_duplicate
  @is_duplicate
end

#statusMerge::Ticketing::AccountDetailsAndActionsStatusEnum (readonly)



24
25
26
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 24

def status
  @status
end

#status_detailString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 26

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.



34
35
36
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 34

def subdomain
  @subdomain
end

#webhook_listener_urlString (readonly)

Returns:

  • (String)


36
37
38
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 36

def webhook_listener_url
  @webhook_listener_url
end

Class Method Details

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

Deserialize a JSON object to an instance of AccountDetailsAndActions

Parameters:

  • json_object (String)

Returns:



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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 118

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::Ticketing::AccountDetailsAndActionsIntegration.from_json(json_object: integration)
  end
   = parsed_json["account_type"]
  completed_at = (DateTime.parse(parsed_json["completed_at"]) unless parsed_json["completed_at"].nil?)
  integration_specific_fields = parsed_json["integration_specific_fields"]
  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: ,
    completed_at: completed_at,
    integration_specific_fields: integration_specific_fields,
    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)


172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 172

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::Ticketing::CategoryEnum) != false || raise("Passed value for field obj.category is not the expected type, validation failed.")
  obj.status.is_a?(Merge::Ticketing::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::Ticketing::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.")
  obj.completed_at.is_a?(DateTime) != false || raise("Passed value for field obj.completed_at is not the expected type, validation failed.")
  obj.integration_specific_fields&.is_a?(Hash) != false || raise("Passed value for field obj.integration_specific_fields 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)


162
163
164
# File 'lib/merge_ruby_client/ticketing/types/account_details_and_actions.rb', line 162

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