growwer 1.0.1 → 1.0.2
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 +26 -26
- 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 +2 -2
- data/docs/Error.md +2 -2
- data/docs/FilesApi.md +1 -1
- data/docs/GetMe200ResponseCatalogue.md +6 -2
- data/docs/SellerAccountApi.md +79 -0
- data/docs/{SellerMoneyApi.md → SellerWalletApi.md} +21 -21
- 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 +4 -4
- data/lib/growwer/api/files_api.rb +2 -2
- data/lib/growwer/api/seller_account_api.rb +101 -0
- 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/error.rb +1 -1
- data/lib/growwer/models/get_me200_response_catalogue.rb +69 -5
- data/lib/growwer/version.rb +1 -1
- data/lib/growwer.rb +4 -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
- metadata +17 -13
|
@@ -180,7 +180,7 @@ module Growwer
|
|
|
180
180
|
end
|
|
181
181
|
|
|
182
182
|
# Get a media
|
|
183
|
-
# One media of the catalogue: an active, public media. A media you have ordered is always readable, even if it has since left the catalogue, and is open to every account. Otherwise the
|
|
183
|
+
# One media of the catalogue: an active, public media. A media you have ordered is always readable, even if it has since left the catalogue, and is open to every account. Otherwise the media counts towards the distinct medias the account may see per day (UTC): the full daily cap for accounts with recent completed orders, a smaller trial quota for other accounts (see `catalogue.eligible`, `catalogue.dailyCap` and `catalogue.remainingToday` on GET /me). For the media's state in one of your projects, search the project with GET /projects/{id}/medias.
|
|
184
184
|
# @param id [String] The media.
|
|
185
185
|
# @param [Hash] opts the optional parameters
|
|
186
186
|
# @return [CatalogueMedia]
|
|
@@ -190,7 +190,7 @@ module Growwer
|
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
# Get a media
|
|
193
|
-
# One media of the catalogue: an active, public media. A media you have ordered is always readable, even if it has since left the catalogue, and is open to every account. Otherwise the
|
|
193
|
+
# One media of the catalogue: an active, public media. A media you have ordered is always readable, even if it has since left the catalogue, and is open to every account. Otherwise the media counts towards the distinct medias the account may see per day (UTC): the full daily cap for accounts with recent completed orders, a smaller trial quota for other accounts (see `catalogue.eligible`, `catalogue.dailyCap` and `catalogue.remainingToday` on GET /me). For the media's state in one of your projects, search the project with GET /projects/{id}/medias.
|
|
194
194
|
# @param id [String] The media.
|
|
195
195
|
# @param [Hash] opts the optional parameters
|
|
196
196
|
# @return [Array<(CatalogueMedia, Integer, Hash)>] CatalogueMedia data, response status code and response headers
|
|
@@ -521,7 +521,7 @@ module Growwer
|
|
|
521
521
|
end
|
|
522
522
|
|
|
523
523
|
# Search the catalogue for a project
|
|
524
|
-
# The medias the catalogue offers for one of your projects, as the web lists them, with each media's state in the project. Filter with the parameters below, which all combine, or apply one of your saved filters with `savedFilterId` alone.
|
|
524
|
+
# The medias the catalogue offers for one of your projects, as the web lists them, with each media's state in the project. Filter with the parameters below, which all combine, or apply one of your saved filters with `savedFilterId` alone. Each account can see a limited number of distinct medias per day (UTC) across the catalogue operations: the full daily cap for accounts with recent completed orders, as buyer or as seller, and a smaller trial quota for other accounts, which rises to the full cap after a completed order (see `catalogue.eligible`, `catalogue.dailyCap` and `catalogue.remainingToday` on GET /me). Medias seen again the same day are free.
|
|
525
525
|
# @param id [String] The project.
|
|
526
526
|
# @param [Hash] opts the optional parameters
|
|
527
527
|
# @option opts [String] :source Which of the project's medias to search: `all` (the default), `recommended` (those Growwer recommends for the project), or those you marked `favourite`, `discarded` or `requested`, or `bought` for the project. Do not combine it with the parameter of the same state.
|
|
@@ -568,7 +568,7 @@ module Growwer
|
|
|
568
568
|
end
|
|
569
569
|
|
|
570
570
|
# Search the catalogue for a project
|
|
571
|
-
# The medias the catalogue offers for one of your projects, as the web lists them, with each media's state in the project. Filter with the parameters below, which all combine, or apply one of your saved filters with `savedFilterId` alone.
|
|
571
|
+
# The medias the catalogue offers for one of your projects, as the web lists them, with each media's state in the project. Filter with the parameters below, which all combine, or apply one of your saved filters with `savedFilterId` alone. Each account can see a limited number of distinct medias per day (UTC) across the catalogue operations: the full daily cap for accounts with recent completed orders, as buyer or as seller, and a smaller trial quota for other accounts, which rises to the full cap after a completed order (see `catalogue.eligible`, `catalogue.dailyCap` and `catalogue.remainingToday` on GET /me). Medias seen again the same day are free.
|
|
572
572
|
# @param id [String] The project.
|
|
573
573
|
# @param [Hash] opts the optional parameters
|
|
574
574
|
# @option opts [String] :source Which of the project's medias to search: `all` (the default), `recommended` (those Growwer recommends for the project), or those you marked `favourite`, `discarded` or `requested`, or `bought` for the project. Do not combine it with the parameter of the same state.
|
|
@@ -20,7 +20,7 @@ module Growwer
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Upload a file
|
|
23
|
-
# Uploads a document (odt, doc, docx or txt, up to 8 MB) for a later write to reference by its `id`. A file belongs to you, can be used by one write, and expires 24 hours after it was uploaded; an expired or used file is answered like an unknown one.
|
|
23
|
+
# Uploads a document (odt, doc, docx or txt, up to 8 MB) for a later write to reference by its `id`. A file belongs to you, can be used by one write, and expires 24 hours after it was uploaded; an expired or used file is answered like an unknown one. You may hold 20 files that no write has used yet and that have not expired. Past them it answers 429 `file_limit_reached`, with `details.limit` the number you may hold and `Retry-After` the seconds until the first of them expires; using one of them in a write frees its place at once. A file refused as invalid (422) is refused before they are counted, and a refused upload stores nothing.
|
|
24
24
|
# @param idempotency_key [String] A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
|
|
25
25
|
# @param file [File]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
@@ -31,7 +31,7 @@ module Growwer
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Upload a file
|
|
34
|
-
# Uploads a document (odt, doc, docx or txt, up to 8 MB) for a later write to reference by its `id`. A file belongs to you, can be used by one write, and expires 24 hours after it was uploaded; an expired or used file is answered like an unknown one.
|
|
34
|
+
# Uploads a document (odt, doc, docx or txt, up to 8 MB) for a later write to reference by its `id`. A file belongs to you, can be used by one write, and expires 24 hours after it was uploaded; an expired or used file is answered like an unknown one. You may hold 20 files that no write has used yet and that have not expired. Past them it answers 429 `file_limit_reached`, with `details.limit` the number you may hold and `Retry-After` the seconds until the first of them expires; using one of them in a write frees its place at once. A file refused as invalid (422) is refused before they are counted, and a refused upload stores nothing.
|
|
35
35
|
# @param idempotency_key [String] A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
|
|
36
36
|
# @param file [File]
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
@@ -0,0 +1,101 @@
|
|
|
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 'cgi'
|
|
14
|
+
|
|
15
|
+
module Growwer
|
|
16
|
+
class SellerAccountApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Set your holiday
|
|
23
|
+
# Starts, changes or ends your holiday, as the holiday settings of your profile page do. While you are on holiday your medias take no orders. `endDate` is the day your holiday ends, at 00:00 of that day in Growwer's server time, and must be later than now; leave it out, or send null, for a holiday you end yourself. Ending the holiday takes no `endDate`. A holiday that already is as you ask is answered 200 without a change. A restricted seller account stays on holiday until the restriction is lifted, so any change is refused. Your holiday is also in GET /me.
|
|
24
|
+
# @param idempotency_key [String] A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
|
|
25
|
+
# @param put_seller_holiday_request [PutSellerHolidayRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [PutSellerHoliday200Response]
|
|
28
|
+
def put_seller_holiday(idempotency_key, put_seller_holiday_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = put_seller_holiday_with_http_info(idempotency_key, put_seller_holiday_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Set your holiday
|
|
34
|
+
# Starts, changes or ends your holiday, as the holiday settings of your profile page do. While you are on holiday your medias take no orders. `endDate` is the day your holiday ends, at 00:00 of that day in Growwer's server time, and must be later than now; leave it out, or send null, for a holiday you end yourself. Ending the holiday takes no `endDate`. A holiday that already is as you ask is answered 200 without a change. A restricted seller account stays on holiday until the restriction is lifted, so any change is refused. Your holiday is also in GET /me.
|
|
35
|
+
# @param idempotency_key [String] A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters without spaces (`!` to `~`); any other value answers 400 `invalid_idempotency_key`.
|
|
36
|
+
# @param put_seller_holiday_request [PutSellerHolidayRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(PutSellerHoliday200Response, Integer, Hash)>] PutSellerHoliday200Response data, response status code and response headers
|
|
39
|
+
def put_seller_holiday_with_http_info(idempotency_key, put_seller_holiday_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: SellerAccountApi.put_seller_holiday ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'idempotency_key' is set
|
|
44
|
+
if @api_client.config.client_side_validation && idempotency_key.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling SellerAccountApi.put_seller_holiday"
|
|
46
|
+
end
|
|
47
|
+
if @api_client.config.client_side_validation && idempotency_key.to_s.length > 255
|
|
48
|
+
fail ArgumentError, 'invalid value for "idempotency_key" when calling SellerAccountApi.put_seller_holiday, the character length must be smaller than or equal to 255.'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# verify the required parameter 'put_seller_holiday_request' is set
|
|
52
|
+
if @api_client.config.client_side_validation && put_seller_holiday_request.nil?
|
|
53
|
+
fail ArgumentError, "Missing the required parameter 'put_seller_holiday_request' when calling SellerAccountApi.put_seller_holiday"
|
|
54
|
+
end
|
|
55
|
+
# resource path
|
|
56
|
+
local_var_path = '/api/v1/seller/holiday'
|
|
57
|
+
|
|
58
|
+
# query parameters
|
|
59
|
+
query_params = opts[:query_params] || {}
|
|
60
|
+
|
|
61
|
+
# header parameters
|
|
62
|
+
header_params = opts[:header_params] || {}
|
|
63
|
+
# HTTP header 'Accept' (if needed)
|
|
64
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
65
|
+
# HTTP header 'Content-Type'
|
|
66
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
67
|
+
if !content_type.nil?
|
|
68
|
+
header_params['Content-Type'] = content_type
|
|
69
|
+
end
|
|
70
|
+
header_params[:'Idempotency-Key'] = idempotency_key
|
|
71
|
+
|
|
72
|
+
# form parameters
|
|
73
|
+
form_params = opts[:form_params] || {}
|
|
74
|
+
|
|
75
|
+
# http body (model)
|
|
76
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(put_seller_holiday_request)
|
|
77
|
+
|
|
78
|
+
# return_type
|
|
79
|
+
return_type = opts[:debug_return_type] || 'PutSellerHoliday200Response'
|
|
80
|
+
|
|
81
|
+
# auth_names
|
|
82
|
+
auth_names = opts[:debug_auth_names] || ['apiKey']
|
|
83
|
+
|
|
84
|
+
new_options = opts.merge(
|
|
85
|
+
:operation => :"SellerAccountApi.put_seller_holiday",
|
|
86
|
+
:header_params => header_params,
|
|
87
|
+
:query_params => query_params,
|
|
88
|
+
:form_params => form_params,
|
|
89
|
+
:body => post_body,
|
|
90
|
+
:auth_names => auth_names,
|
|
91
|
+
:return_type => return_type
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
95
|
+
if @api_client.config.debugging
|
|
96
|
+
@api_client.config.logger.debug "API called: SellerAccountApi#put_seller_holiday\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
97
|
+
end
|
|
98
|
+
return data, status_code, headers
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
@@ -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.0.2"
|
|
38
38
|
@default_headers = {
|
|
39
39
|
'Content-Type' => 'application/json',
|
|
40
40
|
'User-Agent' => @user_agent
|
data/lib/growwer/models/error.rb
CHANGED
|
@@ -21,7 +21,7 @@ module Growwer
|
|
|
21
21
|
# A human-readable explanation. It may change.
|
|
22
22
|
attr_accessor :message
|
|
23
23
|
|
|
24
|
-
#
|
|
24
|
+
# UUID v4 generated per request, or the `X-Request-Id` you sent. Quote it when reporting a problem.
|
|
25
25
|
attr_accessor :request_id
|
|
26
26
|
|
|
27
27
|
# Extra data on some errors, such as the invalid fields of a validation_failed error.
|
|
@@ -15,13 +15,21 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Growwer
|
|
17
17
|
class GetMe200ResponseCatalogue < ApiModelBase
|
|
18
|
-
# Whether the catalogue operations (tag Catalogue: searching a project's medias, flash offers and media details)
|
|
18
|
+
# Whether you have the full daily cap of the catalogue operations (tag Catalogue: searching a project's medias, flash offers and media details). It is open to accounts with recent completed orders, as buyer or as seller; until then the catalogue answers within a smaller daily trial quota, which rises to the full cap after a completed order. A media you have ordered is always readable with GET /medias/{id} and counts against neither.
|
|
19
19
|
attr_accessor :eligible
|
|
20
20
|
|
|
21
|
+
# How many distinct medias the catalogue operations show you per UTC day: the full cap when `eligible` is true, the trial quota otherwise. 0 means the catalogue answers 403 `catalogue_requires_recent_order` until you have a recent completed order.
|
|
22
|
+
attr_accessor :daily_cap
|
|
23
|
+
|
|
24
|
+
# How many new distinct medias still fit in `dailyCap` today (UTC). Medias you have already seen today are free. Null when the count cannot be read right now; the catalogue operations then answer 503 until it can.
|
|
25
|
+
attr_accessor :remaining_today
|
|
26
|
+
|
|
21
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
28
|
def self.attribute_map
|
|
23
29
|
{
|
|
24
|
-
:'eligible' => :'eligible'
|
|
30
|
+
:'eligible' => :'eligible',
|
|
31
|
+
:'daily_cap' => :'dailyCap',
|
|
32
|
+
:'remaining_today' => :'remainingToday'
|
|
25
33
|
}
|
|
26
34
|
end
|
|
27
35
|
|
|
@@ -38,13 +46,16 @@ module Growwer
|
|
|
38
46
|
# Attribute type mapping.
|
|
39
47
|
def self.openapi_types
|
|
40
48
|
{
|
|
41
|
-
:'eligible' => :'Boolean'
|
|
49
|
+
:'eligible' => :'Boolean',
|
|
50
|
+
:'daily_cap' => :'Integer',
|
|
51
|
+
:'remaining_today' => :'Integer'
|
|
42
52
|
}
|
|
43
53
|
end
|
|
44
54
|
|
|
45
55
|
# List of attributes with nullable: true
|
|
46
56
|
def self.openapi_nullable
|
|
47
57
|
Set.new([
|
|
58
|
+
:'remaining_today'
|
|
48
59
|
])
|
|
49
60
|
end
|
|
50
61
|
|
|
@@ -69,6 +80,18 @@ module Growwer
|
|
|
69
80
|
else
|
|
70
81
|
self.eligible = nil
|
|
71
82
|
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'daily_cap')
|
|
85
|
+
self.daily_cap = attributes[:'daily_cap']
|
|
86
|
+
else
|
|
87
|
+
self.daily_cap = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'remaining_today')
|
|
91
|
+
self.remaining_today = attributes[:'remaining_today']
|
|
92
|
+
else
|
|
93
|
+
self.remaining_today = nil
|
|
94
|
+
end
|
|
72
95
|
end
|
|
73
96
|
|
|
74
97
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -80,6 +103,18 @@ module Growwer
|
|
|
80
103
|
invalid_properties.push('invalid value for "eligible", eligible cannot be nil.')
|
|
81
104
|
end
|
|
82
105
|
|
|
106
|
+
if @daily_cap.nil?
|
|
107
|
+
invalid_properties.push('invalid value for "daily_cap", daily_cap cannot be nil.')
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if @daily_cap < 0
|
|
111
|
+
invalid_properties.push('invalid value for "daily_cap", must be greater than or equal to 0.')
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if @remaining_today < 0
|
|
115
|
+
invalid_properties.push('invalid value for "remaining_today", must be greater than or equal to 0.')
|
|
116
|
+
end
|
|
117
|
+
|
|
83
118
|
invalid_properties
|
|
84
119
|
end
|
|
85
120
|
|
|
@@ -88,6 +123,9 @@ module Growwer
|
|
|
88
123
|
def valid?
|
|
89
124
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
90
125
|
return false if @eligible.nil?
|
|
126
|
+
return false if @daily_cap.nil?
|
|
127
|
+
return false if @daily_cap < 0
|
|
128
|
+
return false if @remaining_today < 0
|
|
91
129
|
true
|
|
92
130
|
end
|
|
93
131
|
|
|
@@ -101,12 +139,38 @@ module Growwer
|
|
|
101
139
|
@eligible = eligible
|
|
102
140
|
end
|
|
103
141
|
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] daily_cap Value to be assigned
|
|
144
|
+
def daily_cap=(daily_cap)
|
|
145
|
+
if daily_cap.nil?
|
|
146
|
+
fail ArgumentError, 'daily_cap cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
if daily_cap < 0
|
|
150
|
+
fail ArgumentError, 'invalid value for "daily_cap", must be greater than or equal to 0.'
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
@daily_cap = daily_cap
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Custom attribute writer method with validation
|
|
157
|
+
# @param [Object] remaining_today Value to be assigned
|
|
158
|
+
def remaining_today=(remaining_today)
|
|
159
|
+
if !remaining_today.nil? && remaining_today < 0
|
|
160
|
+
fail ArgumentError, 'invalid value for "remaining_today", must be greater than or equal to 0.'
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
@remaining_today = remaining_today
|
|
164
|
+
end
|
|
165
|
+
|
|
104
166
|
# Checks equality by comparing each attribute.
|
|
105
167
|
# @param [Object] Object to be compared
|
|
106
168
|
def ==(o)
|
|
107
169
|
return true if self.equal?(o)
|
|
108
170
|
self.class == o.class &&
|
|
109
|
-
eligible == o.eligible
|
|
171
|
+
eligible == o.eligible &&
|
|
172
|
+
daily_cap == o.daily_cap &&
|
|
173
|
+
remaining_today == o.remaining_today
|
|
110
174
|
end
|
|
111
175
|
|
|
112
176
|
# @see the `==` method
|
|
@@ -118,7 +182,7 @@ module Growwer
|
|
|
118
182
|
# Calculates hash code according to all attributes.
|
|
119
183
|
# @return [Integer] Hash code
|
|
120
184
|
def hash
|
|
121
|
-
[eligible].hash
|
|
185
|
+
[eligible, daily_cap, remaining_today].hash
|
|
122
186
|
end
|
|
123
187
|
|
|
124
188
|
# Builds the object from hash
|
data/lib/growwer/version.rb
CHANGED
data/lib/growwer.rb
CHANGED
|
@@ -133,16 +133,17 @@ require 'growwer/models/withdrawal'
|
|
|
133
133
|
|
|
134
134
|
# APIs
|
|
135
135
|
require 'growwer/api/account_api'
|
|
136
|
-
require 'growwer/api/
|
|
136
|
+
require 'growwer/api/buyer_orders_api'
|
|
137
|
+
require 'growwer/api/buyer_wallet_api'
|
|
137
138
|
require 'growwer/api/catalogue_api'
|
|
138
139
|
require 'growwer/api/files_api'
|
|
139
140
|
require 'growwer/api/managed_services_api'
|
|
140
|
-
require 'growwer/api/orders_api'
|
|
141
141
|
require 'growwer/api/projects_api'
|
|
142
142
|
require 'growwer/api/saved_filters_api'
|
|
143
|
+
require 'growwer/api/seller_account_api'
|
|
143
144
|
require 'growwer/api/seller_medias_api'
|
|
144
|
-
require 'growwer/api/seller_money_api'
|
|
145
145
|
require 'growwer/api/seller_orders_api'
|
|
146
|
+
require 'growwer/api/seller_wallet_api'
|
|
146
147
|
|
|
147
148
|
module Growwer
|
|
148
149
|
class << self
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#Growwer API
|
|
3
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) 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.
|
|
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
5
|
|
|
6
6
|
The version of the OpenAPI document: 1
|
|
7
7
|
Contact: support@growwer.com
|
|
@@ -54,17 +54,4 @@ describe 'AccountApi' do
|
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
# unit tests for put_seller_holiday
|
|
58
|
-
# Set your holiday
|
|
59
|
-
# Starts, changes or ends your holiday, as the holiday settings of your profile page do. While you are on holiday your medias take no orders. `endDate` is the day your holiday ends, at 00:00 of that day in Growwer's server time, and must be later than now; leave it out, or send null, for a holiday you end yourself. Ending the holiday takes no `endDate`. A holiday that already is as you ask is answered 200 without a change. A restricted seller account stays on holiday until the restriction is lifted, so any change is refused. Your holiday is also in GET /me.
|
|
60
|
-
# @param idempotency_key A new key for each write, reused only to retry that same write. 1 to 255 printable ASCII characters.
|
|
61
|
-
# @param put_seller_holiday_request
|
|
62
|
-
# @param [Hash] opts the optional parameters
|
|
63
|
-
# @return [PutSellerHoliday200Response]
|
|
64
|
-
describe 'put_seller_holiday test' do
|
|
65
|
-
it 'should work' do
|
|
66
|
-
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
57
|
end
|