Class: Merge::Filestorage::AccountDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/merge_ruby_client/filestorage/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, additional_properties: nil) ⇒ Merge::Filestorage::AccountDetails

Parameters:

  • id (String) (defaults to: OMIT)
  • integration (String) (defaults to: OMIT)
  • integration_slug (String) (defaults to: OMIT)
  • category (Merge::Filestorage::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)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



59
60
61
62
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
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 59

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

Instance Attribute Details

#account_typeString (readonly)

Returns:

  • (String)


34
35
36
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 34

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



36
37
38
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 36

def additional_properties
  @additional_properties
end

#categoryMerge::Filestorage::CategoryEnum (readonly)



17
18
19
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 17

def category
  @category
end

#end_user_email_addressString (readonly)

Returns:

  • (String)


23
24
25
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 23

def end_user_email_address
  @end_user_email_address
end

#end_user_organization_nameString (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 21

def end_user_organization_name
  @end_user_organization_name
end

#end_user_origin_idString (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 19

def end_user_origin_id
  @end_user_origin_id
end

#idString (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 11

def id
  @id
end

#integrationString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 13

def integration
  @integration
end

#integration_slugString (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 15

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.



32
33
34
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 32

def is_duplicate
  @is_duplicate
end

#statusString (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 25

def status
  @status
end

#webhook_listener_urlString (readonly)

Returns:

  • (String)


27
28
29
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 27

def webhook_listener_url
  @webhook_listener_url
end

Class Method Details

.from_json(json_object:) ⇒ Merge::Filestorage::AccountDetails

Deserialize a JSON object to an instance of AccountDetails

Parameters:

  • json_object (String)

Returns:



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 94

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


137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 137

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::Filestorage::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.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AccountDetails to a JSON object

Returns:

  • (String)


127
128
129
# File 'lib/merge_ruby_client/filestorage/types/account_details.rb', line 127

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