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.
- checksums.yaml +4 -4
- data/README.md +32 -27
- data/docs/AccountApi.md +0 -72
- data/docs/{OrdersApi.md → BuyerOrdersApi.md} +45 -45
- data/docs/{BuyerMoneyApi.md → BuyerWalletApi.md} +21 -21
- data/docs/CatalogueApi.md +6 -6
- data/docs/CreateSellerMediaRequest.md +38 -0
- data/docs/CreateSellerMediaRequestPostOffer.md +24 -0
- data/docs/Error.md +2 -2
- data/docs/FilesApi.md +1 -1
- data/docs/GetMe200ResponseCatalogue.md +6 -2
- data/docs/ManagedServicesApi.md +2 -2
- data/docs/ProjectCatalogueMediaAllOfProject.md +3 -1
- data/docs/ProjectCatalogueMediaAllOfProjectAiKeywords.md +20 -0
- data/docs/SellerAccountApi.md +79 -0
- data/docs/SellerMedia.md +2 -0
- data/docs/SellerMediaPostOffer.md +7 -1
- data/docs/SellerMediasApi.md +148 -5
- data/docs/{SellerMoneyApi.md → SellerWalletApi.md} +21 -21
- data/docs/UpdateSellerMediaRequest.md +2 -0
- data/docs/UpdateSellerMediaRequestPostOffer.md +8 -2
- data/lib/growwer/api/account_api.rb +0 -79
- data/lib/growwer/api/{orders_api.rb → buyer_orders_api.rb} +62 -62
- data/lib/growwer/api/{buyer_money_api.rb → buyer_wallet_api.rb} +24 -24
- data/lib/growwer/api/catalogue_api.rb +8 -8
- data/lib/growwer/api/files_api.rb +2 -2
- data/lib/growwer/api/managed_services_api.rb +4 -4
- data/lib/growwer/api/seller_account_api.rb +101 -0
- data/lib/growwer/api/seller_medias_api.rb +157 -4
- data/lib/growwer/api/{seller_money_api.rb → seller_wallet_api.rb} +24 -24
- 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/error.rb +1 -1
- data/lib/growwer/models/get_me200_response_catalogue.rb +69 -5
- 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/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 +7 -3
- data/spec/api/account_api_spec.rb +1 -14
- data/spec/api/{orders_api_spec.rb → buyer_orders_api_spec.rb} +13 -13
- data/spec/api/{buyer_money_api_spec.rb → buyer_wallet_api_spec.rb} +7 -7
- data/spec/api/seller_account_api_spec.rb +48 -0
- data/spec/api/{seller_money_api_spec.rb → seller_wallet_api_spec.rb} +7 -7
- 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 +30 -14
|
@@ -13,7 +13,7 @@ Generator version: 7.24.0
|
|
|
13
13
|
require 'cgi'
|
|
14
14
|
|
|
15
15
|
module Growwer
|
|
16
|
-
class
|
|
16
|
+
class SellerWalletApi
|
|
17
17
|
attr_accessor :api_client
|
|
18
18
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
@@ -36,11 +36,11 @@ module Growwer
|
|
|
36
36
|
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
|
37
37
|
def download_seller_transaction_document_with_http_info(id, opts = {})
|
|
38
38
|
if @api_client.config.debugging
|
|
39
|
-
@api_client.config.logger.debug 'Calling API:
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: SellerWalletApi.download_seller_transaction_document ...'
|
|
40
40
|
end
|
|
41
41
|
# verify the required parameter 'id' is set
|
|
42
42
|
if @api_client.config.client_side_validation && id.nil?
|
|
43
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SellerWalletApi.download_seller_transaction_document"
|
|
44
44
|
end
|
|
45
45
|
# resource path
|
|
46
46
|
local_var_path = '/api/v1/wallets/seller/transactions/{id}/document'.sub('{id}', CGI.escape(id.to_s))
|
|
@@ -66,7 +66,7 @@ module Growwer
|
|
|
66
66
|
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
67
67
|
|
|
68
68
|
new_options = opts.merge(
|
|
69
|
-
:operation => :"
|
|
69
|
+
:operation => :"SellerWalletApi.download_seller_transaction_document",
|
|
70
70
|
:header_params => header_params,
|
|
71
71
|
:query_params => query_params,
|
|
72
72
|
:form_params => form_params,
|
|
@@ -77,7 +77,7 @@ module Growwer
|
|
|
77
77
|
|
|
78
78
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
79
|
if @api_client.config.debugging
|
|
80
|
-
@api_client.config.logger.debug "API called:
|
|
80
|
+
@api_client.config.logger.debug "API called: SellerWalletApi#download_seller_transaction_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
81
|
end
|
|
82
82
|
return data, status_code, headers
|
|
83
83
|
end
|
|
@@ -99,11 +99,11 @@ module Growwer
|
|
|
99
99
|
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
|
100
100
|
def download_withdrawal_invoice_with_http_info(id, opts = {})
|
|
101
101
|
if @api_client.config.debugging
|
|
102
|
-
@api_client.config.logger.debug 'Calling API:
|
|
102
|
+
@api_client.config.logger.debug 'Calling API: SellerWalletApi.download_withdrawal_invoice ...'
|
|
103
103
|
end
|
|
104
104
|
# verify the required parameter 'id' is set
|
|
105
105
|
if @api_client.config.client_side_validation && id.nil?
|
|
106
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling
|
|
106
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SellerWalletApi.download_withdrawal_invoice"
|
|
107
107
|
end
|
|
108
108
|
# resource path
|
|
109
109
|
local_var_path = '/api/v1/withdrawals/{id}/invoice'.sub('{id}', CGI.escape(id.to_s))
|
|
@@ -129,7 +129,7 @@ module Growwer
|
|
|
129
129
|
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
130
130
|
|
|
131
131
|
new_options = opts.merge(
|
|
132
|
-
:operation => :"
|
|
132
|
+
:operation => :"SellerWalletApi.download_withdrawal_invoice",
|
|
133
133
|
:header_params => header_params,
|
|
134
134
|
:query_params => query_params,
|
|
135
135
|
:form_params => form_params,
|
|
@@ -140,7 +140,7 @@ module Growwer
|
|
|
140
140
|
|
|
141
141
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
142
142
|
if @api_client.config.debugging
|
|
143
|
-
@api_client.config.logger.debug "API called:
|
|
143
|
+
@api_client.config.logger.debug "API called: SellerWalletApi#download_withdrawal_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
144
144
|
end
|
|
145
145
|
return data, status_code, headers
|
|
146
146
|
end
|
|
@@ -160,7 +160,7 @@ module Growwer
|
|
|
160
160
|
# @return [Array<(GetSellerWallet200Response, Integer, Hash)>] GetSellerWallet200Response data, response status code and response headers
|
|
161
161
|
def get_seller_wallet_with_http_info(opts = {})
|
|
162
162
|
if @api_client.config.debugging
|
|
163
|
-
@api_client.config.logger.debug 'Calling API:
|
|
163
|
+
@api_client.config.logger.debug 'Calling API: SellerWalletApi.get_seller_wallet ...'
|
|
164
164
|
end
|
|
165
165
|
# resource path
|
|
166
166
|
local_var_path = '/api/v1/wallets/seller'
|
|
@@ -186,7 +186,7 @@ module Growwer
|
|
|
186
186
|
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
187
187
|
|
|
188
188
|
new_options = opts.merge(
|
|
189
|
-
:operation => :"
|
|
189
|
+
:operation => :"SellerWalletApi.get_seller_wallet",
|
|
190
190
|
:header_params => header_params,
|
|
191
191
|
:query_params => query_params,
|
|
192
192
|
:form_params => form_params,
|
|
@@ -197,7 +197,7 @@ module Growwer
|
|
|
197
197
|
|
|
198
198
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
199
199
|
if @api_client.config.debugging
|
|
200
|
-
@api_client.config.logger.debug "API called:
|
|
200
|
+
@api_client.config.logger.debug "API called: SellerWalletApi#get_seller_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
201
201
|
end
|
|
202
202
|
return data, status_code, headers
|
|
203
203
|
end
|
|
@@ -221,18 +221,18 @@ module Growwer
|
|
|
221
221
|
# @return [Array<(ListSellerTransactions200Response, Integer, Hash)>] ListSellerTransactions200Response data, response status code and response headers
|
|
222
222
|
def list_seller_transactions_with_http_info(opts = {})
|
|
223
223
|
if @api_client.config.debugging
|
|
224
|
-
@api_client.config.logger.debug 'Calling API:
|
|
224
|
+
@api_client.config.logger.debug 'Calling API: SellerWalletApi.list_seller_transactions ...'
|
|
225
225
|
end
|
|
226
226
|
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
227
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling
|
|
227
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SellerWalletApi.list_seller_transactions, must be smaller than or equal to 100.'
|
|
228
228
|
end
|
|
229
229
|
|
|
230
230
|
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
231
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling
|
|
231
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SellerWalletApi.list_seller_transactions, must be greater than or equal to 1.'
|
|
232
232
|
end
|
|
233
233
|
|
|
234
234
|
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
235
|
-
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling
|
|
235
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SellerWalletApi.list_seller_transactions, must be greater than or equal to 0.'
|
|
236
236
|
end
|
|
237
237
|
|
|
238
238
|
# resource path
|
|
@@ -261,7 +261,7 @@ module Growwer
|
|
|
261
261
|
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
262
262
|
|
|
263
263
|
new_options = opts.merge(
|
|
264
|
-
:operation => :"
|
|
264
|
+
:operation => :"SellerWalletApi.list_seller_transactions",
|
|
265
265
|
:header_params => header_params,
|
|
266
266
|
:query_params => query_params,
|
|
267
267
|
:form_params => form_params,
|
|
@@ -272,7 +272,7 @@ module Growwer
|
|
|
272
272
|
|
|
273
273
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
274
274
|
if @api_client.config.debugging
|
|
275
|
-
@api_client.config.logger.debug "API called:
|
|
275
|
+
@api_client.config.logger.debug "API called: SellerWalletApi#list_seller_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
276
276
|
end
|
|
277
277
|
return data, status_code, headers
|
|
278
278
|
end
|
|
@@ -298,18 +298,18 @@ module Growwer
|
|
|
298
298
|
# @return [Array<(ListWithdrawals200Response, Integer, Hash)>] ListWithdrawals200Response data, response status code and response headers
|
|
299
299
|
def list_withdrawals_with_http_info(opts = {})
|
|
300
300
|
if @api_client.config.debugging
|
|
301
|
-
@api_client.config.logger.debug 'Calling API:
|
|
301
|
+
@api_client.config.logger.debug 'Calling API: SellerWalletApi.list_withdrawals ...'
|
|
302
302
|
end
|
|
303
303
|
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
|
|
304
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling
|
|
304
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SellerWalletApi.list_withdrawals, must be smaller than or equal to 100.'
|
|
305
305
|
end
|
|
306
306
|
|
|
307
307
|
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
|
|
308
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling
|
|
308
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SellerWalletApi.list_withdrawals, must be greater than or equal to 1.'
|
|
309
309
|
end
|
|
310
310
|
|
|
311
311
|
if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
|
|
312
|
-
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling
|
|
312
|
+
fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling SellerWalletApi.list_withdrawals, must be greater than or equal to 0.'
|
|
313
313
|
end
|
|
314
314
|
|
|
315
315
|
# resource path
|
|
@@ -339,7 +339,7 @@ module Growwer
|
|
|
339
339
|
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
340
340
|
|
|
341
341
|
new_options = opts.merge(
|
|
342
|
-
:operation => :"
|
|
342
|
+
:operation => :"SellerWalletApi.list_withdrawals",
|
|
343
343
|
:header_params => header_params,
|
|
344
344
|
:query_params => query_params,
|
|
345
345
|
:form_params => form_params,
|
|
@@ -350,7 +350,7 @@ module Growwer
|
|
|
350
350
|
|
|
351
351
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
352
352
|
if @api_client.config.debugging
|
|
353
|
-
@api_client.config.logger.debug "API called:
|
|
353
|
+
@api_client.config.logger.debug "API called: SellerWalletApi#list_withdrawals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
354
354
|
end
|
|
355
355
|
return data, status_code, headers
|
|
356
356
|
end
|
data/lib/growwer/api_client.rb
CHANGED
|
@@ -34,7 +34,7 @@ module Growwer
|
|
|
34
34
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
|
35
35
|
def initialize(config = Configuration.default)
|
|
36
36
|
@config = config
|
|
37
|
-
@user_agent = "growwer-ruby/1.0
|
|
37
|
+
@user_agent = "growwer-ruby/1.1.0"
|
|
38
38
|
@default_headers = {
|
|
39
39
|
'Content-Type' => 'application/json',
|
|
40
40
|
'User-Agent' => @user_agent
|
|
@@ -0,0 +1,447 @@
|
|
|
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 CreateSellerMediaRequest < ApiModelBase
|
|
18
|
+
attr_accessor :root_url
|
|
19
|
+
|
|
20
|
+
attr_accessor :typology
|
|
21
|
+
|
|
22
|
+
# A country code from GET /vocabulary.
|
|
23
|
+
attr_accessor :country
|
|
24
|
+
|
|
25
|
+
# A language code from GET /vocabulary.
|
|
26
|
+
attr_accessor :language
|
|
27
|
+
|
|
28
|
+
# Topic ids from GET /vocabulary.
|
|
29
|
+
attr_accessor :topics
|
|
30
|
+
|
|
31
|
+
# The topic ids from GET /vocabulary the media refuses.
|
|
32
|
+
attr_accessor :banned_topics
|
|
33
|
+
|
|
34
|
+
attr_accessor :post_offer
|
|
35
|
+
|
|
36
|
+
attr_accessor :link_addition_offer
|
|
37
|
+
|
|
38
|
+
attr_accessor :extra_services
|
|
39
|
+
|
|
40
|
+
# Must be true: you accept the media publishing terms.
|
|
41
|
+
attr_accessor :accept_media_publishing_terms
|
|
42
|
+
|
|
43
|
+
# Must be true: you own or manage this media.
|
|
44
|
+
attr_accessor :declare_media_ownership
|
|
45
|
+
|
|
46
|
+
class EnumAttributeValidator
|
|
47
|
+
attr_reader :datatype
|
|
48
|
+
attr_reader :allowable_values
|
|
49
|
+
|
|
50
|
+
def initialize(datatype, allowable_values)
|
|
51
|
+
@allowable_values = allowable_values.map do |value|
|
|
52
|
+
case datatype.to_s
|
|
53
|
+
when /Integer/i
|
|
54
|
+
value.to_i
|
|
55
|
+
when /Float/i
|
|
56
|
+
value.to_f
|
|
57
|
+
else
|
|
58
|
+
value
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def valid?(value)
|
|
64
|
+
!value || allowable_values.include?(value)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
69
|
+
def self.attribute_map
|
|
70
|
+
{
|
|
71
|
+
:'root_url' => :'rootUrl',
|
|
72
|
+
:'typology' => :'typology',
|
|
73
|
+
:'country' => :'country',
|
|
74
|
+
:'language' => :'language',
|
|
75
|
+
:'topics' => :'topics',
|
|
76
|
+
:'banned_topics' => :'bannedTopics',
|
|
77
|
+
:'post_offer' => :'postOffer',
|
|
78
|
+
:'link_addition_offer' => :'linkAdditionOffer',
|
|
79
|
+
:'extra_services' => :'extraServices',
|
|
80
|
+
:'accept_media_publishing_terms' => :'acceptMediaPublishingTerms',
|
|
81
|
+
:'declare_media_ownership' => :'declareMediaOwnership'
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Returns attribute mapping this model knows about
|
|
86
|
+
def self.acceptable_attribute_map
|
|
87
|
+
attribute_map
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Returns all the JSON keys this model knows about
|
|
91
|
+
def self.acceptable_attributes
|
|
92
|
+
acceptable_attribute_map.values
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Attribute type mapping.
|
|
96
|
+
def self.openapi_types
|
|
97
|
+
{
|
|
98
|
+
:'root_url' => :'String',
|
|
99
|
+
:'typology' => :'String',
|
|
100
|
+
:'country' => :'String',
|
|
101
|
+
:'language' => :'String',
|
|
102
|
+
:'topics' => :'Array<Integer>',
|
|
103
|
+
:'banned_topics' => :'Array<Integer>',
|
|
104
|
+
:'post_offer' => :'CreateSellerMediaRequestPostOffer',
|
|
105
|
+
:'link_addition_offer' => :'UpdateSellerMediaRequestLinkAdditionOffer',
|
|
106
|
+
:'extra_services' => :'Array<UpdateSellerMediaRequestExtraServicesInner>',
|
|
107
|
+
:'accept_media_publishing_terms' => :'Boolean',
|
|
108
|
+
:'declare_media_ownership' => :'Boolean'
|
|
109
|
+
}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# List of attributes with nullable: true
|
|
113
|
+
def self.openapi_nullable
|
|
114
|
+
Set.new([
|
|
115
|
+
:'link_addition_offer',
|
|
116
|
+
])
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Initializes the object
|
|
120
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
121
|
+
def initialize(attributes = {})
|
|
122
|
+
if (!attributes.is_a?(Hash))
|
|
123
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Growwer::CreateSellerMediaRequest` initialize method"
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
127
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
128
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
129
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
130
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Growwer::CreateSellerMediaRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
131
|
+
end
|
|
132
|
+
h[k.to_sym] = v
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'root_url')
|
|
136
|
+
self.root_url = attributes[:'root_url']
|
|
137
|
+
else
|
|
138
|
+
self.root_url = nil
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'typology')
|
|
142
|
+
self.typology = attributes[:'typology']
|
|
143
|
+
else
|
|
144
|
+
self.typology = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'country')
|
|
148
|
+
self.country = attributes[:'country']
|
|
149
|
+
else
|
|
150
|
+
self.country = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'language')
|
|
154
|
+
self.language = attributes[:'language']
|
|
155
|
+
else
|
|
156
|
+
self.language = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'topics')
|
|
160
|
+
if (value = attributes[:'topics']).is_a?(Array)
|
|
161
|
+
self.topics = value
|
|
162
|
+
end
|
|
163
|
+
else
|
|
164
|
+
self.topics = nil
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if attributes.key?(:'banned_topics')
|
|
168
|
+
if (value = attributes[:'banned_topics']).is_a?(Array)
|
|
169
|
+
self.banned_topics = value
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
if attributes.key?(:'post_offer')
|
|
174
|
+
self.post_offer = attributes[:'post_offer']
|
|
175
|
+
else
|
|
176
|
+
self.post_offer = nil
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
if attributes.key?(:'link_addition_offer')
|
|
180
|
+
self.link_addition_offer = attributes[:'link_addition_offer']
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'extra_services')
|
|
184
|
+
if (value = attributes[:'extra_services']).is_a?(Array)
|
|
185
|
+
self.extra_services = value
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'accept_media_publishing_terms')
|
|
190
|
+
self.accept_media_publishing_terms = attributes[:'accept_media_publishing_terms']
|
|
191
|
+
else
|
|
192
|
+
self.accept_media_publishing_terms = nil
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'declare_media_ownership')
|
|
196
|
+
self.declare_media_ownership = attributes[:'declare_media_ownership']
|
|
197
|
+
else
|
|
198
|
+
self.declare_media_ownership = nil
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
203
|
+
# @return Array for valid properties with the reasons
|
|
204
|
+
def list_invalid_properties
|
|
205
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
206
|
+
invalid_properties = Array.new
|
|
207
|
+
if @root_url.nil?
|
|
208
|
+
invalid_properties.push('invalid value for "root_url", root_url cannot be nil.')
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
if @typology.nil?
|
|
212
|
+
invalid_properties.push('invalid value for "typology", typology cannot be nil.')
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
if @country.nil?
|
|
216
|
+
invalid_properties.push('invalid value for "country", country cannot be nil.')
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
if @language.nil?
|
|
220
|
+
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
if @topics.nil?
|
|
224
|
+
invalid_properties.push('invalid value for "topics", topics cannot be nil.')
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
if @topics.length > 100
|
|
228
|
+
invalid_properties.push('invalid value for "topics", number of items must be less than or equal to 100.')
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
if @topics.length < 1
|
|
232
|
+
invalid_properties.push('invalid value for "topics", number of items must be greater than or equal to 1.')
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
if !@banned_topics.nil? && @banned_topics.length > 100
|
|
236
|
+
invalid_properties.push('invalid value for "banned_topics", number of items must be less than or equal to 100.')
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
if @post_offer.nil?
|
|
240
|
+
invalid_properties.push('invalid value for "post_offer", post_offer cannot be nil.')
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
if @accept_media_publishing_terms.nil?
|
|
244
|
+
invalid_properties.push('invalid value for "accept_media_publishing_terms", accept_media_publishing_terms cannot be nil.')
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
if @declare_media_ownership.nil?
|
|
248
|
+
invalid_properties.push('invalid value for "declare_media_ownership", declare_media_ownership cannot be nil.')
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
invalid_properties
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
# Check to see if the all the properties in the model are valid
|
|
255
|
+
# @return true if the model is valid
|
|
256
|
+
def valid?
|
|
257
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
258
|
+
return false if @root_url.nil?
|
|
259
|
+
return false if @typology.nil?
|
|
260
|
+
typology_validator = EnumAttributeValidator.new('String', ["blog", "press"])
|
|
261
|
+
return false unless typology_validator.valid?(@typology)
|
|
262
|
+
return false if @country.nil?
|
|
263
|
+
return false if @language.nil?
|
|
264
|
+
return false if @topics.nil?
|
|
265
|
+
return false if @topics.length > 100
|
|
266
|
+
return false if @topics.length < 1
|
|
267
|
+
return false if !@banned_topics.nil? && @banned_topics.length > 100
|
|
268
|
+
return false if @post_offer.nil?
|
|
269
|
+
return false if @accept_media_publishing_terms.nil?
|
|
270
|
+
return false if @declare_media_ownership.nil?
|
|
271
|
+
true
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Custom attribute writer method with validation
|
|
275
|
+
# @param [Object] root_url Value to be assigned
|
|
276
|
+
def root_url=(root_url)
|
|
277
|
+
if root_url.nil?
|
|
278
|
+
fail ArgumentError, 'root_url cannot be nil'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
@root_url = root_url
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
285
|
+
# @param [Object] typology Object to be assigned
|
|
286
|
+
def typology=(typology)
|
|
287
|
+
validator = EnumAttributeValidator.new('String', ["blog", "press"])
|
|
288
|
+
unless validator.valid?(typology)
|
|
289
|
+
fail ArgumentError, "invalid value for \"typology\", must be one of #{validator.allowable_values}."
|
|
290
|
+
end
|
|
291
|
+
@typology = typology
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
# Custom attribute writer method with validation
|
|
295
|
+
# @param [Object] country Value to be assigned
|
|
296
|
+
def country=(country)
|
|
297
|
+
if country.nil?
|
|
298
|
+
fail ArgumentError, 'country cannot be nil'
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
@country = country
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
# Custom attribute writer method with validation
|
|
305
|
+
# @param [Object] language Value to be assigned
|
|
306
|
+
def language=(language)
|
|
307
|
+
if language.nil?
|
|
308
|
+
fail ArgumentError, 'language cannot be nil'
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
@language = language
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
# Custom attribute writer method with validation
|
|
315
|
+
# @param [Object] topics Value to be assigned
|
|
316
|
+
def topics=(topics)
|
|
317
|
+
if topics.nil?
|
|
318
|
+
fail ArgumentError, 'topics cannot be nil'
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
if topics.length > 100
|
|
322
|
+
fail ArgumentError, 'invalid value for "topics", number of items must be less than or equal to 100.'
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
if topics.length < 1
|
|
326
|
+
fail ArgumentError, 'invalid value for "topics", number of items must be greater than or equal to 1.'
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
@topics = topics
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
# Custom attribute writer method with validation
|
|
333
|
+
# @param [Object] banned_topics Value to be assigned
|
|
334
|
+
def banned_topics=(banned_topics)
|
|
335
|
+
if banned_topics.nil?
|
|
336
|
+
fail ArgumentError, 'banned_topics cannot be nil'
|
|
337
|
+
end
|
|
338
|
+
|
|
339
|
+
if banned_topics.length > 100
|
|
340
|
+
fail ArgumentError, 'invalid value for "banned_topics", number of items must be less than or equal to 100.'
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
@banned_topics = banned_topics
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# Custom attribute writer method with validation
|
|
347
|
+
# @param [Object] post_offer Value to be assigned
|
|
348
|
+
def post_offer=(post_offer)
|
|
349
|
+
if post_offer.nil?
|
|
350
|
+
fail ArgumentError, 'post_offer cannot be nil'
|
|
351
|
+
end
|
|
352
|
+
|
|
353
|
+
@post_offer = post_offer
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# Custom attribute writer method with validation
|
|
357
|
+
# @param [Object] accept_media_publishing_terms Value to be assigned
|
|
358
|
+
def accept_media_publishing_terms=(accept_media_publishing_terms)
|
|
359
|
+
if accept_media_publishing_terms.nil?
|
|
360
|
+
fail ArgumentError, 'accept_media_publishing_terms cannot be nil'
|
|
361
|
+
end
|
|
362
|
+
|
|
363
|
+
@accept_media_publishing_terms = accept_media_publishing_terms
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Custom attribute writer method with validation
|
|
367
|
+
# @param [Object] declare_media_ownership Value to be assigned
|
|
368
|
+
def declare_media_ownership=(declare_media_ownership)
|
|
369
|
+
if declare_media_ownership.nil?
|
|
370
|
+
fail ArgumentError, 'declare_media_ownership cannot be nil'
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
@declare_media_ownership = declare_media_ownership
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# Checks equality by comparing each attribute.
|
|
377
|
+
# @param [Object] Object to be compared
|
|
378
|
+
def ==(o)
|
|
379
|
+
return true if self.equal?(o)
|
|
380
|
+
self.class == o.class &&
|
|
381
|
+
root_url == o.root_url &&
|
|
382
|
+
typology == o.typology &&
|
|
383
|
+
country == o.country &&
|
|
384
|
+
language == o.language &&
|
|
385
|
+
topics == o.topics &&
|
|
386
|
+
banned_topics == o.banned_topics &&
|
|
387
|
+
post_offer == o.post_offer &&
|
|
388
|
+
link_addition_offer == o.link_addition_offer &&
|
|
389
|
+
extra_services == o.extra_services &&
|
|
390
|
+
accept_media_publishing_terms == o.accept_media_publishing_terms &&
|
|
391
|
+
declare_media_ownership == o.declare_media_ownership
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# @see the `==` method
|
|
395
|
+
# @param [Object] Object to be compared
|
|
396
|
+
def eql?(o)
|
|
397
|
+
self == o
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
# Calculates hash code according to all attributes.
|
|
401
|
+
# @return [Integer] Hash code
|
|
402
|
+
def hash
|
|
403
|
+
[root_url, typology, country, language, topics, banned_topics, post_offer, link_addition_offer, extra_services, accept_media_publishing_terms, declare_media_ownership].hash
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# Builds the object from hash
|
|
407
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
408
|
+
# @return [Object] Returns the model itself
|
|
409
|
+
def self.build_from_hash(attributes)
|
|
410
|
+
return nil unless attributes.is_a?(Hash)
|
|
411
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
412
|
+
transformed_hash = {}
|
|
413
|
+
openapi_types.each_pair do |key, type|
|
|
414
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
415
|
+
transformed_hash["#{key}"] = nil
|
|
416
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
417
|
+
# check to ensure the input is an array given that the attribute
|
|
418
|
+
# is documented as an array but the input is not
|
|
419
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
420
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
421
|
+
end
|
|
422
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
423
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
424
|
+
end
|
|
425
|
+
end
|
|
426
|
+
new(transformed_hash)
|
|
427
|
+
end
|
|
428
|
+
|
|
429
|
+
# Returns the object in the form of hash
|
|
430
|
+
# @return [Hash] Returns the object in the form of hash
|
|
431
|
+
def to_hash
|
|
432
|
+
hash = {}
|
|
433
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
434
|
+
value = self.send(attr)
|
|
435
|
+
if value.nil?
|
|
436
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
437
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
hash[param] = _to_hash(value)
|
|
441
|
+
end
|
|
442
|
+
hash
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
end
|
|
446
|
+
|
|
447
|
+
end
|