late-sdk 0.0.68 → 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 (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +62 -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/UpdateCommentAutomationRequest.md +28 -0
  29. data/docs/UpdateContactRequest.md +32 -0
  30. data/docs/UpdateCustomFieldRequest.md +20 -0
  31. data/docs/WhatsAppApi.md +25 -25
  32. data/lib/late-sdk/api/broadcasts_api.rb +689 -0
  33. data/lib/late-sdk/api/comment_automations_api.rb +420 -0
  34. data/lib/late-sdk/api/contacts_api.rb +503 -0
  35. data/lib/late-sdk/api/custom_fields_api.rb +424 -0
  36. data/lib/late-sdk/api/sequences_api.rb +681 -0
  37. data/lib/late-sdk/api/whats_app_api.rb +50 -50
  38. data/lib/late-sdk/models/add_broadcast_recipients_request.rb +160 -0
  39. data/lib/late-sdk/models/bulk_create_contacts_request.rb +253 -0
  40. data/lib/late-sdk/models/bulk_create_contacts_request_contacts_inner.rb +228 -0
  41. data/lib/late-sdk/models/create_broadcast_request.rb +302 -0
  42. data/lib/late-sdk/models/create_broadcast_request_message.rb +158 -0
  43. data/lib/late-sdk/models/create_broadcast_request_message_attachments_inner.rb +165 -0
  44. data/lib/late-sdk/models/create_broadcast_request_segment_filters.rb +158 -0
  45. data/lib/late-sdk/models/create_broadcast_request_template.rb +168 -0
  46. data/lib/late-sdk/models/create_comment_automation_request.rb +359 -0
  47. data/lib/late-sdk/models/create_contact_request.rb +276 -0
  48. data/lib/late-sdk/models/create_custom_field_request.rb +262 -0
  49. data/lib/late-sdk/models/create_sequence_request.rb +308 -0
  50. data/lib/late-sdk/models/create_sequence_request_steps_inner.rb +208 -0
  51. data/lib/late-sdk/models/create_sequence_request_steps_inner_message.rb +147 -0
  52. data/lib/late-sdk/models/enroll_contacts_request.rb +178 -0
  53. data/lib/late-sdk/models/list_comment_automations200_response.rb +158 -0
  54. data/lib/late-sdk/models/list_comment_automations200_response_automations_inner.rb +303 -0
  55. data/lib/late-sdk/models/list_comment_automations200_response_automations_inner_stats.rb +174 -0
  56. data/lib/late-sdk/models/schedule_broadcast_request.rb +164 -0
  57. data/lib/late-sdk/models/set_contact_field_value_request.rb +150 -0
  58. data/lib/late-sdk/models/update_comment_automation_request.rb +228 -0
  59. data/lib/late-sdk/models/update_contact_request.rb +212 -0
  60. data/lib/late-sdk/models/update_custom_field_request.rb +158 -0
  61. data/lib/late-sdk/version.rb +1 -1
  62. data/lib/late-sdk.rb +28 -0
  63. data/openapi.yaml +809 -13
  64. data/spec/api/broadcasts_api_spec.rb +154 -0
  65. data/spec/api/comment_automations_api_spec.rb +108 -0
  66. data/spec/api/contacts_api_spec.rb +122 -0
  67. data/spec/api/custom_fields_api_spec.rb +105 -0
  68. data/spec/api/sequences_api_spec.rb +153 -0
  69. data/spec/api/whats_app_api_spec.rb +25 -25
  70. data/spec/models/add_broadcast_recipients_request_spec.rb +42 -0
  71. data/spec/models/bulk_create_contacts_request_contacts_inner_spec.rb +66 -0
  72. data/spec/models/bulk_create_contacts_request_spec.rb +54 -0
  73. data/spec/models/create_broadcast_request_message_attachments_inner_spec.rb +48 -0
  74. data/spec/models/create_broadcast_request_message_spec.rb +42 -0
  75. data/spec/models/create_broadcast_request_segment_filters_spec.rb +42 -0
  76. data/spec/models/create_broadcast_request_spec.rb +82 -0
  77. data/spec/models/create_broadcast_request_template_spec.rb +48 -0
  78. data/spec/models/create_comment_automation_request_spec.rb +94 -0
  79. data/spec/models/create_contact_request_spec.rb +96 -0
  80. data/spec/models/create_custom_field_request_spec.rb +64 -0
  81. data/spec/models/create_sequence_request_spec.rb +82 -0
  82. data/spec/models/create_sequence_request_steps_inner_message_spec.rb +36 -0
  83. data/spec/models/create_sequence_request_steps_inner_spec.rb +54 -0
  84. data/spec/models/enroll_contacts_request_spec.rb +42 -0
  85. data/spec/models/list_comment_automations200_response_automations_inner_spec.rb +116 -0
  86. data/spec/models/list_comment_automations200_response_automations_inner_stats_spec.rb +54 -0
  87. data/spec/models/list_comment_automations200_response_spec.rb +42 -0
  88. data/spec/models/schedule_broadcast_request_spec.rb +36 -0
  89. data/spec/models/set_contact_field_value_request_spec.rb +36 -0
  90. data/spec/models/update_comment_automation_request_spec.rb +70 -0
  91. data/spec/models/update_contact_request_spec.rb +78 -0
  92. data/spec/models/update_custom_field_request_spec.rb +42 -0
  93. data/zernio-sdk-0.0.69.gem +0 -0
  94. metadata +114 -2
  95. data/zernio-sdk-0.0.68.gem +0 -0
@@ -0,0 +1,178 @@
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 EnrollContactsRequest < ApiModelBase
18
+ attr_accessor :contact_ids
19
+
20
+ # Optional. Auto-detected if not provided.
21
+ attr_accessor :channel_ids
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'contact_ids' => :'contactIds',
27
+ :'channel_ids' => :'channelIds'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'contact_ids' => :'Array<String>',
45
+ :'channel_ids' => :'Array<String>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::EnrollContactsRequest` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::EnrollContactsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'contact_ids')
72
+ if (value = attributes[:'contact_ids']).is_a?(Array)
73
+ self.contact_ids = value
74
+ end
75
+ else
76
+ self.contact_ids = nil
77
+ end
78
+
79
+ if attributes.key?(:'channel_ids')
80
+ if (value = attributes[:'channel_ids']).is_a?(Array)
81
+ self.channel_ids = value
82
+ end
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
+ invalid_properties = Array.new
91
+ if @contact_ids.nil?
92
+ invalid_properties.push('invalid value for "contact_ids", contact_ids cannot be nil.')
93
+ end
94
+
95
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ warn '[DEPRECATED] the `valid?` method is obsolete'
102
+ return false if @contact_ids.nil?
103
+ true
104
+ end
105
+
106
+ # Custom attribute writer method with validation
107
+ # @param [Object] contact_ids Value to be assigned
108
+ def contact_ids=(contact_ids)
109
+ if contact_ids.nil?
110
+ fail ArgumentError, 'contact_ids cannot be nil'
111
+ end
112
+
113
+ @contact_ids = contact_ids
114
+ end
115
+
116
+ # Checks equality by comparing each attribute.
117
+ # @param [Object] Object to be compared
118
+ def ==(o)
119
+ return true if self.equal?(o)
120
+ self.class == o.class &&
121
+ contact_ids == o.contact_ids &&
122
+ channel_ids == o.channel_ids
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [contact_ids, channel_ids].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ return nil unless attributes.is_a?(Hash)
142
+ attributes = attributes.transform_keys(&:to_sym)
143
+ transformed_hash = {}
144
+ openapi_types.each_pair do |key, type|
145
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
146
+ transformed_hash["#{key}"] = nil
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[attribute_map[key]].is_a?(Array)
151
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
152
+ end
153
+ elsif !attributes[attribute_map[key]].nil?
154
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
155
+ end
156
+ end
157
+ new(transformed_hash)
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = self.send(attr)
166
+ if value.nil?
167
+ is_nullable = self.class.openapi_nullable.include?(attr)
168
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
169
+ end
170
+
171
+ hash[param] = _to_hash(value)
172
+ end
173
+ hash
174
+ end
175
+
176
+ end
177
+
178
+ end
@@ -0,0 +1,158 @@
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 ListCommentAutomations200Response < ApiModelBase
18
+ attr_accessor :success
19
+
20
+ attr_accessor :automations
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'success' => :'success',
26
+ :'automations' => :'automations'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'success' => :'Boolean',
44
+ :'automations' => :'Array<ListCommentAutomations200ResponseAutomationsInner>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ListCommentAutomations200Response` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListCommentAutomations200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'success')
71
+ self.success = attributes[:'success']
72
+ end
73
+
74
+ if attributes.key?(:'automations')
75
+ if (value = attributes[:'automations']).is_a?(Array)
76
+ self.automations = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ success == o.success &&
102
+ automations == o.automations
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [success, automations].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Returns the object in the form of hash
141
+ # @return [Hash] Returns the object in the form of hash
142
+ def to_hash
143
+ hash = {}
144
+ self.class.attribute_map.each_pair do |attr, param|
145
+ value = self.send(attr)
146
+ if value.nil?
147
+ is_nullable = self.class.openapi_nullable.include?(attr)
148
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
149
+ end
150
+
151
+ hash[param] = _to_hash(value)
152
+ end
153
+ hash
154
+ end
155
+
156
+ end
157
+
158
+ end
@@ -0,0 +1,303 @@
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 ListCommentAutomations200ResponseAutomationsInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :platform
23
+
24
+ attr_accessor :account_id
25
+
26
+ attr_accessor :platform_post_id
27
+
28
+ attr_accessor :post_title
29
+
30
+ attr_accessor :keywords
31
+
32
+ attr_accessor :match_mode
33
+
34
+ attr_accessor :dm_message
35
+
36
+ attr_accessor :comment_reply
37
+
38
+ attr_accessor :is_active
39
+
40
+ attr_accessor :stats
41
+
42
+ attr_accessor :created_at
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'id' => :'id',
70
+ :'name' => :'name',
71
+ :'platform' => :'platform',
72
+ :'account_id' => :'accountId',
73
+ :'platform_post_id' => :'platformPostId',
74
+ :'post_title' => :'postTitle',
75
+ :'keywords' => :'keywords',
76
+ :'match_mode' => :'matchMode',
77
+ :'dm_message' => :'dmMessage',
78
+ :'comment_reply' => :'commentReply',
79
+ :'is_active' => :'isActive',
80
+ :'stats' => :'stats',
81
+ :'created_at' => :'createdAt'
82
+ }
83
+ end
84
+
85
+ # Returns attribute mapping this model knows about
86
+ def self.acceptable_attribute_map
87
+ attribute_map
88
+ end
89
+
90
+ # Returns all the JSON keys this model knows about
91
+ def self.acceptable_attributes
92
+ acceptable_attribute_map.values
93
+ end
94
+
95
+ # Attribute type mapping.
96
+ def self.openapi_types
97
+ {
98
+ :'id' => :'String',
99
+ :'name' => :'String',
100
+ :'platform' => :'String',
101
+ :'account_id' => :'String',
102
+ :'platform_post_id' => :'String',
103
+ :'post_title' => :'String',
104
+ :'keywords' => :'Array<String>',
105
+ :'match_mode' => :'String',
106
+ :'dm_message' => :'String',
107
+ :'comment_reply' => :'String',
108
+ :'is_active' => :'Boolean',
109
+ :'stats' => :'ListCommentAutomations200ResponseAutomationsInnerStats',
110
+ :'created_at' => :'Time'
111
+ }
112
+ end
113
+
114
+ # List of attributes with nullable: true
115
+ def self.openapi_nullable
116
+ Set.new([
117
+ ])
118
+ end
119
+
120
+ # Initializes the object
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ def initialize(attributes = {})
123
+ if (!attributes.is_a?(Hash))
124
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ListCommentAutomations200ResponseAutomationsInner` initialize method"
125
+ end
126
+
127
+ # check to see if the attribute exists and convert string to symbol for hash key
128
+ acceptable_attribute_map = self.class.acceptable_attribute_map
129
+ attributes = attributes.each_with_object({}) { |(k, v), h|
130
+ if (!acceptable_attribute_map.key?(k.to_sym))
131
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListCommentAutomations200ResponseAutomationsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
132
+ end
133
+ h[k.to_sym] = v
134
+ }
135
+
136
+ if attributes.key?(:'id')
137
+ self.id = attributes[:'id']
138
+ end
139
+
140
+ if attributes.key?(:'name')
141
+ self.name = attributes[:'name']
142
+ end
143
+
144
+ if attributes.key?(:'platform')
145
+ self.platform = attributes[:'platform']
146
+ end
147
+
148
+ if attributes.key?(:'account_id')
149
+ self.account_id = attributes[:'account_id']
150
+ end
151
+
152
+ if attributes.key?(:'platform_post_id')
153
+ self.platform_post_id = attributes[:'platform_post_id']
154
+ end
155
+
156
+ if attributes.key?(:'post_title')
157
+ self.post_title = attributes[:'post_title']
158
+ end
159
+
160
+ if attributes.key?(:'keywords')
161
+ if (value = attributes[:'keywords']).is_a?(Array)
162
+ self.keywords = value
163
+ end
164
+ end
165
+
166
+ if attributes.key?(:'match_mode')
167
+ self.match_mode = attributes[:'match_mode']
168
+ end
169
+
170
+ if attributes.key?(:'dm_message')
171
+ self.dm_message = attributes[:'dm_message']
172
+ end
173
+
174
+ if attributes.key?(:'comment_reply')
175
+ self.comment_reply = attributes[:'comment_reply']
176
+ end
177
+
178
+ if attributes.key?(:'is_active')
179
+ self.is_active = attributes[:'is_active']
180
+ end
181
+
182
+ if attributes.key?(:'stats')
183
+ self.stats = attributes[:'stats']
184
+ end
185
+
186
+ if attributes.key?(:'created_at')
187
+ self.created_at = attributes[:'created_at']
188
+ end
189
+ end
190
+
191
+ # Show invalid properties with the reasons. Usually used together with valid?
192
+ # @return Array for valid properties with the reasons
193
+ def list_invalid_properties
194
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
195
+ invalid_properties = Array.new
196
+ invalid_properties
197
+ end
198
+
199
+ # Check to see if the all the properties in the model are valid
200
+ # @return true if the model is valid
201
+ def valid?
202
+ warn '[DEPRECATED] the `valid?` method is obsolete'
203
+ platform_validator = EnumAttributeValidator.new('String', ["instagram", "facebook"])
204
+ return false unless platform_validator.valid?(@platform)
205
+ match_mode_validator = EnumAttributeValidator.new('String', ["exact", "contains"])
206
+ return false unless match_mode_validator.valid?(@match_mode)
207
+ true
208
+ end
209
+
210
+ # Custom attribute writer method checking allowed values (enum).
211
+ # @param [Object] platform Object to be assigned
212
+ def platform=(platform)
213
+ validator = EnumAttributeValidator.new('String', ["instagram", "facebook"])
214
+ unless validator.valid?(platform)
215
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
216
+ end
217
+ @platform = platform
218
+ end
219
+
220
+ # Custom attribute writer method checking allowed values (enum).
221
+ # @param [Object] match_mode Object to be assigned
222
+ def match_mode=(match_mode)
223
+ validator = EnumAttributeValidator.new('String', ["exact", "contains"])
224
+ unless validator.valid?(match_mode)
225
+ fail ArgumentError, "invalid value for \"match_mode\", must be one of #{validator.allowable_values}."
226
+ end
227
+ @match_mode = match_mode
228
+ end
229
+
230
+ # Checks equality by comparing each attribute.
231
+ # @param [Object] Object to be compared
232
+ def ==(o)
233
+ return true if self.equal?(o)
234
+ self.class == o.class &&
235
+ id == o.id &&
236
+ name == o.name &&
237
+ platform == o.platform &&
238
+ account_id == o.account_id &&
239
+ platform_post_id == o.platform_post_id &&
240
+ post_title == o.post_title &&
241
+ keywords == o.keywords &&
242
+ match_mode == o.match_mode &&
243
+ dm_message == o.dm_message &&
244
+ comment_reply == o.comment_reply &&
245
+ is_active == o.is_active &&
246
+ stats == o.stats &&
247
+ created_at == o.created_at
248
+ end
249
+
250
+ # @see the `==` method
251
+ # @param [Object] Object to be compared
252
+ def eql?(o)
253
+ self == o
254
+ end
255
+
256
+ # Calculates hash code according to all attributes.
257
+ # @return [Integer] Hash code
258
+ def hash
259
+ [id, name, platform, account_id, platform_post_id, post_title, keywords, match_mode, dm_message, comment_reply, is_active, stats, created_at].hash
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def self.build_from_hash(attributes)
266
+ return nil unless attributes.is_a?(Hash)
267
+ attributes = attributes.transform_keys(&:to_sym)
268
+ transformed_hash = {}
269
+ openapi_types.each_pair do |key, type|
270
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
271
+ transformed_hash["#{key}"] = nil
272
+ elsif type =~ /\AArray<(.*)>/i
273
+ # check to ensure the input is an array given that the attribute
274
+ # is documented as an array but the input is not
275
+ if attributes[attribute_map[key]].is_a?(Array)
276
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
277
+ end
278
+ elsif !attributes[attribute_map[key]].nil?
279
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
280
+ end
281
+ end
282
+ new(transformed_hash)
283
+ end
284
+
285
+ # Returns the object in the form of hash
286
+ # @return [Hash] Returns the object in the form of hash
287
+ def to_hash
288
+ hash = {}
289
+ self.class.attribute_map.each_pair do |attr, param|
290
+ value = self.send(attr)
291
+ if value.nil?
292
+ is_nullable = self.class.openapi_nullable.include?(attr)
293
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
294
+ end
295
+
296
+ hash[param] = _to_hash(value)
297
+ end
298
+ hash
299
+ end
300
+
301
+ end
302
+
303
+ end