growwer 1.0.1 → 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 (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -27
  3. data/docs/AccountApi.md +0 -72
  4. data/docs/{OrdersApi.md → BuyerOrdersApi.md} +45 -45
  5. data/docs/{BuyerMoneyApi.md → BuyerWalletApi.md} +21 -21
  6. data/docs/CatalogueApi.md +6 -6
  7. data/docs/CreateSellerMediaRequest.md +38 -0
  8. data/docs/CreateSellerMediaRequestPostOffer.md +24 -0
  9. data/docs/Error.md +2 -2
  10. data/docs/FilesApi.md +1 -1
  11. data/docs/GetMe200ResponseCatalogue.md +6 -2
  12. data/docs/ManagedServicesApi.md +2 -2
  13. data/docs/ProjectCatalogueMediaAllOfProject.md +3 -1
  14. data/docs/ProjectCatalogueMediaAllOfProjectAiKeywords.md +20 -0
  15. data/docs/SellerAccountApi.md +79 -0
  16. data/docs/SellerMedia.md +2 -0
  17. data/docs/SellerMediaPostOffer.md +7 -1
  18. data/docs/SellerMediasApi.md +148 -5
  19. data/docs/{SellerMoneyApi.md → SellerWalletApi.md} +21 -21
  20. data/docs/UpdateSellerMediaRequest.md +2 -0
  21. data/docs/UpdateSellerMediaRequestPostOffer.md +8 -2
  22. data/lib/growwer/api/account_api.rb +0 -79
  23. data/lib/growwer/api/{orders_api.rb → buyer_orders_api.rb} +62 -62
  24. data/lib/growwer/api/{buyer_money_api.rb → buyer_wallet_api.rb} +24 -24
  25. data/lib/growwer/api/catalogue_api.rb +8 -8
  26. data/lib/growwer/api/files_api.rb +2 -2
  27. data/lib/growwer/api/managed_services_api.rb +4 -4
  28. data/lib/growwer/api/seller_account_api.rb +101 -0
  29. data/lib/growwer/api/seller_medias_api.rb +157 -4
  30. data/lib/growwer/api/{seller_money_api.rb → seller_wallet_api.rb} +24 -24
  31. data/lib/growwer/api_client.rb +1 -1
  32. data/lib/growwer/models/create_seller_media_request.rb +447 -0
  33. data/lib/growwer/models/create_seller_media_request_post_offer.rb +273 -0
  34. data/lib/growwer/models/error.rb +1 -1
  35. data/lib/growwer/models/get_me200_response_catalogue.rb +69 -5
  36. data/lib/growwer/models/project_catalogue_media_all_of_project.rb +34 -5
  37. data/lib/growwer/models/project_catalogue_media_all_of_project_ai_keywords.rb +211 -0
  38. data/lib/growwer/models/seller_media.rb +29 -1
  39. data/lib/growwer/models/seller_media_post_offer.rb +99 -1
  40. data/lib/growwer/models/update_seller_media_request.rb +44 -1
  41. data/lib/growwer/models/update_seller_media_request_post_offer.rb +96 -12
  42. data/lib/growwer/version.rb +1 -1
  43. data/lib/growwer.rb +7 -3
  44. data/spec/api/account_api_spec.rb +1 -14
  45. data/spec/api/{orders_api_spec.rb → buyer_orders_api_spec.rb} +13 -13
  46. data/spec/api/{buyer_money_api_spec.rb → buyer_wallet_api_spec.rb} +7 -7
  47. data/spec/api/seller_account_api_spec.rb +48 -0
  48. data/spec/api/{seller_money_api_spec.rb → seller_wallet_api_spec.rb} +7 -7
  49. data/spec/models/create_seller_media_request_post_offer_spec.rb +62 -0
  50. data/spec/models/create_seller_media_request_spec.rb +100 -0
  51. data/spec/models/project_catalogue_media_all_of_project_ai_keywords_spec.rb +46 -0
  52. metadata +30 -14
@@ -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
@@ -18,12 +18,47 @@ module Growwer
18
18
  # One entry per link type you offer.
19
19
  attr_accessor :pricing_options
20
20
 
21
+ # How many links a sponsored post may hold, 1 to 4.
22
+ attr_accessor :maximum_links
23
+
24
+ # Whether sponsored posts are labelled as advertising.
25
+ attr_accessor :advertising_labelling_policy
26
+
27
+ # The social networks sponsored posts are promoted on.
28
+ attr_accessor :promoted_social_networks
29
+
30
+ # Read here, but PATCH /seller/medias/{id} and POST /seller/medias take it at the top level of the body.
21
31
  attr_accessor :extra_services
22
32
 
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
23
55
  # Attribute mapping from ruby-style variable name to JSON key.
24
56
  def self.attribute_map
25
57
  {
26
58
  :'pricing_options' => :'pricingOptions',
59
+ :'maximum_links' => :'maximumLinks',
60
+ :'advertising_labelling_policy' => :'advertisingLabellingPolicy',
61
+ :'promoted_social_networks' => :'promotedSocialNetworks',
27
62
  :'extra_services' => :'extraServices'
28
63
  }
29
64
  end
@@ -42,6 +77,9 @@ module Growwer
42
77
  def self.openapi_types
43
78
  {
44
79
  :'pricing_options' => :'Array<SellerMediaPostOfferPricingOptionsInner>',
80
+ :'maximum_links' => :'Integer',
81
+ :'advertising_labelling_policy' => :'String',
82
+ :'promoted_social_networks' => :'Array<String>',
45
83
  :'extra_services' => :'Array<UpdateSellerMediaRequestExtraServicesInner>'
46
84
  }
47
85
  end
@@ -76,6 +114,26 @@ module Growwer
76
114
  self.pricing_options = nil
77
115
  end
78
116
 
117
+ if attributes.key?(:'maximum_links')
118
+ self.maximum_links = attributes[:'maximum_links']
119
+ else
120
+ self.maximum_links = nil
121
+ end
122
+
123
+ if attributes.key?(:'advertising_labelling_policy')
124
+ self.advertising_labelling_policy = attributes[:'advertising_labelling_policy']
125
+ else
126
+ self.advertising_labelling_policy = nil
127
+ end
128
+
129
+ if attributes.key?(:'promoted_social_networks')
130
+ if (value = attributes[:'promoted_social_networks']).is_a?(Array)
131
+ self.promoted_social_networks = value
132
+ end
133
+ else
134
+ self.promoted_social_networks = nil
135
+ end
136
+
79
137
  if attributes.key?(:'extra_services')
80
138
  if (value = attributes[:'extra_services']).is_a?(Array)
81
139
  self.extra_services = value
@@ -94,6 +152,18 @@ module Growwer
94
152
  invalid_properties.push('invalid value for "pricing_options", pricing_options cannot be nil.')
95
153
  end
96
154
 
155
+ if @maximum_links.nil?
156
+ invalid_properties.push('invalid value for "maximum_links", maximum_links cannot be nil.')
157
+ end
158
+
159
+ if @advertising_labelling_policy.nil?
160
+ invalid_properties.push('invalid value for "advertising_labelling_policy", advertising_labelling_policy cannot be nil.')
161
+ end
162
+
163
+ if @promoted_social_networks.nil?
164
+ invalid_properties.push('invalid value for "promoted_social_networks", promoted_social_networks cannot be nil.')
165
+ end
166
+
97
167
  if @extra_services.nil?
98
168
  invalid_properties.push('invalid value for "extra_services", extra_services cannot be nil.')
99
169
  end
@@ -106,6 +176,11 @@ module Growwer
106
176
  def valid?
107
177
  warn '[DEPRECATED] the `valid?` method is obsolete'
108
178
  return false if @pricing_options.nil?
179
+ return false if @maximum_links.nil?
180
+ return false if @advertising_labelling_policy.nil?
181
+ advertising_labelling_policy_validator = EnumAttributeValidator.new('String', ["always", "never"])
182
+ return false unless advertising_labelling_policy_validator.valid?(@advertising_labelling_policy)
183
+ return false if @promoted_social_networks.nil?
109
184
  return false if @extra_services.nil?
110
185
  true
111
186
  end
@@ -120,6 +195,26 @@ module Growwer
120
195
  @pricing_options = pricing_options
121
196
  end
122
197
 
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] maximum_links Value to be assigned
200
+ def maximum_links=(maximum_links)
201
+ if maximum_links.nil?
202
+ fail ArgumentError, 'maximum_links cannot be nil'
203
+ end
204
+
205
+ @maximum_links = maximum_links
206
+ end
207
+
208
+ # Custom attribute writer method checking allowed values (enum).
209
+ # @param [Object] advertising_labelling_policy Object to be assigned
210
+ def advertising_labelling_policy=(advertising_labelling_policy)
211
+ validator = EnumAttributeValidator.new('String', ["always", "never"])
212
+ unless validator.valid?(advertising_labelling_policy)
213
+ fail ArgumentError, "invalid value for \"advertising_labelling_policy\", must be one of #{validator.allowable_values}."
214
+ end
215
+ @advertising_labelling_policy = advertising_labelling_policy
216
+ end
217
+
123
218
  # Custom attribute writer method with validation
