growwer 1.0.2 → 1.1.0

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +10 -5
  3. data/docs/CatalogueApi.md +4 -4
  4. data/docs/CreateSellerMediaRequest.md +38 -0
  5. data/docs/CreateSellerMediaRequestPostOffer.md +24 -0
  6. data/docs/ManagedServicesApi.md +2 -2
  7. data/docs/ProjectCatalogueMediaAllOfProject.md +3 -1
  8. data/docs/ProjectCatalogueMediaAllOfProjectAiKeywords.md +20 -0
  9. data/docs/SellerMedia.md +2 -0
  10. data/docs/SellerMediaPostOffer.md +7 -1
  11. data/docs/SellerMediasApi.md +148 -5
  12. data/docs/UpdateSellerMediaRequest.md +2 -0
  13. data/docs/UpdateSellerMediaRequestPostOffer.md +8 -2
  14. data/lib/growwer/api/catalogue_api.rb +4 -4
  15. data/lib/growwer/api/managed_services_api.rb +4 -4
  16. data/lib/growwer/api/seller_medias_api.rb +157 -4
  17. data/lib/growwer/api_client.rb +1 -1
  18. data/lib/growwer/models/create_seller_media_request.rb +447 -0
  19. data/lib/growwer/models/create_seller_media_request_post_offer.rb +273 -0
  20. data/lib/growwer/models/project_catalogue_media_all_of_project.rb +34 -5
  21. data/lib/growwer/models/project_catalogue_media_all_of_project_ai_keywords.rb +211 -0
  22. data/lib/growwer/models/seller_media.rb +29 -1
  23. data/lib/growwer/models/seller_media_post_offer.rb +99 -1
  24. data/lib/growwer/models/update_seller_media_request.rb +44 -1
  25. data/lib/growwer/models/update_seller_media_request_post_offer.rb +96 -12
  26. data/lib/growwer/version.rb +1 -1
  27. data/lib/growwer.rb +3 -0
  28. data/spec/models/create_seller_media_request_post_offer_spec.rb +62 -0
  29. data/spec/models/create_seller_media_request_spec.rb +100 -0
  30. data/spec/models/project_catalogue_media_all_of_project_ai_keywords_spec.rb +46 -0
  31. metadata +14 -2
