late-sdk 0.0.67 → 0.0.69

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 (101) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +63 -0
  3. data/docs/AddBroadcastRecipientsRequest.md +20 -0
  4. data/docs/BroadcastsApi.md +699 -0
  5. data/docs/BulkCreateContactsRequest.md +24 -0
  6. data/docs/BulkCreateContactsRequestContactsInner.md +28 -0
  7. data/docs/CommentAutomationsApi.md +428 -0
  8. data/docs/ContactsApi.md +500 -0
  9. data/docs/CreateBroadcastRequest.md +32 -0
  10. data/docs/CreateBroadcastRequestMessage.md +20 -0
  11. data/docs/CreateBroadcastRequestMessageAttachmentsInner.md +22 -0
  12. data/docs/CreateBroadcastRequestSegmentFilters.md +20 -0
  13. data/docs/CreateBroadcastRequestTemplate.md +22 -0
  14. data/docs/CreateCommentAutomationRequest.md +36 -0
  15. data/docs/CreateContactRequest.md +38 -0
  16. data/docs/CreateCustomFieldRequest.md +26 -0
  17. data/docs/CreateSequenceRequest.md +32 -0
  18. data/docs/CreateSequenceRequestStepsInner.md +24 -0
  19. data/docs/CreateSequenceRequestStepsInnerMessage.md +18 -0
  20. data/docs/CustomFieldsApi.md +419 -0
  21. data/docs/EnrollContactsRequest.md +20 -0
  22. data/docs/ListCommentAutomations200Response.md +20 -0
  23. data/docs/ListCommentAutomations200ResponseAutomationsInner.md +42 -0
  24. data/docs/ListCommentAutomations200ResponseAutomationsInnerStats.md +24 -0
  25. data/docs/ScheduleBroadcastRequest.md +18 -0
  26. data/docs/SequencesApi.md +697 -0
  27. data/docs/SetContactFieldValueRequest.md +18 -0
  28. data/docs/TwitterPlatformData.md +3 -1
  29. data/docs/TwitterPlatformDataPoll.md +20 -0
  30. data/docs/UpdateCommentAutomationRequest.md +28 -0
  31. data/docs/UpdateContactRequest.md +32 -0
  32. data/docs/UpdateCustomFieldRequest.md +20 -0
  33. data/docs/WhatsAppApi.md +25 -25
  34. data/lib/late-sdk/api/broadcasts_api.rb +689 -0
  35. data/lib/late-sdk/api/comment_automations_api.rb +420 -0
  36. data/lib/late-sdk/api/contacts_api.rb +503 -0
  37. data/lib/late-sdk/api/custom_fields_api.rb +424 -0
  38. data/lib/late-sdk/api/sequences_api.rb +681 -0
  39. data/lib/late-sdk/api/whats_app_api.rb +50 -50
  40. data/lib/late-sdk/models/add_broadcast_recipients_request.rb +160 -0
  41. data/lib/late-sdk/models/bulk_create_contacts_request.rb +253 -0
  42. data/lib/late-sdk/models/bulk_create_contacts_request_contacts_inner.rb +228 -0
  43. data/lib/late-sdk/models/create_broadcast_request.rb +302 -0
  44. data/lib/late-sdk/models/create_broadcast_request_message.rb +158 -0
  45. data/lib/late-sdk/models/create_broadcast_request_message_attachments_inner.rb +165 -0
  46. data/lib/late-sdk/models/create_broadcast_request_segment_filters.rb +158 -0
  47. data/lib/late-sdk/models/create_broadcast_request_template.rb +168 -0
  48. data/lib/late-sdk/models/create_comment_automation_request.rb +359 -0
  49. data/lib/late-sdk/models/create_contact_request.rb +276 -0
  50. data/lib/late-sdk/models/create_custom_field_request.rb +262 -0
  51. data/lib/late-sdk/models/create_sequence_request.rb +308 -0
  52. data/lib/late-sdk/models/create_sequence_request_steps_inner.rb +208 -0
  53. data/lib/late-sdk/models/create_sequence_request_steps_inner_message.rb +147 -0
  54. data/lib/late-sdk/models/enroll_contacts_request.rb +178 -0
  55. data/lib/late-sdk/models/list_comment_automations200_response.rb +158 -0
  56. data/lib/late-sdk/models/list_comment_automations200_response_automations_inner.rb +303 -0
  57. data/lib/late-sdk/models/list_comment_automations200_response_automations_inner_stats.rb +174 -0
  58. data/lib/late-sdk/models/schedule_broadcast_request.rb +164 -0
  59. data/lib/late-sdk/models/set_contact_field_value_request.rb +150 -0
  60. data/lib/late-sdk/models/twitter_platform_data.rb +13 -4
  61. data/lib/late-sdk/models/twitter_platform_data_poll.rb +231 -0
  62. data/lib/late-sdk/models/update_comment_automation_request.rb +228 -0
  63. data/lib/late-sdk/models/update_contact_request.rb +212 -0
  64. data/lib/late-sdk/models/update_custom_field_request.rb +158 -0
  65. data/lib/late-sdk/version.rb +1 -1
  66. data/lib/late-sdk.rb +29 -0
  67. data/openapi.yaml +830 -13
  68. data/spec/api/broadcasts_api_spec.rb +154 -0
  69. data/spec/api/comment_automations_api_spec.rb +108 -0
  70. data/spec/api/contacts_api_spec.rb +122 -0
  71. data/spec/api/custom_fields_api_spec.rb +105 -0
  72. data/spec/api/sequences_api_spec.rb +153 -0
  73. data/spec/api/whats_app_api_spec.rb +25 -25
  74. data/spec/models/add_broadcast_recipients_request_spec.rb +42 -0
  75. data/spec/models/bulk_create_contacts_request_contacts_inner_spec.rb +66 -0
  76. data/spec/models/bulk_create_contacts_request_spec.rb +54 -0
  77. data/spec/models/create_broadcast_request_message_attachments_inner_spec.rb +48 -0
  78. data/spec/models/create_broadcast_request_message_spec.rb +42 -0
  79. data/spec/models/create_broadcast_request_segment_filters_spec.rb +42 -0
  80. data/spec/models/create_broadcast_request_spec.rb +82 -0
  81. data/spec/models/create_broadcast_request_template_spec.rb +48 -0
  82. data/spec/models/create_comment_automation_request_spec.rb +94 -0
  83. data/spec/models/create_contact_request_spec.rb +96 -0
  84. data/spec/models/create_custom_field_request_spec.rb +64 -0
  85. data/spec/models/create_sequence_request_spec.rb +82 -0
  86. data/spec/models/create_sequence_request_steps_inner_message_spec.rb +36 -0
  87. data/spec/models/create_sequence_request_steps_inner_spec.rb +54 -0
  88. data/spec/models/enroll_contacts_request_spec.rb +42 -0
  89. data/spec/models/list_comment_automations200_response_automations_inner_spec.rb +116 -0
  90. data/spec/models/list_comment_automations200_response_automations_inner_stats_spec.rb +54 -0
  91. data/spec/models/list_comment_automations200_response_spec.rb +42 -0
  92. data/spec/models/schedule_broadcast_request_spec.rb +36 -0
  93. data/spec/models/set_contact_field_value_request_spec.rb +36 -0
  94. data/spec/models/twitter_platform_data_poll_spec.rb +42 -0
  95. data/spec/models/twitter_platform_data_spec.rb +6 -0
  96. data/spec/models/update_comment_automation_request_spec.rb +70 -0
  97. data/spec/models/update_contact_request_spec.rb +78 -0
  98. data/spec/models/update_custom_field_request_spec.rb +42 -0
  99. data/zernio-sdk-0.0.69.gem +0 -0
  100. metadata +118 -2
  101. data/zernio-sdk-0.0.67.gem +0 -0