124
219
  # @param [Object] extra_services Value to be assigned
125
220
  def extra_services=(extra_services)
@@ -136,6 +231,9 @@ module Growwer
136
231
  return true if self.equal?(o)
137
232
  self.class == o.class &&
138
233
  pricing_options == o.pricing_options &&
234
+ maximum_links == o.maximum_links &&
235
+ advertising_labelling_policy == o.advertising_labelling_policy &&
236
+ promoted_social_networks == o.promoted_social_networks &&
139
237
  extra_services == o.extra_services
140
238
  end
141
239
 
@@ -148,7 +246,7 @@ module Growwer
148
246
  # Calculates hash code according to all attributes.
149
247
  # @return [Integer] Hash code
150
248
  def hash
151
- [pricing_options, extra_services].hash
249
+ [pricing_options, maximum_links, advertising_labelling_policy, promoted_social_networks, extra_services].hash
152
250
  end
153
251
 
154
252
  # Builds the object from hash
@@ -15,15 +15,40 @@ require 'time'
15
15
 
16
16
  module Growwer
17
17
  class UpdateSellerMediaRequest < ApiModelBase
18
+ attr_accessor :typology
19
+
18
20
  attr_accessor :post_offer
19
21
 
20
22
  attr_accessor :link_addition_offer