@@ -0,0 +1,273 @@
1
+ =begin
2
+ #Growwer API
3
+
4
+ #The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
5
+
6
+ The version of the OpenAPI document: 1
7
+ Contact: support@growwer.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Growwer
17
+ class CreateSellerMediaRequestPostOffer < ApiModelBase
18
+ attr_accessor :pricing_options
19
+
20
+ attr_accessor :maximum_links
21
+
22
+ attr_accessor :advertising_labelling_policy
23
+
24
+ attr_accessor :promoted_social_networks
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'pricing_options' => :'pricingOptions',
52
+ :'maximum_links' => :'maximumLinks',
53
+ :'advertising_labelling_policy' => :'advertisingLabellingPolicy',
54
+ :'promoted_social_networks' => :'promotedSocialNetworks'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'pricing_options' => :'Array<UpdateSellerMediaRequestPostOfferPricingOptionsInner>',
72
+ :'maximum_links' => :'Integer',
73
+ :'advertising_labelling_policy' => :'String',
74
+ :'promoted_social_networks' => :'Array<String>'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Growwer::CreateSellerMediaRequestPostOffer` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Growwer::CreateSellerMediaRequestPostOffer`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'pricing_options')
101
+ if (value = attributes[:'pricing_options']).is_a?(Array)
102
+ self.pricing_options = value
103
+ end
104
+ else
105
+ self.pricing_options = nil
106
+ end
107
+
108
+ if attributes.key?(:'maximum_links')
109
+ self.maximum_links = attributes[:'maximum_links']
110
+ else
111
+ self.maximum_links = nil
112
+ end
113
+
114
+ if attributes.key?(:'advertising_labelling_policy')
115
+ self.advertising_labelling_policy = attributes[:'advertising_labelling_policy']
116
+ end
117
+
118
+ if attributes.key?(:'promoted_social_networks')
119
+ if (value = attributes[:'promoted_social_networks']).is_a?(Array)
120
+ self.promoted_social_networks = value
121
+ end
122
+ end
123
+ end
124
+
125
+ # Show invalid properties with the reasons. Usually used together with valid?
126
+ # @return Array for valid properties with the reasons
127
+ def list_invalid_properties
128
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
129
+ invalid_properties = Array.new
130
+ if @pricing_options.nil?
131
+ invalid_properties.push('invalid value for "pricing_options", pricing_options cannot be nil.')
132
+ end
133
+
134
+ if @pricing_options.length < 1
135
+ invalid_properties.push('invalid value for "pricing_options", number of items must be greater than or equal to 1.')
136
+ end
137
+
138
+ if @maximum_links.nil?
139
+ invalid_properties.push('invalid value for "maximum_links", maximum_links cannot be nil.')
140
+ end
141
+
142
+ if @maximum_links > 4
143
+ invalid_properties.push('invalid value for "maximum_links", must be smaller than or equal to 4.')
144
+ end
145
+
146
+ if @maximum_links < 1
147
+ invalid_properties.push('invalid value for "maximum_links", must be greater than or equal to 1.')
148
+ end
149
+
150
+ invalid_properties
151
+ end
152
+
153
+ # Check to see if the all the properties in the model are valid
154
+ # @return true if the model is valid
155
+ def valid?
156
+ warn '[DEPRECATED] the `valid?` method is obsolete'
157
+ return false if @pricing_options.nil?
158
+ return false if @pricing_options.length < 1
159
+ return false if @maximum_links.nil?
160
+ return false if @maximum_links > 4
161
+ return false if @maximum_links < 1
162
+ advertising_labelling_policy_validator = EnumAttributeValidator.new('String', ["always", "never"])
163
+ return false unless advertising_labelling_policy_validator.valid?(@advertising_labelling_policy)
164
+ true
165
+ end
166
+
167
+ # Custom attribute writer method with validation
168
+ # @param [Object] pricing_options Value to be assigned
169
+ def pricing_options=(pricing_options)
170
+ if pricing_options.nil?
171
+ fail ArgumentError, 'pricing_options cannot be nil'
172
+ end
173
+
174
+ if pricing_options.length < 1
175
+ fail ArgumentError, 'invalid value for "pricing_options", number of items must be greater than or equal to 1.'
176
+ end
177
+
178
+ @pricing_options = pricing_options
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] maximum_links Value to be assigned
183
+ def maximum_links=(maximum_links)
184
+ if maximum_links.nil?
185
+ fail ArgumentError, 'maximum_links cannot be nil'
186
+ end
187
+
188
+ if maximum_links > 4
189
+ fail ArgumentError, 'invalid value for "maximum_links", must be smaller than or equal to 4.'
190
+ end
191
+
192
+ if maximum_links < 1
193
+ fail ArgumentError, 'invalid value for "maximum_links", must be greater than or equal to 1.'
194
+ end
195
+
196
+ @maximum_links = maximum_links
197
+ end
198
+
199
+ # Custom attribute writer method checking allowed values (enum).
200
+ # @param [Object] advertising_labelling_policy Object to be assigned
201
+ def advertising_labelling_policy=(advertising_labelling_policy)
202
+ validator = EnumAttributeValidator.new('String', ["always", "never"])
203
+ unless validator.valid?(advertising_labelling_policy)
204
+ fail ArgumentError, "invalid value for \"advertising_labelling_policy\", must be one of #{validator.allowable_values}."
205
+ end
206
+ @advertising_labelling_policy = advertising_labelling_policy
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ pricing_options == o.pricing_options &&
215
+ maximum_links == o.maximum_links &&
216
+ advertising_labelling_policy == o.advertising_labelling_policy &&
217
+ promoted_social_networks == o.promoted_social_networks
218
+ end
219
+
220
+ # @see the `==` method
221
+ # @param [Object] Object to be compared
222
+ def eql?(o)
223
+ self == o
224
+ end
225
+
226
+ # Calculates hash code according to all attributes.
227
+ # @return [Integer] Hash code
228
+ def hash
229
+ [pricing_options, maximum_links, advertising_labelling_policy, promoted_social_networks].hash
230
+ end
231
+
232
+ # Builds the object from hash
233
+ # @param [Hash] attributes Model attributes in the form of hash
234
+ # @return [Object] Returns the model itself
235
+ def self.build_from_hash(attributes)
236
+ return nil unless attributes.is_a?(Hash)
237
+ attributes = attributes.transform_keys(&:to_sym)
238
+ transformed_hash = {}
239
+ openapi_types.each_pair do |key, type|
240
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
241
+ transformed_hash["#{key}"] = nil
242
+ elsif type =~ /\AArray<(.*)>/i
243
+ # check to ensure the input is an array given that the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[attribute_map[key]].is_a?(Array)
246
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
247
+ end
248
+ elsif !attributes[attribute_map[key]].nil?
249
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
250
+ end
251
+ end
252
+ new(transformed_hash)
253
+ end
254
+
255
+ # Returns the object in the form of hash
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_hash
258
+ hash = {}
259
+ self.class.attribute_map.each_pair do |attr, param|
260
+ value = self.send(attr)
261
+ if value.nil?
262
+ is_nullable = self.class.openapi_nullable.include?(attr)
263
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
264
+ end
265
+
266
+ hash[param] = _to_hash(value)
267
+ end
268
+ hash
269
+ end
270
+
271
+ end
272
+
273
+ end
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Growwer
17
- # The media's state in the project.
17
+ # The media's state in the project, and the AI keywords the web lists for the media in this project.
18
18
  class ProjectCatalogueMediaAllOfProject < ApiModelBase
