late-sdk 0.0.856 → 0.0.858

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 +27 -2
  3. data/docs/AdCampaignsApi.md +364 -6
  4. data/docs/{ListAdKeywords200ResponseKeywordsInner.md → AdKeyword.md} +7 -3
  5. data/docs/AdKeywordMetrics.md +30 -0
  6. data/docs/AddAdKeywords201Response.md +18 -0
  7. data/docs/AddAdKeywordsRequest.md +24 -0
  8. data/docs/AddAdKeywordsRequestKeywordsInner.md +20 -0
  9. data/docs/AddAdKeywordsRequestKeywordsInnerAnyOf.md +20 -0
  10. data/docs/ChannelPicker.md +20 -0
  11. data/docs/ChannelPickerChannelsInner.md +24 -0
  12. data/docs/ChannelPickerTeam.md +22 -0
  13. data/docs/ConnectApi.md +78 -0
  14. data/docs/CreatePost200Response.md +22 -0
  15. data/docs/CreatePost200ResponseTiktokInner.md +24 -0
  16. data/docs/CreatePostRequest.md +2 -0
  17. data/docs/CreateStandaloneAdRequest.md +4 -2
  18. data/docs/KeywordEntry.md +49 -0
  19. data/docs/ListAdKeywords200Response.md +1 -1
  20. data/docs/ListCampaignNegativeKeywords200Response.md +18 -0
  21. data/docs/ListCampaignNegativeKeywords200ResponseKeywordsInner.md +22 -0
  22. data/docs/ListSlackChannels200Response.md +49 -0
  23. data/docs/PlatformTarget.md +1 -1
  24. data/docs/Post.md +1 -1
  25. data/docs/PostsApi.md +4 -4
  26. data/docs/RemoveAdKeyword200Response.md +20 -0
  27. data/docs/ReplaceCampaignNegativeKeywords200Response.md +22 -0
  28. data/docs/ReplaceCampaignNegativeKeywordsRequest.md +20 -0
  29. data/docs/StartOAuth.md +20 -0
  30. data/docs/UpdateAdKeyword200Response.md +18 -0
  31. data/docs/{UpdateAdStatusRequest.md → UpdateAdKeywordRequest.md} +2 -2
  32. data/docs/WebhookLog.md +1 -1
  33. data/lib/zernio-sdk/api/ad_campaigns_api.rb +358 -9
  34. data/lib/zernio-sdk/api/connect_api.rb +77 -0
  35. data/lib/zernio-sdk/api/posts_api.rb +4 -4
  36. data/lib/zernio-sdk/models/{list_ad_keywords200_response_keywords_inner.rb → ad_keyword.rb} +28 -8
  37. data/lib/zernio-sdk/models/ad_keyword_metrics.rb +207 -0
  38. data/lib/zernio-sdk/models/add_ad_keywords201_response.rb +149 -0
  39. data/lib/zernio-sdk/models/add_ad_keywords_request.rb +250 -0
  40. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner.rb +103 -0
  41. data/lib/zernio-sdk/models/add_ad_keywords_request_keywords_inner_any_of.rb +225 -0
  42. data/lib/zernio-sdk/models/channel_picker.rb +192 -0
  43. data/lib/zernio-sdk/models/channel_picker_channels_inner.rb +244 -0
  44. data/lib/zernio-sdk/models/channel_picker_team.rb +169 -0
  45. data/lib/zernio-sdk/models/create_post200_response.rb +221 -0
  46. data/lib/zernio-sdk/models/create_post200_response_tiktok_inner.rb +227 -0
  47. data/lib/zernio-sdk/models/create_post_request.rb +13 -1
  48. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +55 -5
  49. data/lib/zernio-sdk/models/keyword_entry.rb +105 -0
  50. data/lib/zernio-sdk/models/list_ad_keywords200_response.rb +1 -1
  51. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response.rb +149 -0
  52. data/lib/zernio-sdk/models/list_campaign_negative_keywords200_response_keywords_inner.rb +199 -0
  53. data/lib/zernio-sdk/models/list_slack_channels200_response.rb +104 -0
  54. data/lib/zernio-sdk/models/platform_target.rb +1 -1
  55. data/lib/zernio-sdk/models/post.rb +3 -2
  56. data/lib/zernio-sdk/models/remove_ad_keyword200_response.rb +157 -0
  57. data/lib/zernio-sdk/models/replace_campaign_negative_keywords200_response.rb +170 -0
  58. data/lib/zernio-sdk/models/replace_campaign_negative_keywords_request.rb +219 -0
  59. data/lib/zernio-sdk/models/start_o_auth.rb +190 -0
  60. data/lib/zernio-sdk/models/update_ad_keyword200_response.rb +147 -0
  61. data/lib/zernio-sdk/models/{update_ad_status_request.rb → update_ad_keyword_request.rb} +3 -3
  62. data/lib/zernio-sdk/models/webhook_log.rb +1 -1
  63. data/lib/zernio-sdk/version.rb +1 -1
  64. data/lib/zernio-sdk.rb +21 -2
  65. data/openapi.yaml +390 -27
  66. data/spec/api/ad_campaigns_api_spec.rb +64 -1
  67. data/spec/api/connect_api_spec.rb +15 -0
  68. data/spec/api/posts_api_spec.rb +1 -1
  69. data/spec/models/ad_keyword_metrics_spec.rb +72 -0
  70. data/spec/models/{list_ad_keywords200_response_keywords_inner_spec.rb → ad_keyword_spec.rb} +18 -6
  71. data/spec/models/add_ad_keywords201_response_spec.rb +36 -0
  72. data/spec/models/add_ad_keywords_request_keywords_inner_any_of_spec.rb +46 -0
  73. data/spec/models/add_ad_keywords_request_keywords_inner_spec.rb +21 -0
  74. data/spec/models/add_ad_keywords_request_spec.rb +54 -0
  75. data/spec/models/channel_picker_channels_inner_spec.rb +54 -0
  76. data/spec/models/channel_picker_spec.rb +42 -0
  77. data/spec/models/channel_picker_team_spec.rb +48 -0
  78. data/spec/models/create_post200_response_spec.rb +48 -0
  79. data/spec/models/create_post200_response_tiktok_inner_spec.rb +54 -0
  80. data/spec/models/create_post_request_spec.rb +6 -0
  81. data/spec/models/create_standalone_ad_request_spec.rb +6 -0
  82. data/spec/models/keyword_entry_spec.rb +32 -0
  83. data/spec/models/list_campaign_negative_keywords200_response_keywords_inner_spec.rb +52 -0
  84. data/spec/models/list_campaign_negative_keywords200_response_spec.rb +36 -0
  85. data/spec/models/list_slack_channels200_response_spec.rb +32 -0
  86. data/spec/models/post_spec.rb +1 -1
  87. data/spec/models/remove_ad_keyword200_response_spec.rb +42 -0
  88. data/spec/models/replace_campaign_negative_keywords200_response_spec.rb +48 -0
  89. data/spec/models/replace_campaign_negative_keywords_request_spec.rb +46 -0
  90. data/spec/models/start_o_auth_spec.rb +42 -0
  91. data/spec/models/update_ad_keyword200_response_spec.rb +36 -0
  92. data/spec/models/{update_ad_status_request_spec.rb → update_ad_keyword_request_spec.rb} +6 -6
  93. data/zernio-sdk-0.0.858.gem +0 -0
  94. metadata +86 -10
  95. data/zernio-sdk-0.0.856.gem +0 -0
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 Zernio
17
+ class ChannelPicker < ApiModelBase
18
+ attr_accessor :team
19
+
20
+ attr_accessor :channels
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'team' => :'team',
26
+ :'channels' => :'channels'
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
+ :'team' => :'ChannelPickerTeam',
44
+ :'channels' => :'Array<ChannelPickerChannelsInner>'
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 `Zernio::ChannelPicker` 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 `Zernio::ChannelPicker`. 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?(:'team')
71
+ self.team = attributes[:'team']
72
+ else
73
+ self.team = nil
74
+ end
75
+
76
+ if attributes.key?(:'channels')
77
+ if (value = attributes[:'channels']).is_a?(Array)
78
+ self.channels = value
79
+ end
80
+ else
81
+ self.channels = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @team.nil?
91
+ invalid_properties.push('invalid value for "team", team cannot be nil.')
92
+ end
93
+
94
+ if @channels.nil?
95
+ invalid_properties.push('invalid value for "channels", channels cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @team.nil?
106
+ return false if @channels.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] team Value to be assigned
112
+ def team=(team)
113
+ if team.nil?
114
+ fail ArgumentError, 'team cannot be nil'
115
+ end
116
+
117
+ @team = team
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] channels Value to be assigned
122
+ def channels=(channels)
123
+ if channels.nil?
124
+ fail ArgumentError, 'channels cannot be nil'
125
+ end
126
+
127
+ @channels = channels
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ team == o.team &&
136
+ channels == o.channels
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [team, channels].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 Zernio
17
+ class ChannelPickerChannelsInner < ApiModelBase
18
+ # Channel id (C... or G...), the value to send as channelId on POST
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :is_private
24
+
25
+ # Whether the Zernio bot is already a member of the channel
26
+ attr_accessor :is_member
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'id' => :'id',
32
+ :'name' => :'name',
33
+ :'is_private' => :'isPrivate',
34
+ :'is_member' => :'isMember'
35
+ }
36
+ end
37
+
38
+ # Returns attribute mapping this model knows about
39
+ def self.acceptable_attribute_map
40
+ attribute_map
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ acceptable_attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'id' => :'String',
52
+ :'name' => :'String',
53
+ :'is_private' => :'Boolean',
54
+ :'is_member' => :'Boolean'
55
+ }
56
+ end
57
+
58
+ # List of attributes with nullable: true
59
+ def self.openapi_nullable
60
+ Set.new([
61
+ ])
62
+ end
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ def initialize(attributes = {})
67
+ if (!attributes.is_a?(Hash))
68
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ChannelPickerChannelsInner` initialize method"
69
+ end
70
+
71
+ # check to see if the attribute exists and convert string to symbol for hash key
72
+ acceptable_attribute_map = self.class.acceptable_attribute_map
73
+ attributes = attributes.each_with_object({}) { |(k, v), h|
74
+ if (!acceptable_attribute_map.key?(k.to_sym))
75
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ChannelPickerChannelsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
76
+ end
77
+ h[k.to_sym] = v
78
+ }
79
+
80
+ if attributes.key?(:'id')
81
+ self.id = attributes[:'id']
82
+ else
83
+ self.id = nil
84
+ end
85
+
86
+ if attributes.key?(:'name')
87
+ self.name = attributes[:'name']
88
+ else
89
+ self.name = nil
90
+ end
91
+
92
+ if attributes.key?(:'is_private')
93
+ self.is_private = attributes[:'is_private']
94
+ else
95
+ self.is_private = nil
96
+ end
97
+
98
+ if attributes.key?(:'is_member')
99
+ self.is_member = attributes[:'is_member']
100
+ else
101
+ self.is_member = nil
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @id.nil?
111
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
112
+ end
113
+
114
+ if @name.nil?
115
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
116
+ end
117
+
118
+ if @is_private.nil?
119
+ invalid_properties.push('invalid value for "is_private", is_private cannot be nil.')
120
+ end
121
+
122
+ if @is_member.nil?
123
+ invalid_properties.push('invalid value for "is_member", is_member cannot be nil.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ return false if @id.nil?
134
+ return false if @name.nil?
135
+ return false if @is_private.nil?
136
+ return false if @is_member.nil?
137
+ true
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] id Value to be assigned
142
+ def id=(id)
143
+ if id.nil?
144
+ fail ArgumentError, 'id cannot be nil'
145
+ end
146
+
147
+ @id = id
148
+ end
149
+
150
+ # Custom attribute writer method with validation
151
+ # @param [Object] name Value to be assigned
152
+ def name=(name)
153
+ if name.nil?
154
+ fail ArgumentError, 'name cannot be nil'
155
+ end
156
+
157
+ @name = name
158
+ end
159
+
160
+ # Custom attribute writer method with validation
161
+ # @param [Object] is_private Value to be assigned
162
+ def is_private=(is_private)
163
+ if is_private.nil?
164
+ fail ArgumentError, 'is_private cannot be nil'
165
+ end
166
+
167
+ @is_private = is_private
168
+ end
169
+
170
+ # Custom attribute writer method with validation
171
+ # @param [Object] is_member Value to be assigned
172
+ def is_member=(is_member)
173
+ if is_member.nil?
174
+ fail ArgumentError, 'is_member cannot be nil'
175
+ end
176
+
177
+ @is_member = is_member
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ id == o.id &&
186
+ name == o.name &&
187
+ is_private == o.is_private &&
188
+ is_member == o.is_member
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [id, name, is_private, is_member].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ return nil unless attributes.is_a?(Hash)
208
+ attributes = attributes.transform_keys(&:to_sym)
209
+ transformed_hash = {}
210
+ openapi_types.each_pair do |key, type|
211
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = nil
213
+ elsif type =~ /\AArray<(.*)>/i
214
+ # check to ensure the input is an array given that the attribute
215
+ # is documented as an array but the input is not
216
+ if attributes[attribute_map[key]].is_a?(Array)
217
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
218
+ end
219
+ elsif !attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
221
+ end
222
+ end
223
+ new(transformed_hash)
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -0,0 +1,169 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
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 Zernio
17
+ class ChannelPickerTeam < ApiModelBase
18
+ # Slack workspace (team) id
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ # Workspace icon URL
24
+ attr_accessor :icon
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'name' => :'name',
31
+ :'icon' => :'icon'
32
+ }
33
+ end
34
+
35
+ # Returns attribute mapping this model knows about
36
+ def self.acceptable_attribute_map
37
+ attribute_map
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ acceptable_attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'id' => :'String',
49
+ :'name' => :'String',
50
+ :'icon' => :'String'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ :'name',
58
+ :'icon'
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::ChannelPickerTeam` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ acceptable_attribute_map = self.class.acceptable_attribute_map
71
+ attributes = attributes.each_with_object({}) { |(k, v), h|
72
+ if (!acceptable_attribute_map.key?(k.to_sym))
73
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::ChannelPickerTeam`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
74
+ end
75
+ h[k.to_sym] = v
76
+ }
77
+
78
+ if attributes.key?(:'id')
79
+ self.id = attributes[:'id']
80
+ end
81
+
82
+ if attributes.key?(:'name')
83
+ self.name = attributes[:'name']
84
+ end
85
+
86
+ if attributes.key?(:'icon')
87
+ self.icon = attributes[:'icon']
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ id == o.id &&
112
+ name == o.name &&
113
+ icon == o.icon
114
+ end
115
+
116
+ # @see the `==` method
117
+ # @param [Object] Object to be compared
118
+ def eql?(o)
119
+ self == o
120
+ end
121
+
122
+ # Calculates hash code according to all attributes.
123
+ # @return [Integer] Hash code
124
+ def hash
125
+ [id, name, icon].hash
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def self.build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ transformed_hash = {}
135
+ openapi_types.each_pair do |key, type|
136
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
+ transformed_hash["#{key}"] = nil
138
+ elsif type =~ /\AArray<(.*)>/i
139
+ # check to ensure the input is an array given that the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
144
+ elsif !attributes[attribute_map[key]].nil?
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
146
+ end
147
+ end
148
+ new(transformed_hash)
149
+ end
150
+
151
+ # Returns the object in the form of hash
152
+ # @return [Hash] Returns the object in the form of hash
153
+ def to_hash
154
+ hash = {}
155
+ self.class.attribute_map.each_pair do |attr, param|
156
+ value = self.send(attr)
157
+ if value.nil?
158
+ is_nullable = self.class.openapi_nullable.include?(attr)
159
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
160
+ end
161
+
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ end
168
+
169
+ end