late-sdk 0.0.78 → 0.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -1
  3. data/docs/BulkCreateContacts200Response.md +26 -0
  4. data/docs/CommentAutomationsApi.md +28 -24
  5. data/docs/ContactsApi.md +42 -36
  6. data/docs/CreateCommentAutomation200Response.md +20 -0
  7. data/docs/CreateCommentAutomation200ResponseAutomation.md +38 -0
  8. data/docs/CreateCommentAutomation200ResponseAutomationStats.md +22 -0
  9. data/docs/CreateContact200Response.md +24 -0
  10. data/docs/CreateContact200ResponseChannel.md +24 -0
  11. data/docs/CreateContact200ResponseContact.md +36 -0
  12. data/docs/CreateCustomField200Response.md +20 -0
  13. data/docs/CustomFieldsApi.md +21 -18
  14. data/docs/GetBroadcast200ResponseBroadcast.md +1 -1
  15. data/docs/GetCommentAutomation200Response.md +22 -0
  16. data/docs/GetCommentAutomation200ResponseAutomation.md +46 -0
  17. data/docs/GetCommentAutomation200ResponseLogsInner.md +32 -0
  18. data/docs/GetContact200Response.md +22 -0
  19. data/docs/GetContact200ResponseChannelsInner.md +32 -0
  20. data/docs/GetContact200ResponseContact.md +42 -0
  21. data/docs/GetContactChannels200Response.md +20 -0
  22. data/docs/GetContactChannels200ResponseChannelsInner.md +34 -0
  23. data/docs/ListCommentAutomationLogs200Response.md +22 -0
  24. data/docs/ListContacts200Response.md +24 -0
  25. data/docs/ListContacts200ResponseContactsInner.md +52 -0
  26. data/docs/{GetBroadcast200ResponseBroadcastSegmentFilters.md → ListContacts200ResponseFilters.md} +2 -2
  27. data/docs/ListCustomFields200Response.md +20 -0
  28. data/docs/ListCustomFields200ResponseFieldsInner.md +28 -0
  29. data/docs/UpdateCommentAutomation200Response.md +20 -0
  30. data/docs/UpdateCommentAutomation200ResponseAutomation.md +32 -0
  31. data/docs/UpdateContact200Response.md +20 -0
  32. data/docs/UpdateContact200ResponseContact.md +36 -0
  33. data/docs/UpdateCustomField200Response.md +20 -0
  34. data/docs/UpdateCustomField200ResponseField.md +26 -0
  35. data/lib/late-sdk/api/comment_automations_api.rb +20 -20
  36. data/lib/late-sdk/api/contacts_api.rb +30 -30
  37. data/lib/late-sdk/api/custom_fields_api.rb +15 -15
  38. data/lib/late-sdk/models/bulk_create_contacts200_response.rb +185 -0
  39. data/lib/late-sdk/models/create_comment_automation200_response.rb +156 -0
  40. data/lib/late-sdk/models/create_comment_automation200_response_automation.rb +273 -0
  41. data/lib/late-sdk/models/create_comment_automation200_response_automation_stats.rb +165 -0
  42. data/lib/late-sdk/models/create_contact200_response.rb +174 -0
  43. data/lib/late-sdk/models/create_contact200_response_channel.rb +175 -0
  44. data/lib/late-sdk/models/create_contact200_response_contact.rb +230 -0
  45. data/lib/late-sdk/models/create_custom_field200_response.rb +156 -0
  46. data/lib/late-sdk/models/get_broadcast200_response_broadcast.rb +1 -1
  47. data/lib/late-sdk/models/get_comment_automation200_response.rb +167 -0
  48. data/lib/late-sdk/models/get_comment_automation200_response_automation.rb +309 -0
  49. data/lib/late-sdk/models/get_comment_automation200_response_logs_inner.rb +244 -0
  50. data/lib/late-sdk/models/get_contact200_response.rb +167 -0
  51. data/lib/late-sdk/models/get_contact200_response_channels_inner.rb +210 -0
  52. data/lib/late-sdk/models/get_contact200_response_contact.rb +259 -0
  53. data/lib/late-sdk/models/get_contact_channels200_response.rb +158 -0
  54. data/lib/late-sdk/models/get_contact_channels200_response_channels_inner.rb +219 -0
  55. data/lib/late-sdk/models/list_comment_automation_logs200_response.rb +167 -0
  56. data/lib/late-sdk/models/list_contacts200_response.rb +176 -0
  57. data/lib/late-sdk/models/list_contacts200_response_contacts_inner.rb +302 -0
  58. data/lib/late-sdk/models/{get_broadcast200_response_broadcast_segment_filters.rb → list_contacts200_response_filters.rb} +3 -3
  59. data/lib/late-sdk/models/list_custom_fields200_response.rb +158 -0
  60. data/lib/late-sdk/models/list_custom_fields200_response_fields_inner.rb +228 -0
  61. data/lib/late-sdk/models/update_comment_automation200_response.rb +156 -0
  62. data/lib/late-sdk/models/update_comment_automation200_response_automation.rb +246 -0
  63. data/lib/late-sdk/models/update_contact200_response.rb +156 -0
  64. data/lib/late-sdk/models/update_contact200_response_contact.rb +230 -0
  65. data/lib/late-sdk/models/update_custom_field200_response.rb +156 -0
  66. data/lib/late-sdk/models/update_custom_field200_response_field.rb +185 -0
  67. data/lib/late-sdk/version.rb +1 -1
  68. data/lib/late-sdk.rb +28 -1
  69. data/openapi.yaml +324 -13
  70. data/spec/api/comment_automations_api_spec.rb +4 -4
  71. data/spec/api/contacts_api_spec.rb +6 -6
  72. data/spec/api/custom_fields_api_spec.rb +3 -3
  73. data/spec/models/bulk_create_contacts200_response_spec.rb +60 -0
  74. data/spec/models/create_comment_automation200_response_automation_spec.rb +100 -0
  75. data/spec/models/create_comment_automation200_response_automation_stats_spec.rb +48 -0
  76. data/spec/models/create_comment_automation200_response_spec.rb +42 -0
  77. data/spec/models/create_contact200_response_channel_spec.rb +54 -0
  78. data/spec/models/create_contact200_response_contact_spec.rb +90 -0
  79. data/spec/models/create_contact200_response_spec.rb +54 -0
  80. data/spec/models/create_custom_field200_response_spec.rb +42 -0
  81. data/spec/models/get_comment_automation200_response_automation_spec.rb +124 -0
  82. data/spec/models/get_comment_automation200_response_logs_inner_spec.rb +82 -0
  83. data/spec/models/get_comment_automation200_response_spec.rb +48 -0
  84. data/spec/models/get_contact200_response_channels_inner_spec.rb +78 -0
  85. data/spec/models/get_contact200_response_contact_spec.rb +108 -0
  86. data/spec/models/get_contact200_response_spec.rb +48 -0
  87. data/spec/models/get_contact_channels200_response_channels_inner_spec.rb +84 -0
  88. data/spec/models/get_contact_channels200_response_spec.rb +42 -0
  89. data/spec/models/list_comment_automation_logs200_response_spec.rb +48 -0
  90. data/spec/models/list_contacts200_response_contacts_inner_spec.rb +138 -0
  91. data/spec/models/{get_broadcast200_response_broadcast_segment_filters_spec.rb → list_contacts200_response_filters_spec.rb} +6 -6
  92. data/spec/models/list_contacts200_response_spec.rb +54 -0
  93. data/spec/models/list_custom_fields200_response_fields_inner_spec.rb +70 -0
  94. data/spec/models/list_custom_fields200_response_spec.rb +42 -0
  95. data/spec/models/update_comment_automation200_response_automation_spec.rb +82 -0
  96. data/spec/models/update_comment_automation200_response_spec.rb +42 -0
  97. data/spec/models/update_contact200_response_contact_spec.rb +90 -0
  98. data/spec/models/update_contact200_response_spec.rb +42 -0
  99. data/spec/models/update_custom_field200_response_field_spec.rb +60 -0
  100. data/spec/models/update_custom_field200_response_spec.rb +42 -0
  101. data/zernio-sdk-0.0.79.gem +0 -0
  102. metadata +114 -6
  103. data/zernio-sdk-0.0.78.gem +0 -0