19
19
  attr_accessor :favourite
20
20
 
@@ -31,6 +31,9 @@ module Growwer
31
31
  # Growwer matched the media with the project recently.
32
32
  attr_accessor :new
33
33
 
34
+ # The AI keywords the web lists for the media in this project, one entry per keyword of each stored source, empty when there are none. Keywords an AI answer gave without referencing any domain may be listed for every media of the project, so an entry does not mean that the engine cited the media. Entries keep their order within an engine, and a keyword listed by two engines appears once for each; the order of the engines is not promised.
35
+ attr_accessor :ai_keywords
36
+
34
37
  # Attribute mapping from ruby-style variable name to JSON key.
35
38
  def self.attribute_map
36
39
  {
@@ -39,7 +42,8 @@ module Growwer
39
42
  :'requested' => :'requested',
40
43
  :'recommended' => :'recommended',
41
44
  :'bought' => :'bought',
42
- :'new' => :'new'
45
+ :'new' => :'new',
46
+ :'ai_keywords' => :'aiKeywords'
43
47
  }
44
48
  end
45
49
 
@@ -61,7 +65,8 @@ module Growwer
61
65
  :'requested' => :'Boolean',
62
66
  :'recommended' => :'Boolean',
63
67
  :'bought' => :'Boolean',
64
- :'new' => :'Boolean'
68
+ :'new' => :'Boolean',
69
+ :'ai_keywords' => :'Array<ProjectCatalogueMediaAllOfProjectAiKeywords>'
65
70
  }
66
71
  end
67
72
 
@@ -122,6 +127,14 @@ module Growwer
122
127
  else
123
128
  self.new = nil
124
129
  end
130
+
131
+ if attributes.key?(:'ai_keywords')
132
+ if (value = attributes[:'ai_keywords']).is_a?(Array)
133
+ self.ai_keywords = value
134
+ end
135
+ else
136
+ self.ai_keywords = nil
137
+ end
125
138
  end
126
139
 
127
140
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -153,6 +166,10 @@ module Growwer
153
166
  invalid_properties.push('invalid value for "new", new cannot be nil.')
154
167
  end
155
168
 
169
+ if @ai_keywords.nil?
170
+ invalid_properties.push('invalid value for "ai_keywords", ai_keywords cannot be nil.')
171
+ end
172
+
156
173
  invalid_properties
157
174
  end
158
175
 
@@ -166,6 +183,7 @@ module Growwer
166
183
  return false if @recommended.nil?
167
184
  return false if @bought.nil?
168
185
  return false if @new.nil?
186
+ return false if @ai_keywords.nil?
169
187
  true
170
188
  end
171
189
 
@@ -229,6 +247,16 @@ module Growwer
229
247
  @new = new
230
248
  end
231
249
 
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] ai_keywords Value to be assigned
252
+ def ai_keywords=(ai_keywords)
253
+ if ai_keywords.nil?
254
+ fail ArgumentError, 'ai_keywords cannot be nil'
255
+ end
256
+
257
+ @ai_keywords = ai_keywords
258
+ end
259
+
232
260
  # Checks equality by comparing each attribute.
233
261
  # @param [Object] Object to be compared
234
262
  def ==(o)
@@ -239,7 +267,8 @@ module Growwer
239
267
  requested == o.requested &&
240
268
  recommended == o.recommended &&
241
269
  bought == o.bought &&
242
- new == o.new
270
+ new == o.new &&
271
+ ai_keywords == o.ai_keywords
243
272
  end
244
273
 
245
274
  # @see the `==` method
@@ -251,7 +280,7 @@ module Growwer
251
280
  # Calculates hash code according to all attributes.
252
281
  # @return [Integer] Hash code