21
23
 
22
24
  attr_accessor :extra_services
23
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
+
24
48
  # Attribute mapping from ruby-style variable name to JSON key.
25
49
  def self.attribute_map
26
50
  {
51
+ :'typology' => :'typology',
27
52
  :'post_offer' => :'postOffer',
28
53
  :'link_addition_offer' => :'linkAdditionOffer',
29
54
  :'extra_services' => :'extraServices'
@@ -43,6 +68,7 @@ module Growwer
43
68
  # Attribute type mapping.
44
69
  def self.openapi_types
45
70
  {
71
+ :'typology' => :'String',
46
72
  :'post_offer' => :'UpdateSellerMediaRequestPostOffer',
47
73
  :'link_addition_offer' => :'UpdateSellerMediaRequestLinkAdditionOffer',
48
74
  :'extra_services' => :'Array<UpdateSellerMediaRequestExtraServicesInner>'
@@ -72,6 +98,10 @@ module Growwer
72
98
  h[k.to_sym] = v
73
99
  }
74
100
 
101
+ if attributes.key?(:'typology')
102
+ self.typology = attributes[:'typology']
103
+ end
104
+
75
105
  if attributes.key?(:'post_offer')
76
106
  self.post_offer = attributes[:'post_offer']
77
107
  end
@@ -99,14 +129,27 @@ module Growwer
99
129
  # @return true if the model is valid
100
130
  def valid?
101
131
  warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ typology_validator = EnumAttributeValidator.new('String', ["blog", "press"])
133
+ return false unless typology_validator.valid?(@typology)
102
134
  true
103
135
  end
104
136
 
137
+ # Custom attribute writer method checking allowed values (enum).
138
+ # @param [Object] typology Object to be assigned
139
+ def typology=(typology)
140
+ validator = EnumAttributeValidator.new('String', ["blog", "press"])
141
+ unless validator.valid?(typology)
142
+ fail ArgumentError, "invalid value for \"typology\", must be one of #{validator.allowable_values}."
143
+ end
144
+ @typology = typology
145
+ end
146
+
105
147
  # Checks equality by comparing each attribute.
106
148
  # @param [Object] Object to be compared
107
149
  def ==(o)
108
150
  return true if self.equal?(o)
109
151
  self.class == o.class &&
152
+ typology == o.typology &&
110
153
  post_offer == o.post_offer &&
111
154
  link_addition_offer == o.link_addition_offer &&
112
155
  extra_services == o.extra_services
@@ -121,7 +164,7 @@ module Growwer
121
164
  # Calculates hash code according to all attributes.
122
165
  # @return [Integer] Hash code
123
166
  def hash
124
- [post_offer, link_addition_offer, extra_services].hash
167
+ [typology, post_offer, link_addition_offer, extra_services].hash
125
168
  end
126
169
 
127
170
  # Builds the object from hash