@@ -0,0 +1,231 @@
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
+ # Create a poll with this tweet. Mutually exclusive with media attachments and threads.
18
+ class TwitterPlatformDataPoll < ApiModelBase
19
+ # Poll options (2-4 choices, max 25 characters each)
20
+ attr_accessor :options
21
+
22
+ # Poll duration in minutes (5 min to 7 days)
23
+ attr_accessor :duration_minutes
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'options' => :'options',
29
+ :'duration_minutes' => :'duration_minutes'
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
+ :'options' => :'Array<String>',
47
+ :'duration_minutes' => :'Integer'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::TwitterPlatformDataPoll` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ acceptable_attribute_map = self.class.acceptable_attribute_map
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!acceptable_attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::TwitterPlatformDataPoll`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
69
+ end
70
+ h[k.to_sym] = v
71
+ }
72
+
73
+ if attributes.key?(:'options')
74
+ if (value = attributes[:'options']).is_a?(Array)
75
+ self.options = value
76
+ end
77
+ else
78
+ self.options = nil
79
+ end
80
+
81
+ if attributes.key?(:'duration_minutes')
82
+ self.duration_minutes = attributes[:'duration_minutes']
83
+ else
84
+ self.duration_minutes = nil
85
+ end
86
+ end
87
+
88
+ # Show invalid properties with the reasons. Usually used together with valid?
89
+ # @return Array for valid properties with the reasons
90
+ def list_invalid_properties
91
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
92
+ invalid_properties = Array.new
93
+ if @options.nil?
94
+ invalid_properties.push('invalid value for "options", options cannot be nil.')
95
+ end
96
+
97
+ if @options.length > 4
98
+ invalid_properties.push('invalid value for "options", number of items must be less than or equal to 4.')
99
+ end
100
+
101
+ if @options.length < 2
102
+ invalid_properties.push('invalid value for "options", number of items must be greater than or equal to 2.')
103
+ end
104
+
105
+ if @duration_minutes.nil?
106
+ invalid_properties.push('invalid value for "duration_minutes", duration_minutes cannot be nil.')
107
+ end
108
+
109
+ if @duration_minutes > 10080
110
+ invalid_properties.push('invalid value for "duration_minutes", must be smaller than or equal to 10080.')
111
+ end
112
+
113
+ if @duration_minutes < 5
114
+ invalid_properties.push('invalid value for "duration_minutes", must be greater than or equal to 5.')
115
+ end
116
+
117
+ invalid_properties
118
+ end
119
+
120
+ # Check to see if the all the properties in the model are valid
121
+ # @return true if the model is valid
122
+ def valid?
123
+ warn '[DEPRECATED] the `valid?` method is obsolete'
124
+ return false if @options.nil?
125
+ return false if @options.length > 4
126
+ return false if @options.length < 2
127
+ return false if @duration_minutes.nil?
128
+ return false if @duration_minutes > 10080
129
+ return false if @duration_minutes < 5
130
+ true
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] options Value to be assigned
135
+ def options=(options)
136
+ if options.nil?
137
+ fail ArgumentError, 'options cannot be nil'
138
+ end
139
+
140
+ if options.length > 4
141
+ fail ArgumentError, 'invalid value for "options", number of items must be less than or equal to 4.'
142
+ end
143
+
144
+ if options.length < 2
145
+ fail ArgumentError, 'invalid value for "options", number of items must be greater than or equal to 2.'
146
+ end
147
+
148
+ @options = options
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] duration_minutes Value to be assigned
153
+ def duration_minutes=(duration_minutes)
154
+ if duration_minutes.nil?
155
+ fail ArgumentError, 'duration_minutes cannot be nil'
156
+ end
157
+
158
+ if duration_minutes > 10080
159
+ fail ArgumentError, 'invalid value for "duration_minutes", must be smaller than or equal to 10080.'
160
+ end
161
+
162
+ if duration_minutes < 5
163
+ fail ArgumentError, 'invalid value for "duration_minutes", must be greater than or equal to 5.'
164
+ end
165
+
166
+ @duration_minutes = duration_minutes
167
+ end
168
+
169
+ # Checks equality by comparing each attribute.
170
+ # @param [Object] Object to be compared
171
+ def ==(o)
172
+ return true if self.equal?(o)
173
+ self.class == o.class &&
174
+ options == o.options &&
175
+ duration_minutes == o.duration_minutes
176
+ end
177
+
178
+ # @see the `==` method
179
+ # @param [Object] Object to be compared
180
+ def eql?(o)
181
+ self == o
182
+ end
183
+
184
+ # Calculates hash code according to all attributes.
185
+ # @return [Integer] Hash code
186
+ def hash
187
+ [options, duration_minutes].hash
188
+ end
189
+
190
+ # Builds the object from hash
191
+ # @param [Hash] attributes Model attributes in the form of hash
192
+ # @return [Object] Returns the model itself
193
+ def self.build_from_hash(attributes)
194
+ return nil unless attributes.is_a?(Hash)
195
+ attributes = attributes.transform_keys(&:to_sym)
196
+ transformed_hash = {}
197
+ openapi_types.each_pair do |key, type|
198
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = nil
200
+ elsif type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[attribute_map[key]].is_a?(Array)
204
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
205
+ end
206
+ elsif !attributes[attribute_map[key]].nil?
207
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
208
+ end
209
+ end
210
+ new(transformed_hash)
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -0,0 +1,228 @@
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 UpdateCommentAutomationRequest < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ attr_accessor :keywords
21
+
22
+ attr_accessor :match_mode
23
+
24
+ attr_accessor :dm_message
25
+
26
+ attr_accessor :comment_reply
27
+
28
+ attr_accessor :is_active
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'name' => :'name',
56
+ :'keywords' => :'keywords',
57
+ :'match_mode' => :'matchMode',
58
+ :'dm_message' => :'dmMessage',
59
+ :'comment_reply' => :'commentReply',
60
+ :'is_active' => :'isActive'
61
+ }
62
+ end
63
+
64
+ # Returns attribute mapping this model knows about
65
+ def self.acceptable_attribute_map
66
+ attribute_map
67
+ end
68
+
69
+ # Returns all the JSON keys this model knows about
70
+ def self.acceptable_attributes
71
+ acceptable_attribute_map.values
72
+ end
73
+
74
+ # Attribute type mapping.
75
+ def self.openapi_types
76
+ {
77
+ :'name' => :'String',
78
+ :'keywords' => :'Array<String>',
79
+ :'match_mode' => :'String',
80
+ :'dm_message' => :'String',
81
+ :'comment_reply' => :'String',
82
+ :'is_active' => :'Boolean'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateCommentAutomationRequest` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateCommentAutomationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'name')
109
+ self.name = attributes[:'name']
110
+ end
111
+
112
+ if attributes.key?(:'keywords')
113
+ if (value = attributes[:'keywords']).is_a?(Array)
114
+ self.keywords = value
115
+ end
116
+ end
117
+
118
+ if attributes.key?(:'match_mode')
119
+ self.match_mode = attributes[:'match_mode']
120
+ end
121
+
122
+ if attributes.key?(:'dm_message')
123
+ self.dm_message = attributes[:'dm_message']
124
+ end
125
+
126
+ if attributes.key?(:'comment_reply')
127
+ self.comment_reply = attributes[:'comment_reply']
128
+ end
129
+
130
+ if attributes.key?(:'is_active')
131
+ self.is_active = attributes[:'is_active']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ warn '[DEPRECATED] the `valid?` method is obsolete'
147
+ match_mode_validator = EnumAttributeValidator.new('String', ["exact", "contains"])
148
+ return false unless match_mode_validator.valid?(@match_mode)
149
+ true
150
+ end
151
+
152
+ # Custom attribute writer method checking allowed values (enum).
153
+ # @param [Object] match_mode Object to be assigned
154
+ def match_mode=(match_mode)
155
+ validator = EnumAttributeValidator.new('String', ["exact", "contains"])
156
+ unless validator.valid?(match_mode)
157
+ fail ArgumentError, "invalid value for \"match_mode\", must be one of #{validator.allowable_values}."
158
+ end
159
+ @match_mode = match_mode
160
+ end
161
+
162
+ # Checks equality by comparing each attribute.
163
+ # @param [Object] Object to be compared
164
+ def ==(o)
165
+ return true if self.equal?(o)
166
+ self.class == o.class &&
167
+ name == o.name &&
168
+ keywords == o.keywords &&
169
+ match_mode == o.match_mode &&
170
+ dm_message == o.dm_message &&
171
+ comment_reply == o.comment_reply &&
172
+ is_active == o.is_active
173
+ end
174
+
175
+ # @see the `==` method
176
+ # @param [Object] Object to be compared
177
+ def eql?(o)
178
+ self == o
179
+ end
180
+
181
+ # Calculates hash code according to all attributes.
182
+ # @return [Integer] Hash code
183
+ def hash
184
+ [name, keywords, match_mode, dm_message, comment_reply, is_active].hash
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def self.build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ attributes = attributes.transform_keys(&:to_sym)
193
+ transformed_hash = {}
194
+ openapi_types.each_pair do |key, type|
195
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
196
+ transformed_hash["#{key}"] = nil
197
+ elsif type =~ /\AArray<(.*)>/i
198
+ # check to ensure the input is an array given that the attribute
199
+ # is documented as an array but the input is not
200
+ if attributes[attribute_map[key]].is_a?(Array)
201
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
202
+ end
203
+ elsif !attributes[attribute_map[key]].nil?
204
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
205
+ end
206
+ end
207
+ new(transformed_hash)
208
+ end
209
+
210
+ # Returns the object in the form of hash
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_hash
213
+ hash = {}
214
+ self.class.attribute_map.each_pair do |attr, param|
215
+ value = self.send(attr)
216
+ if value.nil?
217
+ is_nullable = self.class.openapi_nullable.include?(attr)
218
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
219
+ end
220
+
221
+ hash[param] = _to_hash(value)
222
+ end
223
+ hash
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -0,0 +1,212 @@
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 UpdateContactRequest < ApiModelBase
18
+ attr_accessor :name
19
+
20
+ attr_accessor :email
21
+
22
+ attr_accessor :company
23
+
24
+ attr_accessor :avatar_url
25
+
26
+ attr_accessor :tags
27
+
28
+ attr_accessor :is_subscribed
29
+
30
+ attr_accessor :is_blocked
31
+
32
+ attr_accessor :notes
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'name' => :'name',
38
+ :'email' => :'email',
39
+ :'company' => :'company',
40
+ :'avatar_url' => :'avatarUrl',
41
+ :'tags' => :'tags',
42
+ :'is_subscribed' => :'isSubscribed',
43
+ :'is_blocked' => :'isBlocked',
44
+ :'notes' => :'notes'
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
+ :'name' => :'String',
62
+ :'email' => :'String',
63
+ :'company' => :'String',
64
+ :'avatar_url' => :'String',
65
+ :'tags' => :'Array<String>',
66
+ :'is_subscribed' => :'Boolean',
67
+ :'is_blocked' => :'Boolean',
68
+ :'notes' => :'String'
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::UpdateContactRequest` 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::UpdateContactRequest`. 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?(:'name')
95
+ self.name = attributes[:'name']
96
+ end
97
+
98
+ if attributes.key?(:'email')
99
+ self.email = attributes[:'email']
100
+ end
101
+
102
+ if attributes.key?(:'company')
103
+ self.company = attributes[:'company']
104
+ end
105
+
106
+ if attributes.key?(:'avatar_url')
107
+ self.avatar_url = attributes[:'avatar_url']
108
+ end
109
+
110
+ if attributes.key?(:'tags')
111
+ if (value = attributes[:'tags']).is_a?(Array)
112
+ self.tags = value
113
+ end
114
+ end
115
+
116
+ if attributes.key?(:'is_subscribed')
117
+ self.is_subscribed = attributes[:'is_subscribed']
118
+ end
119
+
120
+ if attributes.key?(:'is_blocked')
121
+ self.is_blocked = attributes[:'is_blocked']
122
+ end
123
+
124
+ if attributes.key?(:'notes')
125
+ self.notes = attributes[:'notes']
126
+ end
127
+ end
128
+
129
+ # Show invalid properties with the reasons. Usually used together with valid?
130
+ # @return Array for valid properties with the reasons
131
+ def list_invalid_properties
132
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
+ invalid_properties = Array.new
134
+ invalid_properties
135
+ end
136
+
137
+ # Check to see if the all the properties in the model are valid
138
+ # @return true if the model is valid
139
+ def valid?
140
+ warn '[DEPRECATED] the `valid?` method is obsolete'
141
+ true
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ name == o.name &&
150
+ email == o.email &&
151
+ company == o.company &&
152
+ avatar_url == o.avatar_url &&
153
+ tags == o.tags &&
154
+ is_subscribed == o.is_subscribed &&
155
+ is_blocked == o.is_blocked &&
156
+ notes == o.notes
157
+ end
158
+
159
+ # @see the `==` method
160
+ # @param [Object] Object to be compared
161
+ def eql?(o)
162
+ self == o
163
+ end
164
+
165
+ # Calculates hash code according to all attributes.
166
+ # @return [Integer] Hash code
167
+ def hash
168
+ [name, email, company, avatar_url, tags, is_subscribed, is_blocked, notes].hash
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def self.build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ attributes = attributes.transform_keys(&:to_sym)
177
+ transformed_hash = {}
178
+ openapi_types.each_pair do |key, type|
179
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
180
+ transformed_hash["#{key}"] = nil
181
+ elsif type =~ /\AArray<(.*)>/i
182
+ # check to ensure the input is an array given that the attribute
183
+ # is documented as an array but the input is not
184
+ if attributes[attribute_map[key]].is_a?(Array)
185
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
186
+ end
187
+ elsif !attributes[attribute_map[key]].nil?
188
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
189
+ end
190
+ end
191
+ new(transformed_hash)
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ end
211
+
212
+ end