253
282
  def hash
254
- [favourite, discarded, requested, recommended, bought, new].hash
283
+ [favourite, discarded, requested, recommended, bought, new, ai_keywords].hash
255
284
  end
256
285
 
257
286
  # Builds the object from hash
@@ -0,0 +1,211 @@
1
+ =begin
2
+ #Growwer API
3
+
4
+ #The Growwer customer API. Authenticate every call with an API key created on your profile page, sent as `Authorization: Bearer <key>`. A read key can call every GET operation; writes need a read and write key and an `Idempotency-Key` header. Idempotency: use a new `Idempotency-Key` (1 to 255 printable ASCII characters without spaces) for each operation and reuse it only to retry that same operation. Keys belong to your account, not to one API key. - A successful write is stored for 30 days: a retry with the same key and the same request replays its response with `Idempotent-Replayed: true` and does nothing again. - A refused write (4xx) has no effect and releases its key: once you fix the cause, retry with the same key and the write runs. - A failed write (5xx) may have taken effect, so it is never run again under its key: a retry gets 409 `idempotency_outcome_unknown`. Check whether it took effect before retrying with a new key. - A retry while the first request is still running gets 409 `idempotency_request_in_progress`. A request still running after 5 minutes is treated as failed: a retry gets 409 `idempotency_outcome_unknown`. - The same key with a different request (method, path, query or body) gets 409 `idempotency_key_reused`. A write without the header gets 400 `idempotency_key_required`. Every response carries `X-Request-Id`. Errors share one shape, `{code, message, requestId, details?}`. Money is integer cents plus a currency code and dates are ISO-8601.
5
+
6
+ The version of the OpenAPI document: 1
7
+ Contact: support@growwer.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.24.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Growwer
17
+ class ProjectCatalogueMediaAllOfProjectAiKeywords < ApiModelBase
18
+ attr_accessor :keyword
19
+
20
+ # The AI engine that gave the keyword, as the `ranksAiKeyword` filter names it, or null for an engine it does not name. It is never where the media comes from.
21
+ attr_accessor :source
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'keyword' => :'keyword',
49
+ :'source' => :'source'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'keyword' => :'String',
67
+ :'source' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ :'source'
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 `Growwer::ProjectCatalogueMediaAllOfProjectAiKeywords` 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 `Growwer::ProjectCatalogueMediaAllOfProjectAiKeywords`. 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?(:'keyword')
95
+ self.keyword = attributes[:'keyword']
96
+ else
97
+ self.keyword = nil
98
+ end
99
+
100
+ if attributes.key?(:'source')
101
+ self.source = attributes[:'source']
102
+ else
103
+ self.source = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @keyword.nil?
113
+ invalid_properties.push('invalid value for "keyword", keyword cannot be nil.')
114
+ end
115
+
116
+ invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ warn '[DEPRECATED] the `valid?` method is obsolete'
123
+ return false if @keyword.nil?
124
+ source_validator = EnumAttributeValidator.new('String', ["googleAiOverview", "chatgpt", "googleAiMode"])
125
+ return false unless source_validator.valid?(@source)
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] keyword Value to be assigned
131
+ def keyword=(keyword)
132
+ if keyword.nil?
133
+ fail ArgumentError, 'keyword cannot be nil'
134
+ end
135
+
136
+ @keyword = keyword
137
+ end
138
+
139
+ # Custom attribute writer method checking allowed values (enum).
140
+ # @param [Object] source Object to be assigned
141
+ def source=(source)
142
+ validator = EnumAttributeValidator.new('String', ["googleAiOverview", "chatgpt", "googleAiMode"])
143
+ unless validator.valid?(source)
144
+ fail ArgumentError, "invalid value for \"source\", must be one of #{validator.allowable_values}."
145
+ end
146
+ @source = source
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ keyword == o.keyword &&
155
+ source == o.source
156
+ end
157
+
158
+ # @see the `==` method
159
+ # @param [Object] Object to be compared
160
+ def eql?(o)
161
+ self == o
162
+ end
163
+
164
+ # Calculates hash code according to all attributes.
165
+ # @return [Integer] Hash code
166
+ def hash
167
+ [keyword, source].hash
168
+ end
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def self.build_from_hash(attributes)
174
+ return nil unless attributes.is_a?(Hash)
175
+ attributes = attributes.transform_keys(&:to_sym)
176
+ transformed_hash = {}
177
+ openapi_types.each_pair do |key, type|
178
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = nil
180
+ elsif type =~ /\AArray<(.*)>/i
181
+ # check to ensure the input is an array given that the attribute
182
+ # is documented as an array but the input is not
183
+ if attributes[attribute_map[key]].is_a?(Array)
184
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
185
+ end
186
+ elsif !attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
188
+ end
189
+ end
190
+ new(transformed_hash)
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ end
210
+
211
+ end
@@ -23,6 +23,8 @@ module Growwer
23
23
  # The media's root URL.