@@ -0,0 +1,167 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class GetContact200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ attr_accessor :contact
21
+
22
+ attr_accessor :channels
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'success' => :'success',
28
+ :'contact' => :'contact',
29
+ :'channels' => :'channels'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'success' => :'Boolean',
47
+ :'contact' => :'GetContact200ResponseContact',
48
+ :'channels' => :'Array<GetContact200ResponseChannelsInner>'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetContact200Response` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetContact200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'success')
75
+ self.success = attributes[:'success']
76
+ end
77
+
78
+ if attributes.key?(:'contact')
79
+ self.contact = attributes[:'contact']
80
+ end
81
+
82
+ if attributes.key?(:'channels')
83
+ if (value = attributes[:'channels']).is_a?(Array)
84
+ self.channels = value
85
+ end
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ success == o.success &&
110
+ contact == o.contact &&
111
+ channels == o.channels
112
+ end
113
+
114
+ # @see the `==` method
115
+ # @param [Object] Object to be compared
116
+ def eql?(o)
117
+ self == o
118
+ end
119
+
120
+ # Calculates hash code according to all attributes.
121
+ # @return [Integer] Hash code
122
+ def hash
123
+ [success, contact, channels].hash
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def self.build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ attributes = attributes.transform_keys(&:to_sym)
132
+ transformed_hash = {}
133
+ openapi_types.each_pair do |key, type|
134
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = nil
136
+ elsif type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[attribute_map[key]].is_a?(Array)
140
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
141
+ end
142
+ elsif !attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
+ end
145
+ end
146
+ new(transformed_hash)
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ if value.nil?
156
+ is_nullable = self.class.openapi_nullable.include?(attr)
157
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
158
+ end
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ end
166
+
167
+ end
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class GetContact200ResponseChannelsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :account_id
21
+
22
+ attr_accessor :platform
23
+
24
+ attr_accessor :platform_identifier
25
+
26
+ attr_accessor :display_identifier
27
+
28
+ attr_accessor :is_subscribed
29
+
30
+ attr_accessor :conversation_id
31
+
32
+ attr_accessor :created_at
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'id' => :'id',
38
+ :'account_id' => :'accountId',
39
+ :'platform' => :'platform',
40
+ :'platform_identifier' => :'platformIdentifier',
41
+ :'display_identifier' => :'displayIdentifier',
42
+ :'is_subscribed' => :'isSubscribed',
43
+ :'conversation_id' => :'conversationId',
44
+ :'created_at' => :'createdAt'
45
+ }
46
+ end
47
+
48
+ # Returns attribute mapping this model knows about
49
+ def self.acceptable_attribute_map
50
+ attribute_map
51
+ end
52
+
53
+ # Returns all the JSON keys this model knows about
54
+ def self.acceptable_attributes
55
+ acceptable_attribute_map.values
56
+ end
57
+
58
+ # Attribute type mapping.
59
+ def self.openapi_types
60
+ {
61
+ :'id' => :'String',
62
+ :'account_id' => :'String',
63
+ :'platform' => :'String',
64
+ :'platform_identifier' => :'String',
65
+ :'display_identifier' => :'String',
66
+ :'is_subscribed' => :'Boolean',
67
+ :'conversation_id' => :'String',
68
+ :'created_at' => :'Time'
69
+ }
70
+ end
71
+
72
+ # List of attributes with nullable: true
73
+ def self.openapi_nullable
74
+ Set.new([
75
+ ])
76
+ end
77
+
78
+ # Initializes the object
79
+ # @param [Hash] attributes Model attributes in the form of hash
80
+ def initialize(attributes = {})
81
+ if (!attributes.is_a?(Hash))
82
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetContact200ResponseChannelsInner` initialize method"
83
+ end
84
+
85
+ # check to see if the attribute exists and convert string to symbol for hash key
86
+ acceptable_attribute_map = self.class.acceptable_attribute_map
87
+ attributes = attributes.each_with_object({}) { |(k, v), h|
88
+ if (!acceptable_attribute_map.key?(k.to_sym))
89
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetContact200ResponseChannelsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
90
+ end
91
+ h[k.to_sym] = v
92
+ }
93
+
94
+ if attributes.key?(:'id')
95
+ self.id = attributes[:'id']
96
+ end
97
+
98
+ if attributes.key?(:'account_id')
99
+ self.account_id = attributes[:'account_id']
100
+ end
101
+
102
+ if attributes.key?(:'platform')
103
+ self.platform = attributes[:'platform']
104
+ end
105
+
106
+ if attributes.key?(:'platform_identifier')
107
+ self.platform_identifier = attributes[:'platform_identifier']
108
+ end
109
+
110
+ if attributes.key?(:'display_identifier')
111
+ self.display_identifier = attributes[:'display_identifier']
112
+ end
113
+
114
+ if attributes.key?(:'is_subscribed')
115
+ self.is_subscribed = attributes[:'is_subscribed']
116
+ end
117
+
118
+ if attributes.key?(:'conversation_id')
119
+ self.conversation_id = attributes[:'conversation_id']
120
+ end
121
+
122
+ if attributes.key?(:'created_at')
123
+ self.created_at = attributes[:'created_at']
124
+ end
125
+ end
126
+
127
+ # Show invalid properties with the reasons. Usually used together with valid?
128
+ # @return Array for valid properties with the reasons
129
+ def list_invalid_properties
130
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
131
+ invalid_properties = Array.new
132
+ invalid_properties
133
+ end
134
+
135
+ # Check to see if the all the properties in the model are valid
136
+ # @return true if the model is valid
137
+ def valid?
138
+ warn '[DEPRECATED] the `valid?` method is obsolete'
139
+ true
140
+ end
141
+
142
+ # Checks equality by comparing each attribute.
143
+ # @param [Object] Object to be compared
144
+ def ==(o)
145
+ return true if self.equal?(o)
146
+ self.class == o.class &&
147
+ id == o.id &&
148
+ account_id == o.account_id &&
149
+ platform == o.platform &&
150
+ platform_identifier == o.platform_identifier &&
151
+ display_identifier == o.display_identifier &&
152
+ is_subscribed == o.is_subscribed &&
153
+ conversation_id == o.conversation_id &&
154
+ created_at == o.created_at
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [id, account_id, platform, platform_identifier, display_identifier, is_subscribed, conversation_id, created_at].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
188
+ end
189
+ new(transformed_hash)
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -0,0 +1,259 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class GetContact200ResponseContact < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :email
23
+
24
+ attr_accessor :company
25
+
26
+ attr_accessor :avatar_url
27
+
28
+ attr_accessor :tags
29
+
30
+ attr_accessor :is_subscribed
31
+
32
+ attr_accessor :is_blocked
33
+
34
+ attr_accessor :custom_fields
35
+
36
+ attr_accessor :notes
37
+
38
+ attr_accessor :conversation_ids
39
+
40
+ attr_accessor :created_at
41
+
42
+ attr_accessor :updated_at
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'id' => :'id',
48
+ :'name' => :'name',
49
+ :'email' => :'email',
50
+ :'company' => :'company',
51
+ :'avatar_url' => :'avatarUrl',
52
+ :'tags' => :'tags',
53
+ :'is_subscribed' => :'isSubscribed',
54
+ :'is_blocked' => :'isBlocked',
55
+ :'custom_fields' => :'customFields',
56
+ :'notes' => :'notes',
57
+ :'conversation_ids' => :'conversationIds',
58
+ :'created_at' => :'createdAt',
59
+ :'updated_at' => :'updatedAt'
60
+ }
61
+ end
62
+
63
+ # Returns attribute mapping this model knows about
64
+ def self.acceptable_attribute_map
65
+ attribute_map
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ acceptable_attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'id' => :'String',
77
+ :'name' => :'String',
78
+ :'email' => :'String',
79
+ :'company' => :'String',
80
+ :'avatar_url' => :'String',
81
+ :'tags' => :'Array<String>',
82
+ :'is_subscribed' => :'Boolean',
83
+ :'is_blocked' => :'Boolean',
84
+ :'custom_fields' => :'Object',
85
+ :'notes' => :'String',
86
+ :'conversation_ids' => :'Array<String>',
87
+ :'created_at' => :'Time',
88
+ :'updated_at' => :'Time'
89
+ }
90
+ end
91
+
92
+ # List of attributes with nullable: true
93
+ def self.openapi_nullable
94
+ Set.new([
95
+ ])
96
+ end
97
+
98
+ # Initializes the object
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ def initialize(attributes = {})
101
+ if (!attributes.is_a?(Hash))
102
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::GetContact200ResponseContact` initialize method"
103
+ end
104
+
105
+ # check to see if the attribute exists and convert string to symbol for hash key
106
+ acceptable_attribute_map = self.class.acceptable_attribute_map
107
+ attributes = attributes.each_with_object({}) { |(k, v), h|
108
+ if (!acceptable_attribute_map.key?(k.to_sym))
109
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::GetContact200ResponseContact`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
110
+ end
111
+ h[k.to_sym] = v
112
+ }
113
+
114
+ if attributes.key?(:'id')
115
+ self.id = attributes[:'id']
116
+ end
117
+
118
+ if attributes.key?(:'name')
119
+ self.name = attributes[:'name']
120
+ end
121
+
122
+ if attributes.key?(:'email')
123
+ self.email = attributes[:'email']
124
+ end
125
+
126
+ if attributes.key?(:'company')
127
+ self.company = attributes[:'company']
128
+ end
129
+
130
+ if attributes.key?(:'avatar_url')
131
+ self.avatar_url = attributes[:'avatar_url']
132
+ end
133
+
134
+ if attributes.key?(:'tags')
135
+ if (value = attributes[:'tags']).is_a?(Array)
136
+ self.tags = value
137
+ end
138
+ end
139
+
140
+ if attributes.key?(:'is_subscribed')
141
+ self.is_subscribed = attributes[:'is_subscribed']
142
+ end
143
+
144
+ if attributes.key?(:'is_blocked')
145
+ self.is_blocked = attributes[:'is_blocked']
146
+ end
147
+
148
+ if attributes.key?(:'custom_fields')
149
+ self.custom_fields = attributes[:'custom_fields']
150
+ end
151
+
152
+ if attributes.key?(:'notes')
153
+ self.notes = attributes[:'notes']
154
+ end
155
+
156
+ if attributes.key?(:'conversation_ids')
157
+ if (value = attributes[:'conversation_ids']).is_a?(Array)
158
+ self.conversation_ids = value
159
+ end
160
+ end
161
+
162
+ if attributes.key?(:'created_at')
163
+ self.created_at = attributes[:'created_at']
164
+ end
165
+
166
+ if attributes.key?(:'updated_at')
167
+ self.updated_at = attributes[:'updated_at']
168
+ end
169
+ end
170
+
171
+ # Show invalid properties with the reasons. Usually used together with valid?
172
+ # @return Array for valid properties with the reasons
173
+ def list_invalid_properties
174
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
175
+ invalid_properties = Array.new
176
+ invalid_properties
177
+ end
178
+
179
+ # Check to see if the all the properties in the model are valid
180
+ # @return true if the model is valid
181
+ def valid?
182
+ warn '[DEPRECATED] the `valid?` method is obsolete'
183
+ true
184
+ end
185
+
186
+ # Checks equality by comparing each attribute.
187
+ # @param [Object] Object to be compared
188
+ def ==(o)
189
+ return true if self.equal?(o)
190
+ self.class == o.class &&
191
+ id == o.id &&
192
+ name == o.name &&
193
+ email == o.email &&
194
+ company == o.company &&
195
+ avatar_url == o.avatar_url &&
196
+ tags == o.tags &&
197
+ is_subscribed == o.is_subscribed &&
198
+ is_blocked == o.is_blocked &&
199
+ custom_fields == o.custom_fields &&
200
+ notes == o.notes &&
201
+ conversation_ids == o.conversation_ids &&
202
+ created_at == o.created_at &&
203
+ updated_at == o.updated_at
204
+ end
205
+
206
+ # @see the `==` method
207
+ # @param [Object] Object to be compared
208
+ def eql?(o)
209
+ self == o
210
+ end
211
+
212
+ # Calculates hash code according to all attributes.
213
+ # @return [Integer] Hash code
214
+ def hash
215
+ [id, name, email, company, avatar_url, tags, is_subscribed, is_blocked, custom_fields, notes, conversation_ids, created_at, updated_at].hash
216
+ end
217
+
218
+ # Builds the object from hash
219
+ # @param [Hash] attributes Model attributes in the form of hash
220
+ # @return [Object] Returns the model itself
221
+ def self.build_from_hash(attributes)
222
+ return nil unless attributes.is_a?(Hash)
223
+ attributes = attributes.transform_keys(&:to_sym)
224
+ transformed_hash = {}
225
+ openapi_types.each_pair do |key, type|
226
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
227
+ transformed_hash["#{key}"] = nil
228
+ elsif type =~ /\AArray<(.*)>/i
229
+ # check to ensure the input is an array given that the attribute
230
+ # is documented as an array but the input is not
231
+ if attributes[attribute_map[key]].is_a?(Array)
232
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
233
+ end
234
+ elsif !attributes[attribute_map[key]].nil?
235
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
236
+ end
237
+ end
238
+ new(transformed_hash)
239
+ end
240
+
241
+ # Returns the object in the form of hash
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_hash
244
+ hash = {}
245
+ self.class.attribute_map.each_pair do |attr, param|
246
+ value = self.send(attr)
247
+ if value.nil?
248
+ is_nullable = self.class.openapi_nullable.include?(attr)
249
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
250
+ end
251
+
252
+ hash[param] = _to_hash(value)
253
+ end
254
+ hash
255
+ end
256
+
257
+ end
258
+
259
+ end