moov_ruby 26.10.0.pre.dev.0 → 26.10.0.pre.dev.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/lib/moov/avatars.rb +275 -0
- data/lib/moov/models/components/avataruploadrequest.rb +32 -0
- data/lib/moov/models/components/avataruploadrequest.rbi +13 -0
- data/lib/moov/models/components/avataruploadrequest_file.rb +36 -0
- data/lib/moov/models/components/avataruploadrequest_file.rbi +15 -0
- data/lib/moov/models/components/capabilityid.rb +1 -0
- data/lib/moov/models/components/createtransfer.rb +6 -2
- data/lib/moov/models/components/createtransfer.rbi +2 -0
- data/lib/moov/models/components/feepaidby.rb +19 -0
- data/lib/moov/models/components/feepaidby.rbi +11 -0
- data/lib/moov/models/components/incurredfee.rb +6 -2
- data/lib/moov/models/components/incurredfee.rbi +2 -0
- data/lib/moov/models/components/issuingintervallimit.rb +1 -1
- data/lib/moov/models/components/issuingvelocitylimit.rb +1 -1
- data/lib/moov/models/components/paymentlinkpayoutdetails.rb +8 -2
- data/lib/moov/models/components/paymentlinkpayoutdetails.rbi +2 -0
- data/lib/moov/models/components/paymentlinkpayoutdetailsupdate.rb +8 -2
- data/lib/moov/models/components/paymentlinkpayoutdetailsupdate.rbi +2 -0
- data/lib/moov/models/components/payoutdetailserror.rb +6 -2
- data/lib/moov/models/components/payoutdetailserror.rbi +2 -0
- data/lib/moov/models/components/product.rb +6 -2
- data/lib/moov/models/components/product.rbi +2 -0
- data/lib/moov/models/components/productcategories.rb +32 -0
- data/lib/moov/models/components/productcategories.rbi +13 -0
- data/lib/moov/models/components/productcategory.rb +48 -0
- data/lib/moov/models/components/productcategory.rbi +21 -0
- data/lib/moov/models/components/productrequest.rb +6 -2
- data/lib/moov/models/components/productrequest.rbi +2 -0
- data/lib/moov/models/components/schemebasicauth.rb +36 -0
- data/lib/moov/models/components/schemebasicauth.rbi +15 -0
- data/lib/moov/models/components/schemeoauth2auth.rb +40 -0
- data/lib/moov/models/components/schemeoauth2auth.rbi +17 -0
- data/lib/moov/models/components/transferfeepaidby.rb +32 -0
- data/lib/moov/models/components/transferfeepaidby.rbi +13 -0
- data/lib/moov/models/components.rb +8 -0
- data/lib/moov/models/errors/productrequestvalidationerror.rb +6 -2
- data/lib/moov/models/errors/productrequestvalidationerror.rbi +2 -0
- data/lib/moov/models/operations/deleteavatar_request.rb +32 -0
- data/lib/moov/models/operations/deleteavatar_request.rbi +13 -0
- data/lib/moov/models/operations/deleteavatar_response.rb +44 -0
- data/lib/moov/models/operations/deleteavatar_response.rbi +19 -0
- data/lib/moov/models/operations/deleteavatar_security.rb +36 -0
- data/lib/moov/models/operations/deleteavatar_security.rbi +15 -0
- data/lib/moov/models/operations/listproductcategories_response.rb +48 -0
- data/lib/moov/models/operations/listproductcategories_response.rbi +21 -0
- data/lib/moov/models/operations/listproducts_request.rb +8 -2
- data/lib/moov/models/operations/listproducts_request.rbi +2 -0
- data/lib/moov/models/operations/uploadavatar_request.rb +36 -0
- data/lib/moov/models/operations/uploadavatar_request.rbi +15 -0
- data/lib/moov/models/operations/uploadavatar_response.rb +44 -0
- data/lib/moov/models/operations/uploadavatar_response.rbi +19 -0
- data/lib/moov/models/operations/uploadavatar_security.rb +36 -0
- data/lib/moov/models/operations/uploadavatar_security.rbi +15 -0
- data/lib/moov/models/operations.rb +7 -0
- data/lib/moov/products.rb +113 -8
- data/lib/moov/sdk_hooks/clientcredentials.rb +386 -0
- data/lib/moov/sdk_hooks/hooks.rb +6 -0
- data/lib/moov/sdk_hooks/oauth2scopes.rb +18 -0
- data/lib/moov/sdkconfiguration.rb +3 -3
- metadata +34 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Operations::ListProductCategoriesResponse
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Operations::ListProductCategoriesResponse
|
|
11
|
+
def content_type(); end
|
|
12
|
+
def content_type=(str_); end
|
|
13
|
+
def status_code(); end
|
|
14
|
+
def status_code=(str_); end
|
|
15
|
+
def raw_response(); end
|
|
16
|
+
def raw_response=(str_); end
|
|
17
|
+
def headers(); end
|
|
18
|
+
def headers=(str_); end
|
|
19
|
+
def product_categories(); end
|
|
20
|
+
def product_categories=(str_); end
|
|
21
|
+
end
|
|
@@ -16,15 +16,20 @@ module Moov
|
|
|
16
16
|
field :account_id, ::String, { 'path_param': { 'field_name': 'accountID', 'style': 'simple', 'explode': false } }
|
|
17
17
|
# Allows filtering products by title. This supports partial matches and is case-insensitive
|
|
18
18
|
field :title, Crystalline::Nilable.new(::String), { 'query_param': { 'field_name': 'title', 'style': 'form', 'explode': false } }
|
|
19
|
+
# Filter products by category. Accepts a category ID at any level of the taxonomy;
|
|
20
|
+
# a product matches when the given category is anywhere in its category's breadcrumb
|
|
21
|
+
# (i.e. filtering by a top-level category returns products in any of its descendants).
|
|
22
|
+
field :category, Crystalline::Nilable.new(::String), { 'query_param': { 'field_name': 'category', 'style': 'form', 'explode': false } }
|
|
19
23
|
|
|
20
24
|
field :skip, Crystalline::Nilable.new(::Integer), { 'query_param': { 'field_name': 'skip', 'style': 'form', 'explode': false } }
|
|
21
25
|
|
|
22
26
|
field :count, Crystalline::Nilable.new(::Integer), { 'query_param': { 'field_name': 'count', 'style': 'form', 'explode': false } }
|
|
23
27
|
|
|
24
|
-
sig { params(account_id: ::String, title: T.nilable(::String), skip: T.nilable(::Integer), count: T.nilable(::Integer)).void }
|
|
25
|
-
def initialize(account_id:, title: nil, skip: nil, count: nil)
|
|
28
|
+
sig { params(account_id: ::String, title: T.nilable(::String), category: T.nilable(::String), skip: T.nilable(::Integer), count: T.nilable(::Integer)).void }
|
|
29
|
+
def initialize(account_id:, title: nil, category: nil, skip: nil, count: nil)
|
|
26
30
|
@account_id = account_id
|
|
27
31
|
@title = title
|
|
32
|
+
@category = category
|
|
28
33
|
@skip = skip
|
|
29
34
|
@count = count
|
|
30
35
|
end
|
|
@@ -34,6 +39,7 @@ module Moov
|
|
|
34
39
|
return false unless other.is_a? self.class
|
|
35
40
|
return false unless @account_id == other.account_id
|
|
36
41
|
return false unless @title == other.title
|
|
42
|
+
return false unless @category == other.category
|
|
37
43
|
return false unless @skip == other.skip
|
|
38
44
|
return false unless @count == other.count
|
|
39
45
|
true
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Operations
|
|
10
|
+
|
|
11
|
+
class UploadAvatarRequest
|
|
12
|
+
extend T::Sig
|
|
13
|
+
include Crystalline::MetadataFields
|
|
14
|
+
|
|
15
|
+
# The accountID to upload the avatar for. Only accountID values are accepted for writes.
|
|
16
|
+
field :unique_id, ::String, { 'path_param': { 'field_name': 'uniqueID', 'style': 'simple', 'explode': false } }
|
|
17
|
+
|
|
18
|
+
field :avatar_upload_request, Models::Components::AvatarUploadRequest, { 'request': { 'media_type': 'multipart/form-data' } }
|
|
19
|
+
|
|
20
|
+
sig { params(unique_id: ::String, avatar_upload_request: Models::Components::AvatarUploadRequest).void }
|
|
21
|
+
def initialize(unique_id:, avatar_upload_request:)
|
|
22
|
+
@unique_id = unique_id
|
|
23
|
+
@avatar_upload_request = avatar_upload_request
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
27
|
+
def ==(other)
|
|
28
|
+
return false unless other.is_a? self.class
|
|
29
|
+
return false unless @unique_id == other.unique_id
|
|
30
|
+
return false unless @avatar_upload_request == other.avatar_upload_request
|
|
31
|
+
true
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Operations::UploadAvatarRequest
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Operations::UploadAvatarRequest
|
|
11
|
+
def unique_id(); end
|
|
12
|
+
def unique_id=(str_); end
|
|
13
|
+
def avatar_upload_request(); end
|
|
14
|
+
def avatar_upload_request=(str_); end
|
|
15
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Operations
|
|
10
|
+
|
|
11
|
+
class UploadAvatarResponse
|
|
12
|
+
extend T::Sig
|
|
13
|
+
include Crystalline::MetadataFields
|
|
14
|
+
|
|
15
|
+
# HTTP response content type for this operation
|
|
16
|
+
field :content_type, ::String
|
|
17
|
+
# HTTP response status code for this operation
|
|
18
|
+
field :status_code, ::Integer
|
|
19
|
+
# Raw HTTP response; suitable for custom response parsing
|
|
20
|
+
field :raw_response, ::Faraday::Response
|
|
21
|
+
|
|
22
|
+
field :headers, Crystalline::Hash.new(Symbol, Crystalline::Array.new(::String))
|
|
23
|
+
|
|
24
|
+
sig { params(content_type: ::String, status_code: ::Integer, raw_response: ::Faraday::Response, headers: T::Hash[Symbol, T::Array[::String]]).void }
|
|
25
|
+
def initialize(content_type:, status_code:, raw_response:, headers:)
|
|
26
|
+
@content_type = content_type
|
|
27
|
+
@status_code = status_code
|
|
28
|
+
@raw_response = raw_response
|
|
29
|
+
@headers = headers
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
33
|
+
def ==(other)
|
|
34
|
+
return false unless other.is_a? self.class
|
|
35
|
+
return false unless @content_type == other.content_type
|
|
36
|
+
return false unless @status_code == other.status_code
|
|
37
|
+
return false unless @raw_response == other.raw_response
|
|
38
|
+
return false unless @headers == other.headers
|
|
39
|
+
true
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Operations::UploadAvatarResponse
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Operations::UploadAvatarResponse
|
|
11
|
+
def content_type(); end
|
|
12
|
+
def content_type=(str_); end
|
|
13
|
+
def status_code(); end
|
|
14
|
+
def status_code=(str_); end
|
|
15
|
+
def raw_response(); end
|
|
16
|
+
def raw_response=(str_); end
|
|
17
|
+
def headers(); end
|
|
18
|
+
def headers=(str_); end
|
|
19
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module Moov
|
|
8
|
+
module Models
|
|
9
|
+
module Operations
|
|
10
|
+
|
|
11
|
+
class UploadAvatarSecurity
|
|
12
|
+
extend T::Sig
|
|
13
|
+
include Crystalline::MetadataFields
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
field :basic_auth, Crystalline::Nilable.new(Models::Components::SchemeBasicAuth), { 'security': { 'scheme': true, 'type': 'http', 'sub_type': 'basic' } }
|
|
17
|
+
|
|
18
|
+
field :o_auth2_auth, Crystalline::Nilable.new(Models::Components::SchemeOAuth2Auth), { 'security': { 'scheme': true, 'type': 'oauth2', 'sub_type': 'client_credentials' } }
|
|
19
|
+
|
|
20
|
+
sig { params(basic_auth: T.nilable(Models::Components::SchemeBasicAuth), o_auth2_auth: T.nilable(Models::Components::SchemeOAuth2Auth)).void }
|
|
21
|
+
def initialize(basic_auth: nil, o_auth2_auth: nil)
|
|
22
|
+
@basic_auth = basic_auth
|
|
23
|
+
@o_auth2_auth = o_auth2_auth
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
27
|
+
def ==(other)
|
|
28
|
+
return false unless other.is_a? self.class
|
|
29
|
+
return false unless @basic_auth == other.basic_auth
|
|
30
|
+
return false unless @o_auth2_auth == other.o_auth2_auth
|
|
31
|
+
true
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Moov::Models::Operations::UploadAvatarSecurity
|
|
6
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Moov::Models::Operations::UploadAvatarSecurity
|
|
11
|
+
def basic_auth(); end
|
|
12
|
+
def basic_auth=(str_); end
|
|
13
|
+
def o_auth2_auth(); end
|
|
14
|
+
def o_auth2_auth=(str_); end
|
|
15
|
+
end
|
|
@@ -66,6 +66,9 @@ module Moov
|
|
|
66
66
|
autoload :CreateWalletRequest, 'moov/models/operations/createwallet_request.rb'
|
|
67
67
|
autoload :CreateWalletResponse, 'moov/models/operations/createwallet_response.rb'
|
|
68
68
|
autoload :CreateWebhookResponse, 'moov/models/operations/createwebhook_response.rb'
|
|
69
|
+
autoload :DeleteAvatarSecurity, 'moov/models/operations/deleteavatar_security.rb'
|
|
70
|
+
autoload :DeleteAvatarRequest, 'moov/models/operations/deleteavatar_request.rb'
|
|
71
|
+
autoload :DeleteAvatarResponse, 'moov/models/operations/deleteavatar_response.rb'
|
|
69
72
|
autoload :DeleteDisputeEvidenceFileRequest, 'moov/models/operations/deletedisputeevidencefile_request.rb'
|
|
70
73
|
autoload :DeleteDisputeEvidenceFileResponse, 'moov/models/operations/deletedisputeevidencefile_response.rb'
|
|
71
74
|
autoload :DeleteImageRequest, 'moov/models/operations/deleteimage_request.rb'
|
|
@@ -270,6 +273,7 @@ module Moov
|
|
|
270
273
|
autoload :ListPaymentLinksResponse, 'moov/models/operations/listpaymentlinks_response.rb'
|
|
271
274
|
autoload :ListPaymentMethodsRequest, 'moov/models/operations/listpaymentmethods_request.rb'
|
|
272
275
|
autoload :ListPaymentMethodsResponse, 'moov/models/operations/listpaymentmethods_response.rb'
|
|
276
|
+
autoload :ListProductCategoriesResponse, 'moov/models/operations/listproductcategories_response.rb'
|
|
273
277
|
autoload :ListProductsRequest, 'moov/models/operations/listproducts_request.rb'
|
|
274
278
|
autoload :ListProductsResponse, 'moov/models/operations/listproducts_response.rb'
|
|
275
279
|
autoload :ListReceiptsRequest, 'moov/models/operations/listreceipts_request.rb'
|
|
@@ -362,6 +366,9 @@ module Moov
|
|
|
362
366
|
autoload :UpdateWalletResponse, 'moov/models/operations/updatewallet_response.rb'
|
|
363
367
|
autoload :UpdateWebhookRequest, 'moov/models/operations/updatewebhook_request.rb'
|
|
364
368
|
autoload :UpdateWebhookResponse, 'moov/models/operations/updatewebhook_response.rb'
|
|
369
|
+
autoload :UploadAvatarSecurity, 'moov/models/operations/uploadavatar_security.rb'
|
|
370
|
+
autoload :UploadAvatarRequest, 'moov/models/operations/uploadavatar_request.rb'
|
|
371
|
+
autoload :UploadAvatarResponse, 'moov/models/operations/uploadavatar_response.rb'
|
|
365
372
|
autoload :UploadDisputeEvidenceFileRequest, 'moov/models/operations/uploaddisputeevidencefile_request.rb'
|
|
366
373
|
autoload :UploadDisputeEvidenceFileResponse, 'moov/models/operations/uploaddisputeevidencefile_response.rb'
|
|
367
374
|
autoload :UploadDisputeEvidenceTextRequest, 'moov/models/operations/uploaddisputeevidencetext_request.rb'
|
data/lib/moov/products.rb
CHANGED
|
@@ -41,15 +41,9 @@ module Moov
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
sig { params(
|
|
45
|
-
def list(
|
|
44
|
+
sig { params(request: Models::Operations::ListProductsRequest, timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::ListProductsResponse) }
|
|
45
|
+
def list(request:, timeout_ms: nil, http_headers: nil)
|
|
46
46
|
# list - List active (non-disabled) products for an account.
|
|
47
|
-
request = Models::Operations::ListProductsRequest.new(
|
|
48
|
-
account_id: account_id,
|
|
49
|
-
title: title,
|
|
50
|
-
skip: skip,
|
|
51
|
-
count: count
|
|
52
|
-
)
|
|
53
47
|
url, params = @sdk_configuration.get_server_details
|
|
54
48
|
base_url = Utils.template_url(url, params)
|
|
55
49
|
url = Utils.generate_url(
|
|
@@ -736,5 +730,116 @@ module Moov
|
|
|
736
730
|
|
|
737
731
|
end
|
|
738
732
|
end
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
sig { params(timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::ListProductCategoriesResponse) }
|
|
736
|
+
def list_categories(timeout_ms: nil, http_headers: nil)
|
|
737
|
+
# list_categories - Returns the full, read-only list of product categories from the product taxonomy.
|
|
738
|
+
url, params = @sdk_configuration.get_server_details
|
|
739
|
+
base_url = Utils.template_url(url, params)
|
|
740
|
+
url = "#{base_url}/product-categories"
|
|
741
|
+
headers = {}
|
|
742
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
743
|
+
headers['Accept'] = 'application/json'
|
|
744
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
|
745
|
+
|
|
746
|
+
security = @sdk_configuration.security_source&.call
|
|
747
|
+
|
|
748
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
749
|
+
timeout ||= @sdk_configuration.timeout
|
|
750
|
+
|
|
751
|
+
|
|
752
|
+
connection = @sdk_configuration.client
|
|
753
|
+
|
|
754
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
755
|
+
config: @sdk_configuration,
|
|
756
|
+
base_url: base_url,
|
|
757
|
+
oauth2_scopes: nil,
|
|
758
|
+
operation_id: 'listProductCategories',
|
|
759
|
+
security_source: @sdk_configuration.security_source
|
|
760
|
+
)
|
|
761
|
+
|
|
762
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
763
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
begin
|
|
767
|
+
http_response = T.must(connection).get(url) do |req|
|
|
768
|
+
req.headers.merge!(headers)
|
|
769
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
770
|
+
Utils.configure_request_security(req, security)
|
|
771
|
+
http_headers&.each do |key, value|
|
|
772
|
+
req.headers[key.to_s] = value
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
@sdk_configuration.hooks.before_request(
|
|
776
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
777
|
+
hook_ctx: hook_ctx
|
|
778
|
+
),
|
|
779
|
+
request: req
|
|
780
|
+
)
|
|
781
|
+
end
|
|
782
|
+
rescue StandardError => e
|
|
783
|
+
error = e
|
|
784
|
+
ensure
|
|
785
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
786
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
787
|
+
error: error,
|
|
788
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
789
|
+
hook_ctx: hook_ctx
|
|
790
|
+
),
|
|
791
|
+
response: http_response
|
|
792
|
+
)
|
|
793
|
+
else
|
|
794
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
795
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
796
|
+
hook_ctx: hook_ctx
|
|
797
|
+
),
|
|
798
|
+
response: http_response
|
|
799
|
+
)
|
|
800
|
+
end
|
|
801
|
+
|
|
802
|
+
if http_response.nil?
|
|
803
|
+
raise error if !error.nil?
|
|
804
|
+
raise 'no response'
|
|
805
|
+
end
|
|
806
|
+
end
|
|
807
|
+
|
|
808
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
|
809
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
|
810
|
+
if Utils.match_content_type(content_type, 'application/json')
|
|
811
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
812
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
813
|
+
hook_ctx: hook_ctx
|
|
814
|
+
),
|
|
815
|
+
response: http_response
|
|
816
|
+
)
|
|
817
|
+
response_data = http_response.env.response_body
|
|
818
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::ProductCategories)
|
|
819
|
+
response = Models::Operations::ListProductCategoriesResponse.new(
|
|
820
|
+
status_code: http_response.status,
|
|
821
|
+
content_type: content_type,
|
|
822
|
+
raw_response: http_response,
|
|
823
|
+
headers: http_response.headers,
|
|
824
|
+
product_categories: T.unsafe(obj)
|
|
825
|
+
)
|
|
826
|
+
|
|
827
|
+
return response
|
|
828
|
+
else
|
|
829
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
|
830
|
+
end
|
|
831
|
+
elsif Utils.match_status_code(http_response.status, ['401', '403', '429'])
|
|
832
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
833
|
+
elsif Utils.match_status_code(http_response.status, ['500', '504'])
|
|
834
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
835
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
|
836
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
837
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
|
838
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
|
839
|
+
else
|
|
840
|
+
raise ::Moov::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
|
841
|
+
|
|
842
|
+
end
|
|
843
|
+
end
|
|
739
844
|
end
|
|
740
845
|
end
|