24
24
  attr_accessor :url
25
25
 
26
+ attr_accessor :typology
27
+
26
28
  attr_accessor :state
27
29
 
28
30
  # How many times the media was deactivated for not publishing.
@@ -92,6 +94,7 @@ module Growwer
92
94
  :'id' => :'id',
93
95
  :'domain' => :'domain',
94
96
  :'url' => :'url',
97
+ :'typology' => :'typology',
95
98
  :'state' => :'state',
96
99
  :'deactivation_strikes' => :'deactivationStrikes',
97
100
  :'country' => :'country',
@@ -127,6 +130,7 @@ module Growwer
127
130
  :'id' => :'String',
128
131
  :'domain' => :'String',
129
132
  :'url' => :'String',
133
+ :'typology' => :'String',
130
134
  :'state' => :'String',
131
135
  :'deactivation_strikes' => :'Integer',
132
136
  :'country' => :'String',
@@ -193,6 +197,12 @@ module Growwer
193
197
  self.url = nil
194
198
  end
195
199
 
200
+ if attributes.key?(:'typology')
201
+ self.typology = attributes[:'typology']
202
+ else
203
+ self.typology = nil
204
+ end
205
+
196
206
  if attributes.key?(:'state')
197
207
  self.state = attributes[:'state']
198
208
  else
@@ -311,6 +321,10 @@ module Growwer
311
321
  invalid_properties.push('invalid value for "url", url cannot be nil.')
312
322
  end
313
323
 
324
+ if @typology.nil?
325
+ invalid_properties.push('invalid value for "typology", typology cannot be nil.')
326
+ end
327
+
314
328
  if @state.nil?
315
329
  invalid_properties.push('invalid value for "state", state cannot be nil.')
316
330
  end
@@ -357,6 +371,9 @@ module Growwer
357
371
  return false if @id.nil?
358
372
  return false if @domain.nil?
359
373
  return false if @url.nil?
374
+ return false if @typology.nil?
375
+ typology_validator = EnumAttributeValidator.new('String', ["blog", "press"])
376
+ return false unless typology_validator.valid?(@typology)
360
377
  return false if @state.nil?
361
378
  state_validator = EnumAttributeValidator.new('String', ["analyzing", "pending_review", "active", "deactivated"])
362
379
  return false unless state_validator.valid?(@state)
@@ -401,6 +418,16 @@ module Growwer
401
418
  @url = url
402
419
  end
403
420
 
421
+ # Custom attribute writer method checking allowed values (enum).
422
+ # @param [Object] typology Object to be assigned
423
+ def typology=(typology)
424
+ validator = EnumAttributeValidator.new('String', ["blog", "press"])
425
+ unless validator.valid?(typology)
426
+ fail ArgumentError, "invalid value for \"typology\", must be one of #{validator.allowable_values}."
427
+ end
428
+ @typology = typology
429
+ end
430
+
404
431
  # Custom attribute writer method checking allowed values (enum).
405
432
  # @param [Object] state Object to be assigned
406
433
  def state=(state)
@@ -499,6 +526,7 @@ module Growwer
499
526
  id == o.id &&
500
527
  domain == o.domain &&
501
528
  url == o.url &&
529
+ typology == o.typology &&
502
530
  state == o.state &&
503
531
  deactivation_strikes == o.deactivation_strikes &&
504
532
  country == o.country &&
@@ -526,7 +554,7 @@ module Growwer
526
554
  # Calculates hash code according to all attributes.
527
555
  # @return [Integer] Hash code
528
556
  def hash
529
- [id, domain, url, state, deactivation_strikes, country, language, topics, banned_topics, provider_comments, publication_rate, average_days_to_publication, num_published_orders, on_holiday, flash_offer, post_offer, link_addition_offer, competitive_fees, created_at].hash
557
+ [id, domain, url, typology, state, deactivation_strikes, country, language, topics, banned_topics, provider_comments, publication_rate, average_days_to_publication, num_published_orders, on_holiday, flash_offer, post_offer, link_addition_offer, competitive_fees, created_at].hash
530
558
  end
531
559
 
532
560
  # Builds the object from hash