growwer 1.0.2 → 1.1.1
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.
- checksums.yaml +4 -4
- data/README.md +10 -5
- data/docs/CatalogueApi.md +6 -6
- data/docs/CreateSellerMediaRequest.md +38 -0
- data/docs/CreateSellerMediaRequestPostOffer.md +24 -0
- data/docs/GetMe200ResponseCatalogue.md +1 -1
- data/docs/LinkAdditionOrderBriefingRequest.md +1 -1
- data/docs/ManagedServicesApi.md +3 -3
- data/docs/ProjectCatalogueMediaAllOfProject.md +3 -1
- data/docs/ProjectCatalogueMediaAllOfProjectAiKeywords.md +20 -0
- data/docs/SavedFiltersApi.md +1 -1
- data/docs/SellerMedia.md +2 -0
- data/docs/SellerMediaPostOffer.md +7 -1
- data/docs/SellerMediasApi.md +148 -5
- data/docs/SellerOrderPostDelivery.md +1 -1
- data/docs/SellerOrdersApi.md +1 -1
- data/docs/UpdateSellerMediaRequest.md +2 -0
- data/docs/UpdateSellerMediaRequestPostOffer.md +8 -2
- data/lib/growwer/api/catalogue_api.rb +8 -8
- data/lib/growwer/api/managed_services_api.rb +6 -6
- data/lib/growwer/api/saved_filters_api.rb +2 -2
- data/lib/growwer/api/seller_medias_api.rb +157 -4
- data/lib/growwer/api/seller_orders_api.rb +2 -2
- data/lib/growwer/api_client.rb +1 -1
- data/lib/growwer/models/create_seller_media_request.rb +447 -0
- data/lib/growwer/models/create_seller_media_request_post_offer.rb +273 -0
- data/lib/growwer/models/get_me200_response_catalogue.rb +1 -1
- data/lib/growwer/models/link_addition_order_briefing_request.rb +1 -1
- data/lib/growwer/models/project_catalogue_media_all_of_project.rb +34 -5
- data/lib/growwer/models/project_catalogue_media_all_of_project_ai_keywords.rb +211 -0
- data/lib/growwer/models/seller_media.rb +29 -1
- data/lib/growwer/models/seller_media_post_offer.rb +99 -1
- data/lib/growwer/models/seller_order_post_delivery.rb +1 -1
- data/lib/growwer/models/update_seller_media_request.rb +44 -1
- data/lib/growwer/models/update_seller_media_request_post_offer.rb +96 -12
- data/lib/growwer/version.rb +1 -1
- data/lib/growwer.rb +3 -0
- data/spec/models/create_seller_media_request_post_offer_spec.rb +62 -0
- data/spec/models/create_seller_media_request_spec.rb +100 -0
- data/spec/models/project_catalogue_media_all_of_project_ai_keywords_spec.rb +46 -0
- metadata +14 -2
|
@@ -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
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
|
16
16
|
module Growwer
|
|
17
17
|
# The published post of a post order. A link addition order takes no body.
|
|
18
18
|
class SellerOrderPostDelivery < ApiModelBase
|
|
19
|
-
# The URL of the published post. It is checked to be a URL
|
|
19
|
+
# The URL of the published post. It is checked to be a URL without `<` or `>`, as the web does; whether the post carries the links is not checked here.
|
|
20
20
|
attr_accessor :url
|
|
21
21
|
|
|
22
22
|
# Must be true. Confirms the post is live, or for an order with a scheduled publication date, that it will be published on that date.
|
|
@@ -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
|
|
@@ -17,10 +17,41 @@ module Growwer
|
|
|
17
17
|
class UpdateSellerMediaRequestPostOffer < ApiModelBase
|
|
18
18
|
attr_accessor :pricing_options
|
|
19
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
|
+
|
|
20
48
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
49
|
def self.attribute_map
|
|
22
50
|
{
|
|
23
|
-
:'pricing_options' => :'pricingOptions'
|
|
51
|
+
:'pricing_options' => :'pricingOptions',
|
|
52
|
+
:'maximum_links' => :'maximumLinks',
|
|
53
|
+
:'advertising_labelling_policy' => :'advertisingLabellingPolicy',
|
|
54
|
+
:'promoted_social_networks' => :'promotedSocialNetworks'
|
|
24
55
|
}
|
|
25
56
|
end
|
|
26
57
|
|
|
@@ -37,7 +68,10 @@ module Growwer
|
|
|
37
68
|
# Attribute type mapping.
|
|
38
69
|
def self.openapi_types
|
|
39
70
|
{
|
|
40
|
-
:'pricing_options' => :'Array<UpdateSellerMediaRequestPostOfferPricingOptionsInner>'
|
|
71
|
+
:'pricing_options' => :'Array<UpdateSellerMediaRequestPostOfferPricingOptionsInner>',
|
|
72
|
+
:'maximum_links' => :'Integer',
|
|
73
|
+
:'advertising_labelling_policy' => :'String',
|
|
74
|
+
:'promoted_social_networks' => :'Array<String>'
|
|
41
75
|
}
|
|
42
76
|
end
|
|
43
77
|
|
|
@@ -67,8 +101,20 @@ module Growwer
|
|
|
67
101
|
if (value = attributes[:'pricing_options']).is_a?(Array)
|
|
68
102
|
self.pricing_options = value
|
|
69
103
|
end
|
|
70
|
-
|
|
71
|
-
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'maximum_links')
|
|
107
|
+
self.maximum_links = attributes[:'maximum_links']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'advertising_labelling_policy')
|
|
111
|
+
self.advertising_labelling_policy = attributes[:'advertising_labelling_policy']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'promoted_social_networks')
|
|
115
|
+
if (value = attributes[:'promoted_social_networks']).is_a?(Array)
|
|
116
|
+
self.promoted_social_networks = value
|
|
117
|
+
end
|
|
72
118
|
end
|
|
73
119
|
end
|
|
74
120
|
|
|
@@ -77,12 +123,16 @@ module Growwer
|
|
|
77
123
|
def list_invalid_properties
|
|
78
124
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
79
125
|
invalid_properties = Array.new
|
|
80
|
-
if
|
|
81
|
-
invalid_properties.push('invalid value for "pricing_options",
|
|
126
|
+
if !@pricing_options.nil? && @pricing_options.length < 1
|
|
127
|
+
invalid_properties.push('invalid value for "pricing_options", number of items must be greater than or equal to 1.')
|
|
82
128
|
end
|
|
83
129
|
|
|
84
|
-
if
|
|
85
|
-
invalid_properties.push('invalid value for "
|
|
130
|
+
if !@maximum_links.nil? && @maximum_links > 4
|
|
131
|
+
invalid_properties.push('invalid value for "maximum_links", must be smaller than or equal to 4.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if !@maximum_links.nil? && @maximum_links < 1
|
|
135
|
+
invalid_properties.push('invalid value for "maximum_links", must be greater than or equal to 1.')
|
|
86
136
|
end
|
|
87
137
|
|
|
88
138
|
invalid_properties
|
|
@@ -92,8 +142,11 @@ module Growwer
|
|
|
92
142
|
# @return true if the model is valid
|
|
93
143
|
def valid?
|
|
94
144
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
95
|
-
return false if
|
|
96
|
-
return false if
|
|
145
|
+
return false if !@pricing_options.nil? && @pricing_options.length < 1
|
|
146
|
+
return false if !@maximum_links.nil? && @maximum_links > 4
|
|
147
|
+
return false if !@maximum_links.nil? && @maximum_links < 1
|
|
148
|
+
advertising_labelling_policy_validator = EnumAttributeValidator.new('String', ["always", "never"])
|
|
149
|
+
return false unless advertising_labelling_policy_validator.valid?(@advertising_labelling_policy)
|
|
97
150
|
true
|
|
98
151
|
end
|
|
99
152
|
|
|
@@ -111,12 +164,43 @@ module Growwer
|
|
|
111
164
|
@pricing_options = pricing_options
|
|
112
165
|
end
|
|
113
166
|
|
|
167
|
+
# Custom attribute writer method with validation
|
|
168
|
+
# @param [Object] maximum_links Value to be assigned
|
|
169
|
+
def maximum_links=(maximum_links)
|
|
170
|
+
if maximum_links.nil?
|
|
171
|
+
fail ArgumentError, 'maximum_links cannot be nil'
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
if maximum_links > 4
|
|
175
|
+
fail ArgumentError, 'invalid value for "maximum_links", must be smaller than or equal to 4.'
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
if maximum_links < 1
|
|
179
|
+
fail ArgumentError, 'invalid value for "maximum_links", must be greater than or equal to 1.'
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
@maximum_links = maximum_links
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
186
|
+
# @param [Object] advertising_labelling_policy Object to be assigned
|
|
187
|
+
def advertising_labelling_policy=(advertising_labelling_policy)
|
|
188
|
+
validator = EnumAttributeValidator.new('String', ["always", "never"])
|
|
189
|
+
unless validator.valid?(advertising_labelling_policy)
|
|
190
|
+
fail ArgumentError, "invalid value for \"advertising_labelling_policy\", must be one of #{validator.allowable_values}."
|
|
191
|
+
end
|
|
192
|
+
@advertising_labelling_policy = advertising_labelling_policy
|
|
193
|
+
end
|
|
194
|
+
|
|
114
195
|
# Checks equality by comparing each attribute.
|
|
115
196
|
# @param [Object] Object to be compared
|
|
116
197
|
def ==(o)
|
|
117
198
|
return true if self.equal?(o)
|
|
118
199
|
self.class == o.class &&
|
|
119
|
-
pricing_options == o.pricing_options
|
|
200
|
+
pricing_options == o.pricing_options &&
|
|
201
|
+
maximum_links == o.maximum_links &&
|
|
202
|
+
advertising_labelling_policy == o.advertising_labelling_policy &&
|
|
203
|
+
promoted_social_networks == o.promoted_social_networks
|
|
120
204
|
end
|
|
121
205
|
|
|
122
206
|
# @see the `==` method
|
|
@@ -128,7 +212,7 @@ module Growwer
|
|
|
128
212
|
# Calculates hash code according to all attributes.
|
|
129
213
|
# @return [Integer] Hash code
|
|
130
214
|
def hash
|
|
131
|
-
[pricing_options].hash
|
|
215
|
+
[pricing_options, maximum_links, advertising_labelling_policy, promoted_social_networks].hash
|
|
132
216
|
end
|
|
133
217
|
|
|
134
218
|
# Builds the object from hash
|
data/lib/growwer/version.rb
CHANGED
data/lib/growwer.rb
CHANGED
|
@@ -31,6 +31,8 @@ require 'growwer/models/code_name'
|
|
|
31
31
|
require 'growwer/models/count_saved_filter_medias200_response'
|
|
32
32
|
require 'growwer/models/create_project_request'
|
|
33
33
|
require 'growwer/models/create_saved_filter_request'
|
|
34
|
+
require 'growwer/models/create_seller_media_request'
|
|
35
|
+
require 'growwer/models/create_seller_media_request_post_offer'
|
|
34
36
|
require 'growwer/models/error'
|
|
35
37
|
require 'growwer/models/get_buyer_wallet200_response'
|
|
36
38
|
require 'growwer/models/get_me200_response'
|
|
@@ -94,6 +96,7 @@ require 'growwer/models/post_order_briefing_request'
|
|
|
94
96
|
require 'growwer/models/project'
|
|
95
97
|
require 'growwer/models/project_catalogue_media'
|
|
96
98
|
require 'growwer/models/project_catalogue_media_all_of_project'
|
|
99
|
+
require 'growwer/models/project_catalogue_media_all_of_project_ai_keywords'
|
|
97
100
|
require 'growwer/models/put_seller_holiday200_response'
|
|
98
101
|
require 'growwer/models/put_seller_holiday_request'
|
|
99
102
|
require 'growwer/models/request_medias201_response'
|
|
@@ -0,0 +1,62 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Growwer::CreateSellerMediaRequestPostOffer
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Growwer::CreateSellerMediaRequestPostOffer do
|
|
21
|
+
#let(:instance) { Growwer::CreateSellerMediaRequestPostOffer.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CreateSellerMediaRequestPostOffer' do
|
|
24
|
+
it 'should create an instance of CreateSellerMediaRequestPostOffer' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Growwer::CreateSellerMediaRequestPostOffer)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "pricing_options"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "maximum_links"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "advertising_labelling_policy"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["always", "never"])
|
|
46
|
+
# validator.allowable_values.each do |value|
|
|
47
|
+
# expect { instance.advertising_labelling_policy = value }.not_to raise_error
|
|
48
|
+
# end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "promoted_social_networks"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["twitter", "instagram", "facebook", "pinterest", "tumblr", "newsletter"])
|
|
56
|
+
# validator.allowable_values.each do |value|
|
|
57
|
+
# expect { instance.promoted_social_networks = value }.not_to raise_error
|
|
58
|
+
# end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|