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,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 CreateBroadcastRequestSegmentFilters < ApiModelBase
18
+ attr_accessor :tags
19
+
20
+ attr_accessor :is_subscribed
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'tags' => :'tags',
26
+ :'is_subscribed' => :'isSubscribed'
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
+ :'tags' => :'Array<String>',
44
+ :'is_subscribed' => :'Boolean'
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::CreateBroadcastRequestSegmentFilters` 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::CreateBroadcastRequestSegmentFilters`. 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?(:'tags')
71
+ if (value = attributes[:'tags']).is_a?(Array)
72
+ self.tags = value
73
+ end
74
+ end
75
+
76
+ if attributes.key?(:'is_subscribed')
77
+ self.is_subscribed = attributes[:'is_subscribed']
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
+ tags == o.tags &&
102
+ is_subscribed == o.is_subscribed
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
+ [tags, is_subscribed].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,168 @@
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
+ # WhatsApp template (required when platform is whatsapp)
18
+ class CreateBroadcastRequestTemplate < ApiModelBase
19
+ attr_accessor :name
20
+
21
+ attr_accessor :language
22
+
23
+ attr_accessor :components
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'name' => :'name',
29
+ :'language' => :'language',
30
+ :'components' => :'components'
31
+ }
32
+ end
33
+
34
+ # Returns attribute mapping this model knows about
35
+ def self.acceptable_attribute_map
36
+ attribute_map
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ acceptable_attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'name' => :'String',
48
+ :'language' => :'String',
49
+ :'components' => :'Array<Object>'
50
+ }
51
+ end
52
+
53
+ # List of attributes with nullable: true
54
+ def self.openapi_nullable
55
+ Set.new([
56
+ ])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateBroadcastRequestTemplate` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ acceptable_attribute_map = self.class.acceptable_attribute_map
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!acceptable_attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateBroadcastRequestTemplate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'name')
76
+ self.name = attributes[:'name']
77
+ end
78
+
79
+ if attributes.key?(:'language')
80
+ self.language = attributes[:'language']
81
+ end
82
+
83
+ if attributes.key?(:'components')
84
+ if (value = attributes[:'components']).is_a?(Array)
85
+ self.components = value
86
+ end
87
+ end
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ invalid_properties = Array.new
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
+ true
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ name == o.name &&
111
+ language == o.language &&
112
+ components == o.components
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [name, language, components].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ attributes = attributes.transform_keys(&:to_sym)
133
+ transformed_hash = {}
134
+ openapi_types.each_pair do |key, type|
135
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = nil
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
143
+ elsif !attributes[attribute_map[key]].nil?
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
145
+ end
146
+ end
147
+ new(transformed_hash)
148
+ end
149
+
150
+ # Returns the object in the form of hash
151
+ # @return [Hash] Returns the object in the form of hash
152
+ def to_hash
153
+ hash = {}
154
+ self.class.attribute_map.each_pair do |attr, param|
155
+ value = self.send(attr)
156
+ if value.nil?
157
+ is_nullable = self.class.openapi_nullable.include?(attr)
158
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
159
+ end
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ end
167
+
168
+ end
@@ -0,0 +1,359 @@
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 CreateCommentAutomationRequest < ApiModelBase
18
+ attr_accessor :profile_id
19
+
20
+ # Instagram or Facebook account ID
21
+ attr_accessor :account_id
22
+
23
+ # Platform media/post ID
24
+ attr_accessor :platform_post_id
25
+
26
+ # Zernio post ID (optional)
27
+ attr_accessor :post_id
28
+
29
+ # Post content snippet for display
30
+ attr_accessor :post_title
31
+
32
+ # Automation label
33
+ attr_accessor :name
34
+
35
+ # Trigger keywords (empty = any comment triggers)
36
+ attr_accessor :keywords
37
+
38
+ attr_accessor :match_mode
39
+
40
+ # DM text to send to commenter
41
+ attr_accessor :dm_message
42
+
43
+ # Optional public reply to the comment
44
+ attr_accessor :comment_reply
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'profile_id' => :'profileId',
72
+ :'account_id' => :'accountId',
73
+ :'platform_post_id' => :'platformPostId',
74
+ :'post_id' => :'postId',
75
+ :'post_title' => :'postTitle',
76
+ :'name' => :'name',
77
+ :'keywords' => :'keywords',
78
+ :'match_mode' => :'matchMode',
79
+ :'dm_message' => :'dmMessage',
80
+ :'comment_reply' => :'commentReply'
81
+ }
82
+ end
83
+
84
+ # Returns attribute mapping this model knows about
85
+ def self.acceptable_attribute_map
86
+ attribute_map
87
+ end
88
+
89
+ # Returns all the JSON keys this model knows about
90
+ def self.acceptable_attributes
91
+ acceptable_attribute_map.values
92
+ end
93
+
94
+ # Attribute type mapping.
95
+ def self.openapi_types
96
+ {
97
+ :'profile_id' => :'String',
98
+ :'account_id' => :'String',
99
+ :'platform_post_id' => :'String',
100
+ :'post_id' => :'String',
101
+ :'post_title' => :'String',
102
+ :'name' => :'String',
103
+ :'keywords' => :'Array<String>',
104
+ :'match_mode' => :'String',
105
+ :'dm_message' => :'String',
106
+ :'comment_reply' => :'String'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::CreateCommentAutomationRequest` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ acceptable_attribute_map = self.class.acceptable_attribute_map
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!acceptable_attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::CreateCommentAutomationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'profile_id')
133
+ self.profile_id = attributes[:'profile_id']
134
+ else
135
+ self.profile_id = nil
136
+ end
137
+
138
+ if attributes.key?(:'account_id')
139
+ self.account_id = attributes[:'account_id']
140
+ else
141
+ self.account_id = nil
142
+ end
143
+
144
+ if attributes.key?(:'platform_post_id')
145
+ self.platform_post_id = attributes[:'platform_post_id']
146
+ else
147
+ self.platform_post_id = nil
148
+ end
149
+
150
+ if attributes.key?(:'post_id')
151
+ self.post_id = attributes[:'post_id']
152
+ end
153
+
154
+ if attributes.key?(:'post_title')
155
+ self.post_title = attributes[:'post_title']
156
+ end
157
+
158
+ if attributes.key?(:'name')
159
+ self.name = attributes[:'name']
160
+ else
161
+ self.name = nil
162
+ end
163
+
164
+ if attributes.key?(:'keywords')
165
+ if (value = attributes[:'keywords']).is_a?(Array)
166
+ self.keywords = value
167
+ end
168
+ end
169
+
170
+ if attributes.key?(:'match_mode')
171
+ self.match_mode = attributes[:'match_mode']
172
+ else
173
+ self.match_mode = 'contains'
174
+ end
175
+
176
+ if attributes.key?(:'dm_message')
177
+ self.dm_message = attributes[:'dm_message']
178
+ else
179
+ self.dm_message = nil
180
+ end
181
+
182
+ if attributes.key?(:'comment_reply')
183
+ self.comment_reply = attributes[:'comment_reply']
184
+ end
185
+ end
186
+
187
+ # Show invalid properties with the reasons. Usually used together with valid?
188
+ # @return Array for valid properties with the reasons
189
+ def list_invalid_properties
190
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
191
+ invalid_properties = Array.new
192
+ if @profile_id.nil?
193
+ invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
194
+ end
195
+
196
+ if @account_id.nil?
197
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
198
+ end
199
+
200
+ if @platform_post_id.nil?
201
+ invalid_properties.push('invalid value for "platform_post_id", platform_post_id cannot be nil.')
202
+ end
203
+
204
+ if @name.nil?
205
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
206
+ end
207
+
208
+ if @dm_message.nil?
209
+ invalid_properties.push('invalid value for "dm_message", dm_message cannot be nil.')
210
+ end
211
+
212
+ invalid_properties
213
+ end
214
+
215
+ # Check to see if the all the properties in the model are valid
216
+ # @return true if the model is valid
217
+ def valid?
218
+ warn '[DEPRECATED] the `valid?` method is obsolete'
219
+ return false if @profile_id.nil?
220
+ return false if @account_id.nil?
221
+ return false if @platform_post_id.nil?
222
+ return false if @name.nil?
223
+ match_mode_validator = EnumAttributeValidator.new('String', ["exact", "contains"])
224
+ return false unless match_mode_validator.valid?(@match_mode)
225
+ return false if @dm_message.nil?
226
+ true
227
+ end
228
+
229
+ # Custom attribute writer method with validation
230
+ # @param [Object] profile_id Value to be assigned
231
+ def profile_id=(profile_id)
232
+ if profile_id.nil?
233
+ fail ArgumentError, 'profile_id cannot be nil'
234
+ end
235
+
236
+ @profile_id = profile_id
237
+ end
238
+
239
+ # Custom attribute writer method with validation
240
+ # @param [Object] account_id Value to be assigned
241
+ def account_id=(account_id)
242
+ if account_id.nil?
243
+ fail ArgumentError, 'account_id cannot be nil'
244
+ end
245
+
246
+ @account_id = account_id
247
+ end
248
+
249
+ # Custom attribute writer method with validation
250
+ # @param [Object] platform_post_id Value to be assigned
251
+ def platform_post_id=(platform_post_id)
252
+ if platform_post_id.nil?
253
+ fail ArgumentError, 'platform_post_id cannot be nil'
254
+ end
255
+
256
+ @platform_post_id = platform_post_id
257
+ end
258
+
259
+ # Custom attribute writer method with validation
260
+ # @param [Object] name Value to be assigned
261
+ def name=(name)
262
+ if name.nil?
263
+ fail ArgumentError, 'name cannot be nil'
264
+ end
265
+
266
+ @name = name
267
+ end
268
+
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] match_mode Object to be assigned
271
+ def match_mode=(match_mode)
272
+ validator = EnumAttributeValidator.new('String', ["exact", "contains"])
273
+ unless validator.valid?(match_mode)
274
+ fail ArgumentError, "invalid value for \"match_mode\", must be one of #{validator.allowable_values}."
275
+ end
276
+ @match_mode = match_mode
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] dm_message Value to be assigned
281
+ def dm_message=(dm_message)
282
+ if dm_message.nil?
283
+ fail ArgumentError, 'dm_message cannot be nil'
284
+ end
285
+
286
+ @dm_message = dm_message
287
+ end
288
+
289
+ # Checks equality by comparing each attribute.
290
+ # @param [Object] Object to be compared
291
+ def ==(o)
292
+ return true if self.equal?(o)
293
+ self.class == o.class &&
294
+ profile_id == o.profile_id &&
295
+ account_id == o.account_id &&
296
+ platform_post_id == o.platform_post_id &&
297
+ post_id == o.post_id &&
298
+ post_title == o.post_title &&
299
+ name == o.name &&
300
+ keywords == o.keywords &&
301
+ match_mode == o.match_mode &&
302
+ dm_message == o.dm_message &&
303
+ comment_reply == o.comment_reply
304
+ end
305
+
306
+ # @see the `==` method
307
+ # @param [Object] Object to be compared
308
+ def eql?(o)
309
+ self == o
310
+ end
311
+
312
+ # Calculates hash code according to all attributes.
313
+ # @return [Integer] Hash code
314
+ def hash
315
+ [profile_id, account_id, platform_post_id, post_id, post_title, name, keywords, match_mode, dm_message, comment_reply].hash
316
+ end
317
+
318
+ # Builds the object from hash
319
+ # @param [Hash] attributes Model attributes in the form of hash
320
+ # @return [Object] Returns the model itself
321
+ def self.build_from_hash(attributes)
322
+ return nil unless attributes.is_a?(Hash)
323
+ attributes = attributes.transform_keys(&:to_sym)
324
+ transformed_hash = {}
325
+ openapi_types.each_pair do |key, type|
326
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
327
+ transformed_hash["#{key}"] = nil
328
+ elsif type =~ /\AArray<(.*)>/i
329
+ # check to ensure the input is an array given that the attribute
330
+ # is documented as an array but the input is not
331
+ if attributes[attribute_map[key]].is_a?(Array)
332
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
333
+ end
334
+ elsif !attributes[attribute_map[key]].nil?
335
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
336
+ end
337
+ end
338
+ new(transformed_hash)
339
+ end
340
+
341
+ # Returns the object in the form of hash
342
+ # @return [Hash] Returns the object in the form of hash
343
+ def to_hash
344
+ hash = {}
345
+ self.class.attribute_map.each_pair do |attr, param|
346
+ value = self.send(attr)
347
+ if value.nil?
348
+ is_nullable = self.class.openapi_nullable.include?(attr)
349
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
350
+ end
351
+
352
+ hash[param] = _to_hash(value)
353
+ end
354
+ hash
355
+ end
356
+
357
+ end
358
+
359
+ end