dub 0.2.2.pre.alpha.83 → 0.2.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/lib/dub.rb +5 -9
- data/lib/open_api_sdk/analytics.rb +17 -72
- data/lib/open_api_sdk/domains.rb +95 -312
- data/lib/open_api_sdk/dub.rb +45 -56
- data/lib/open_api_sdk/links.rb +188 -799
- data/lib/open_api_sdk/metatags.rb +8 -63
- data/lib/open_api_sdk/models/operations/bulkcreatelinks_response.rb +7 -7
- data/lib/open_api_sdk/models/operations/bulkupdatelinks_requestbody.rb +6 -9
- data/lib/open_api_sdk/models/operations/bulkupdatelinks_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/color.rb +2 -1
- data/lib/open_api_sdk/models/operations/createdomain_requestbody.rb +4 -16
- data/lib/open_api_sdk/models/operations/createdomain_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/createlink_requestbody.rb +13 -51
- data/lib/open_api_sdk/models/operations/createlink_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/createtag_requestbody.rb +2 -2
- data/lib/open_api_sdk/models/operations/createtag_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/data.rb +12 -50
- data/lib/open_api_sdk/models/operations/deletedomain_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/deletedomain_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/deletedomain_responsebody.rb +2 -2
- data/lib/open_api_sdk/models/operations/deletelink_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/deletelink_response.rb +3 -3
- data/lib/open_api_sdk/models/operations/deletelink_responsebody.rb +3 -3
- data/lib/open_api_sdk/models/operations/event.rb +3 -2
- data/lib/open_api_sdk/models/operations/getlinkinfo_request.rb +3 -3
- data/lib/open_api_sdk/models/operations/getlinkinfo_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/getlinks_request.rb +10 -25
- data/lib/open_api_sdk/models/operations/getlinks_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/getlinkscount_request.rb +7 -13
- data/lib/open_api_sdk/models/operations/getlinkscount_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/getmetatags_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/getmetatags_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/getmetatags_responsebody.rb +2 -2
- data/lib/open_api_sdk/models/operations/getqrcode_request.rb +5 -14
- data/lib/open_api_sdk/models/operations/getqrcode_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/gettags_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/getworkspace_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/getworkspace_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/groupby.rb +4 -12
- data/lib/open_api_sdk/models/operations/interval.rb +5 -5
- data/lib/open_api_sdk/models/operations/level.rb +2 -1
- data/lib/open_api_sdk/models/operations/listdomains_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/paymentprocessor.rb +2 -3
- data/lib/open_api_sdk/models/operations/requestbody.rb +13 -51
- data/lib/open_api_sdk/models/operations/retrieveanalytics_request.rb +11 -53
- data/lib/open_api_sdk/models/operations/retrieveanalytics_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/sort.rb +3 -5
- data/lib/open_api_sdk/models/operations/trackcustomer_requestbody.rb +33 -0
- data/lib/open_api_sdk/models/operations/{createpartner_response.rb → trackcustomer_response.rb} +5 -5
- data/lib/open_api_sdk/models/operations/trackcustomer_responsebody.rb +33 -0
- data/lib/open_api_sdk/models/operations/tracklead_requestbody.rb +9 -20
- data/lib/open_api_sdk/models/operations/tracklead_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/tracklead_responsebody.rb +23 -8
- data/lib/open_api_sdk/models/operations/tracksale_requestbody.rb +8 -16
- data/lib/open_api_sdk/models/operations/tracksale_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/tracksale_responsebody.rb +20 -8
- data/lib/open_api_sdk/models/operations/updatedomain_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/updatedomain_requestbody.rb +4 -16
- data/lib/open_api_sdk/models/operations/updatedomain_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/updatelink_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/updatelink_requestbody.rb +14 -52
- data/lib/open_api_sdk/models/operations/updatelink_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/updatetag_color.rb +2 -1
- data/lib/open_api_sdk/models/operations/updatetag_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/updatetag_requestbody.rb +2 -2
- data/lib/open_api_sdk/models/operations/updatetag_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/updateworkspace_request.rb +2 -2
- data/lib/open_api_sdk/models/operations/updateworkspace_requestbody.rb +4 -13
- data/lib/open_api_sdk/models/operations/updateworkspace_response.rb +2 -2
- data/lib/open_api_sdk/models/operations/upsertlink_requestbody.rb +13 -51
- data/lib/open_api_sdk/models/operations/upsertlink_response.rb +2 -2
- data/lib/open_api_sdk/models/operations.rb +22 -119
- data/lib/open_api_sdk/models/shared/badrequest.rb +3 -3
- data/lib/open_api_sdk/models/shared/code.rb +2 -1
- data/lib/open_api_sdk/models/shared/color.rb +2 -1
- data/lib/open_api_sdk/models/shared/conflict.rb +3 -3
- data/lib/open_api_sdk/models/shared/conflict_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/conflict_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/countrycode.rb +2 -1
- data/lib/open_api_sdk/models/shared/domains.rb +4 -7
- data/lib/open_api_sdk/models/shared/domainschema.rb +4 -19
- data/lib/open_api_sdk/models/shared/error.rb +2 -2
- data/lib/open_api_sdk/models/shared/forbidden.rb +3 -3
- data/lib/open_api_sdk/models/shared/forbidden_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/forbidden_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/geo.rb +2 -2
- data/lib/open_api_sdk/models/shared/internalservererror.rb +3 -3
- data/lib/open_api_sdk/models/shared/internalservererror_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/internalservererror_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/inviteexpired.rb +3 -3
- data/lib/open_api_sdk/models/shared/inviteexpired_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/inviteexpired_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/linkgeotargeting.rb +2 -2
- data/lib/open_api_sdk/models/shared/linkschema.rb +8 -29
- data/lib/open_api_sdk/models/shared/notfound.rb +3 -3
- data/lib/open_api_sdk/models/shared/notfound_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/notfound_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/plan.rb +2 -2
- data/lib/open_api_sdk/models/shared/ratelimitexceeded.rb +3 -3
- data/lib/open_api_sdk/models/shared/ratelimitexceeded_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/ratelimitexceeded_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/role.rb +2 -1
- data/lib/open_api_sdk/models/shared/security.rb +4 -4
- data/lib/open_api_sdk/models/shared/tagschema.rb +2 -2
- data/lib/open_api_sdk/models/shared/unauthorized.rb +3 -3
- data/lib/open_api_sdk/models/shared/unauthorized_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/unauthorized_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/unprocessableentity.rb +3 -3
- data/lib/open_api_sdk/models/shared/unprocessableentity_code.rb +2 -1
- data/lib/open_api_sdk/models/shared/unprocessableentity_error.rb +2 -2
- data/lib/open_api_sdk/models/shared/users.rb +4 -7
- data/lib/open_api_sdk/models/shared/workspaceschema.rb +8 -47
- data/lib/open_api_sdk/models/shared.rb +2 -12
- data/lib/open_api_sdk/qr_codes.rb +17 -71
- data/lib/open_api_sdk/sdkconfiguration.rb +10 -33
- data/lib/open_api_sdk/tags.rb +68 -366
- data/lib/open_api_sdk/track.rb +122 -148
- data/lib/{crystalline → open_api_sdk/utils}/metadata_fields.rb +20 -33
- data/lib/{crystalline → open_api_sdk/utils}/t.rb +1 -1
- data/lib/open_api_sdk/utils/utils.rb +60 -26
- data/lib/open_api_sdk/workspaces.rb +36 -145
- metadata +12 -172
- data/lib/crystalline/utils.rb +0 -65
- data/lib/crystalline.rb +0 -12
- data/lib/open_api_sdk/customers.rb +0 -709
- data/lib/open_api_sdk/embed_tokens.rb +0 -163
- data/lib/open_api_sdk/events.rb +0 -154
- data/lib/open_api_sdk/folders.rb +0 -570
- data/lib/open_api_sdk/models/operations/accesslevel.rb +0 -18
- data/lib/open_api_sdk/models/operations/bulkdeletelinks_request.rb +0 -24
- data/lib/open_api_sdk/models/operations/bulkdeletelinks_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/bulkdeletelinks_responsebody.rb +0 -24
- data/lib/open_api_sdk/models/operations/click.rb +0 -24
- data/lib/open_api_sdk/models/operations/country.rb +0 -266
- data/lib/open_api_sdk/models/operations/createcustomer_discount.rb +0 -45
- data/lib/open_api_sdk/models/operations/createcustomer_link.rb +0 -36
- data/lib/open_api_sdk/models/operations/createcustomer_partner.rb +0 -33
- data/lib/open_api_sdk/models/operations/createcustomer_requestbody.rb +0 -33
- data/lib/open_api_sdk/models/operations/createcustomer_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/createcustomer_responsebody.rb +0 -51
- data/lib/open_api_sdk/models/operations/createcustomer_type.rb +0 -18
- data/lib/open_api_sdk/models/operations/createfolder_requestbody.rb +0 -27
- data/lib/open_api_sdk/models/operations/createfolder_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/createpartner_requestbody.rb +0 -48
- data/lib/open_api_sdk/models/operations/createpartner_responsebody.rb +0 -75
- data/lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb +0 -99
- data/lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb +0 -42
- data/lib/open_api_sdk/models/operations/createpartnerlink_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/createreferralsembedtoken_country.rb +0 -266
- data/lib/open_api_sdk/models/operations/createreferralsembedtoken_linkprops.rb +0 -99
- data/lib/open_api_sdk/models/operations/createreferralsembedtoken_requestbody.rb +0 -33
- data/lib/open_api_sdk/models/operations/createreferralsembedtoken_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/createreferralsembedtoken_responsebody.rb +0 -27
- data/lib/open_api_sdk/models/operations/customer.rb +0 -33
- data/lib/open_api_sdk/models/operations/deletecustomer_request.rb +0 -24
- data/lib/open_api_sdk/models/operations/deletecustomer_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/deletecustomer_responsebody.rb +0 -24
- data/lib/open_api_sdk/models/operations/deletefolder_request.rb +0 -24
- data/lib/open_api_sdk/models/operations/deletefolder_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/deletefolder_responsebody.rb +0 -24
- data/lib/open_api_sdk/models/operations/deletetag_request.rb +0 -24
- data/lib/open_api_sdk/models/operations/deletetag_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/deletetag_responsebody.rb +0 -24
- data/lib/open_api_sdk/models/operations/discount.rb +0 -45
- data/lib/open_api_sdk/models/operations/getcustomer_discount.rb +0 -45
- data/lib/open_api_sdk/models/operations/getcustomer_link.rb +0 -36
- data/lib/open_api_sdk/models/operations/getcustomer_partner.rb +0 -33
- data/lib/open_api_sdk/models/operations/getcustomer_request.rb +0 -27
- data/lib/open_api_sdk/models/operations/getcustomer_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/getcustomer_responsebody.rb +0 -51
- data/lib/open_api_sdk/models/operations/getcustomer_type.rb +0 -18
- data/lib/open_api_sdk/models/operations/getcustomers_partner.rb +0 -33
- data/lib/open_api_sdk/models/operations/getcustomers_request.rb +0 -30
- data/lib/open_api_sdk/models/operations/getcustomers_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/gettags_queryparam_sortby.rb +0 -18
- data/lib/open_api_sdk/models/operations/gettags_queryparam_sortorder.rb +0 -18
- data/lib/open_api_sdk/models/operations/gettags_request.rb +0 -39
- data/lib/open_api_sdk/models/operations/link.rb +0 -36
- data/lib/open_api_sdk/models/operations/linkprops.rb +0 -99
- data/lib/open_api_sdk/models/operations/links.rb +0 -48
- data/lib/open_api_sdk/models/operations/listdomains_request.rb +0 -33
- data/lib/open_api_sdk/models/operations/listevents_request.rb +0 -135
- data/lib/open_api_sdk/models/operations/listevents_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/listfolders_request.rb +0 -33
- data/lib/open_api_sdk/models/operations/listfolders_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/mode.rb +0 -18
- data/lib/open_api_sdk/models/operations/order.rb +0 -20
- data/lib/open_api_sdk/models/operations/partner.rb +0 -45
- data/lib/open_api_sdk/models/operations/queryparam_event.rb +0 -19
- data/lib/open_api_sdk/models/operations/queryparam_groupby.rb +0 -19
- data/lib/open_api_sdk/models/operations/queryparam_interval.rb +0 -25
- data/lib/open_api_sdk/models/operations/queryparam_sortby.rb +0 -17
- data/lib/open_api_sdk/models/operations/queryparam_sortorder.rb +0 -18
- data/lib/open_api_sdk/models/operations/queryparam_trigger.rb +0 -18
- data/lib/open_api_sdk/models/operations/responsebody.rb +0 -51
- data/lib/open_api_sdk/models/operations/retrievelinks_request.rb +0 -30
- data/lib/open_api_sdk/models/operations/retrievelinks_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/retrievelinks_responsebody.rb +0 -48
- data/lib/open_api_sdk/models/operations/retrievepartneranalytics_queryparam_interval.rb +0 -25
- data/lib/open_api_sdk/models/operations/retrievepartneranalytics_request.rb +0 -45
- data/lib/open_api_sdk/models/operations/retrievepartneranalytics_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/sale.rb +0 -36
- data/lib/open_api_sdk/models/operations/sortby.rb +0 -20
- data/lib/open_api_sdk/models/operations/sortorder.rb +0 -18
- data/lib/open_api_sdk/models/operations/status.rb +0 -22
- data/lib/open_api_sdk/models/operations/tracksale_customer.rb +0 -36
- data/lib/open_api_sdk/models/operations/trigger.rb +0 -18
- data/lib/open_api_sdk/models/operations/type.rb +0 -18
- data/lib/open_api_sdk/models/operations/updatecustomer_discount.rb +0 -45
- data/lib/open_api_sdk/models/operations/updatecustomer_link.rb +0 -36
- data/lib/open_api_sdk/models/operations/updatecustomer_partner.rb +0 -33
- data/lib/open_api_sdk/models/operations/updatecustomer_request.rb +0 -30
- data/lib/open_api_sdk/models/operations/updatecustomer_requestbody.rb +0 -33
- data/lib/open_api_sdk/models/operations/updatecustomer_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/updatecustomer_responsebody.rb +0 -51
- data/lib/open_api_sdk/models/operations/updatecustomer_type.rb +0 -18
- data/lib/open_api_sdk/models/operations/updatefolder_accesslevel.rb +0 -18
- data/lib/open_api_sdk/models/operations/updatefolder_request.rb +0 -27
- data/lib/open_api_sdk/models/operations/updatefolder_requestbody.rb +0 -27
- data/lib/open_api_sdk/models/operations/updatefolder_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/updatepartnersale_requestbody.rb +0 -36
- data/lib/open_api_sdk/models/operations/updatepartnersale_response.rb +0 -60
- data/lib/open_api_sdk/models/operations/updatepartnersale_responsebody.rb +0 -45
- data/lib/open_api_sdk/models/operations/updatepartnersale_status.rb +0 -23
- data/lib/open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb +0 -99
- data/lib/open_api_sdk/models/operations/upsertpartnerlink_requestbody.rb +0 -42
- data/lib/open_api_sdk/models/operations/upsertpartnerlink_response.rb +0 -60
- data/lib/open_api_sdk/models/shared/accesslevel.rb +0 -18
- data/lib/open_api_sdk/models/shared/click.rb +0 -63
- data/lib/open_api_sdk/models/shared/clickevent.rb +0 -98
- data/lib/open_api_sdk/models/shared/clickevent_geo.rb +0 -771
- data/lib/open_api_sdk/models/shared/continentcode.rb +0 -23
- data/lib/open_api_sdk/models/shared/event.rb +0 -17
- data/lib/open_api_sdk/models/shared/folderschema.rb +0 -42
- data/lib/open_api_sdk/models/shared/link.rb +0 -163
- data/lib/open_api_sdk/models/shared/registereddomain.rb +0 -30
- data/lib/open_api_sdk/models/shared/type.rb +0 -18
- data/lib/open_api_sdk/partners.rb +0 -840
- data/lib/open_api_sdk/sdk_hooks/hooks.rb +0 -103
- data/lib/open_api_sdk/sdk_hooks/registration.rb +0 -35
- data/lib/open_api_sdk/sdk_hooks/types.rb +0 -152
- data/lib/open_api_sdk/utils/retries.rb +0 -95
@@ -1,840 +0,0 @@
|
|
1
|
-
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
-
|
3
|
-
# typed: true
|
4
|
-
# frozen_string_literal: true
|
5
|
-
|
6
|
-
require 'faraday'
|
7
|
-
require 'faraday/multipart'
|
8
|
-
require 'faraday/retry'
|
9
|
-
require 'sorbet-runtime'
|
10
|
-
require_relative 'sdk_hooks/hooks'
|
11
|
-
require_relative 'utils/retries'
|
12
|
-
|
13
|
-
module OpenApiSDK
|
14
|
-
extend T::Sig
|
15
|
-
class Partners
|
16
|
-
extend T::Sig
|
17
|
-
|
18
|
-
|
19
|
-
sig { params(sdk_config: SDKConfiguration).void }
|
20
|
-
def initialize(sdk_config)
|
21
|
-
@sdk_configuration = sdk_config
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::CreatePartnerRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::CreatePartnerResponse) }
|
26
|
-
def create(request, timeout_ms = nil)
|
27
|
-
# create - Create a new partner
|
28
|
-
# Create a new partner for a program. If partner exists, automatically enrolls them.
|
29
|
-
url, params = @sdk_configuration.get_server_details
|
30
|
-
base_url = Utils.template_url(url, params)
|
31
|
-
url = "#{base_url}/partners"
|
32
|
-
headers = {}
|
33
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
34
|
-
headers['content-type'] = req_content_type
|
35
|
-
|
36
|
-
if form
|
37
|
-
body = Utils.encode_form(form)
|
38
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
39
|
-
body = URI.encode_www_form(data)
|
40
|
-
else
|
41
|
-
body = data
|
42
|
-
end
|
43
|
-
headers['Accept'] = 'application/json'
|
44
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
45
|
-
|
46
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
47
|
-
|
48
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
49
|
-
timeout ||= @sdk_configuration.timeout
|
50
|
-
|
51
|
-
connection = @sdk_configuration.client
|
52
|
-
|
53
|
-
hook_ctx = SDKHooks::HookContext.new(
|
54
|
-
base_url: base_url,
|
55
|
-
oauth2_scopes: nil,
|
56
|
-
operation_id: 'createPartner',
|
57
|
-
security_source: @sdk_configuration.security_source
|
58
|
-
)
|
59
|
-
|
60
|
-
error = T.let(nil, T.nilable(StandardError))
|
61
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
62
|
-
|
63
|
-
begin
|
64
|
-
r = connection.post(url) do |req|
|
65
|
-
req.body = body
|
66
|
-
req.headers.merge!(headers)
|
67
|
-
req.options.timeout = timeout unless timeout.nil?
|
68
|
-
Utils.configure_request_security(req, security)
|
69
|
-
|
70
|
-
@sdk_configuration.hooks.before_request(
|
71
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
72
|
-
hook_ctx: hook_ctx
|
73
|
-
),
|
74
|
-
request: req
|
75
|
-
)
|
76
|
-
end
|
77
|
-
rescue StandardError => e
|
78
|
-
error = e
|
79
|
-
ensure
|
80
|
-
if r.nil? || Utils.error_status?(r.status)
|
81
|
-
r = @sdk_configuration.hooks.after_error(
|
82
|
-
error: error,
|
83
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
84
|
-
hook_ctx: hook_ctx
|
85
|
-
),
|
86
|
-
response: r
|
87
|
-
)
|
88
|
-
else
|
89
|
-
r = @sdk_configuration.hooks.after_success(
|
90
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
91
|
-
hook_ctx: hook_ctx
|
92
|
-
),
|
93
|
-
response: r
|
94
|
-
)
|
95
|
-
end
|
96
|
-
|
97
|
-
if r.nil?
|
98
|
-
raise error if !error.nil?
|
99
|
-
raise 'no response'
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
104
|
-
|
105
|
-
res = ::OpenApiSDK::Operations::CreatePartnerResponse.new(
|
106
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
107
|
-
)
|
108
|
-
if r.status == 201
|
109
|
-
if Utils.match_content_type(content_type, 'application/json')
|
110
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::CreatePartnerResponseBody)
|
111
|
-
res.object = out
|
112
|
-
end
|
113
|
-
elsif r.status == 400
|
114
|
-
if Utils.match_content_type(content_type, 'application/json')
|
115
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
116
|
-
res.bad_request = out
|
117
|
-
end
|
118
|
-
elsif r.status == 401
|
119
|
-
if Utils.match_content_type(content_type, 'application/json')
|
120
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
121
|
-
res.unauthorized = out
|
122
|
-
end
|
123
|
-
elsif r.status == 403
|
124
|
-
if Utils.match_content_type(content_type, 'application/json')
|
125
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
126
|
-
res.forbidden = out
|
127
|
-
end
|
128
|
-
elsif r.status == 404
|
129
|
-
if Utils.match_content_type(content_type, 'application/json')
|
130
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
131
|
-
res.not_found = out
|
132
|
-
end
|
133
|
-
elsif r.status == 409
|
134
|
-
if Utils.match_content_type(content_type, 'application/json')
|
135
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
136
|
-
res.conflict = out
|
137
|
-
end
|
138
|
-
elsif r.status == 410
|
139
|
-
if Utils.match_content_type(content_type, 'application/json')
|
140
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
141
|
-
res.invite_expired = out
|
142
|
-
end
|
143
|
-
elsif r.status == 422
|
144
|
-
if Utils.match_content_type(content_type, 'application/json')
|
145
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
146
|
-
res.unprocessable_entity = out
|
147
|
-
end
|
148
|
-
elsif r.status == 429
|
149
|
-
if Utils.match_content_type(content_type, 'application/json')
|
150
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
151
|
-
res.rate_limit_exceeded = out
|
152
|
-
end
|
153
|
-
elsif r.status == 500
|
154
|
-
if Utils.match_content_type(content_type, 'application/json')
|
155
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
156
|
-
res.internal_server_error = out
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
res
|
161
|
-
end
|
162
|
-
|
163
|
-
|
164
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::CreatePartnerLinkResponse) }
|
165
|
-
def create_link(request, timeout_ms = nil)
|
166
|
-
# create_link - Create a link for a partner
|
167
|
-
# Create a new link for a partner that is enrolled in your program.
|
168
|
-
url, params = @sdk_configuration.get_server_details
|
169
|
-
base_url = Utils.template_url(url, params)
|
170
|
-
url = "#{base_url}/partners/links"
|
171
|
-
headers = {}
|
172
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
173
|
-
headers['content-type'] = req_content_type
|
174
|
-
|
175
|
-
if form
|
176
|
-
body = Utils.encode_form(form)
|
177
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
178
|
-
body = URI.encode_www_form(data)
|
179
|
-
else
|
180
|
-
body = data
|
181
|
-
end
|
182
|
-
headers['Accept'] = 'application/json'
|
183
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
184
|
-
|
185
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
186
|
-
|
187
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
188
|
-
timeout ||= @sdk_configuration.timeout
|
189
|
-
|
190
|
-
connection = @sdk_configuration.client
|
191
|
-
|
192
|
-
hook_ctx = SDKHooks::HookContext.new(
|
193
|
-
base_url: base_url,
|
194
|
-
oauth2_scopes: nil,
|
195
|
-
operation_id: 'createPartnerLink',
|
196
|
-
security_source: @sdk_configuration.security_source
|
197
|
-
)
|
198
|
-
|
199
|
-
error = T.let(nil, T.nilable(StandardError))
|
200
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
201
|
-
|
202
|
-
begin
|
203
|
-
r = connection.post(url) do |req|
|
204
|
-
req.body = body
|
205
|
-
req.headers.merge!(headers)
|
206
|
-
req.options.timeout = timeout unless timeout.nil?
|
207
|
-
Utils.configure_request_security(req, security)
|
208
|
-
|
209
|
-
@sdk_configuration.hooks.before_request(
|
210
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
211
|
-
hook_ctx: hook_ctx
|
212
|
-
),
|
213
|
-
request: req
|
214
|
-
)
|
215
|
-
end
|
216
|
-
rescue StandardError => e
|
217
|
-
error = e
|
218
|
-
ensure
|
219
|
-
if r.nil? || Utils.error_status?(r.status)
|
220
|
-
r = @sdk_configuration.hooks.after_error(
|
221
|
-
error: error,
|
222
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
223
|
-
hook_ctx: hook_ctx
|
224
|
-
),
|
225
|
-
response: r
|
226
|
-
)
|
227
|
-
else
|
228
|
-
r = @sdk_configuration.hooks.after_success(
|
229
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
230
|
-
hook_ctx: hook_ctx
|
231
|
-
),
|
232
|
-
response: r
|
233
|
-
)
|
234
|
-
end
|
235
|
-
|
236
|
-
if r.nil?
|
237
|
-
raise error if !error.nil?
|
238
|
-
raise 'no response'
|
239
|
-
end
|
240
|
-
end
|
241
|
-
|
242
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
243
|
-
|
244
|
-
res = ::OpenApiSDK::Operations::CreatePartnerLinkResponse.new(
|
245
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
246
|
-
)
|
247
|
-
if r.status == 201
|
248
|
-
if Utils.match_content_type(content_type, 'application/json')
|
249
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::LinkSchema)
|
250
|
-
res.link_schema = out
|
251
|
-
end
|
252
|
-
elsif r.status == 400
|
253
|
-
if Utils.match_content_type(content_type, 'application/json')
|
254
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
255
|
-
res.bad_request = out
|
256
|
-
end
|
257
|
-
elsif r.status == 401
|
258
|
-
if Utils.match_content_type(content_type, 'application/json')
|
259
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
260
|
-
res.unauthorized = out
|
261
|
-
end
|
262
|
-
elsif r.status == 403
|
263
|
-
if Utils.match_content_type(content_type, 'application/json')
|
264
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
265
|
-
res.forbidden = out
|
266
|
-
end
|
267
|
-
elsif r.status == 404
|
268
|
-
if Utils.match_content_type(content_type, 'application/json')
|
269
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
270
|
-
res.not_found = out
|
271
|
-
end
|
272
|
-
elsif r.status == 409
|
273
|
-
if Utils.match_content_type(content_type, 'application/json')
|
274
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
275
|
-
res.conflict = out
|
276
|
-
end
|
277
|
-
elsif r.status == 410
|
278
|
-
if Utils.match_content_type(content_type, 'application/json')
|
279
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
280
|
-
res.invite_expired = out
|
281
|
-
end
|
282
|
-
elsif r.status == 422
|
283
|
-
if Utils.match_content_type(content_type, 'application/json')
|
284
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
285
|
-
res.unprocessable_entity = out
|
286
|
-
end
|
287
|
-
elsif r.status == 429
|
288
|
-
if Utils.match_content_type(content_type, 'application/json')
|
289
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
290
|
-
res.rate_limit_exceeded = out
|
291
|
-
end
|
292
|
-
elsif r.status == 500
|
293
|
-
if Utils.match_content_type(content_type, 'application/json')
|
294
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
295
|
-
res.internal_server_error = out
|
296
|
-
end
|
297
|
-
end
|
298
|
-
|
299
|
-
res
|
300
|
-
end
|
301
|
-
|
302
|
-
|
303
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::RetrieveLinksRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::RetrieveLinksResponse) }
|
304
|
-
def retrieve_links(request, timeout_ms = nil)
|
305
|
-
# retrieve_links - Retrieve a partner's links.
|
306
|
-
# Retrieve a partner's links by their partner ID or tenant ID.
|
307
|
-
url, params = @sdk_configuration.get_server_details
|
308
|
-
base_url = Utils.template_url(url, params)
|
309
|
-
url = "#{base_url}/partners/links"
|
310
|
-
headers = {}
|
311
|
-
query_params = Utils.get_query_params(::OpenApiSDK::Operations::RetrieveLinksRequest, request)
|
312
|
-
headers['Accept'] = 'application/json'
|
313
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
314
|
-
|
315
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
316
|
-
|
317
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
318
|
-
timeout ||= @sdk_configuration.timeout
|
319
|
-
|
320
|
-
connection = @sdk_configuration.client
|
321
|
-
|
322
|
-
hook_ctx = SDKHooks::HookContext.new(
|
323
|
-
base_url: base_url,
|
324
|
-
oauth2_scopes: nil,
|
325
|
-
operation_id: 'retrieveLinks',
|
326
|
-
security_source: @sdk_configuration.security_source
|
327
|
-
)
|
328
|
-
|
329
|
-
error = T.let(nil, T.nilable(StandardError))
|
330
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
331
|
-
|
332
|
-
begin
|
333
|
-
r = connection.get(url) do |req|
|
334
|
-
req.headers.merge!(headers)
|
335
|
-
req.options.timeout = timeout unless timeout.nil?
|
336
|
-
req.params = query_params
|
337
|
-
Utils.configure_request_security(req, security)
|
338
|
-
|
339
|
-
@sdk_configuration.hooks.before_request(
|
340
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
341
|
-
hook_ctx: hook_ctx
|
342
|
-
),
|
343
|
-
request: req
|
344
|
-
)
|
345
|
-
end
|
346
|
-
rescue StandardError => e
|
347
|
-
error = e
|
348
|
-
ensure
|
349
|
-
if r.nil? || Utils.error_status?(r.status)
|
350
|
-
r = @sdk_configuration.hooks.after_error(
|
351
|
-
error: error,
|
352
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
353
|
-
hook_ctx: hook_ctx
|
354
|
-
),
|
355
|
-
response: r
|
356
|
-
)
|
357
|
-
else
|
358
|
-
r = @sdk_configuration.hooks.after_success(
|
359
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
360
|
-
hook_ctx: hook_ctx
|
361
|
-
),
|
362
|
-
response: r
|
363
|
-
)
|
364
|
-
end
|
365
|
-
|
366
|
-
if r.nil?
|
367
|
-
raise error if !error.nil?
|
368
|
-
raise 'no response'
|
369
|
-
end
|
370
|
-
end
|
371
|
-
|
372
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
373
|
-
|
374
|
-
res = ::OpenApiSDK::Operations::RetrieveLinksResponse.new(
|
375
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
376
|
-
)
|
377
|
-
if r.status == 200
|
378
|
-
if Utils.match_content_type(content_type, 'application/json')
|
379
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), T::Array[::OpenApiSDK::Operations::RetrieveLinksResponseBody])
|
380
|
-
res.response_bodies = out
|
381
|
-
end
|
382
|
-
elsif r.status == 400
|
383
|
-
if Utils.match_content_type(content_type, 'application/json')
|
384
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
385
|
-
res.bad_request = out
|
386
|
-
end
|
387
|
-
elsif r.status == 401
|
388
|
-
if Utils.match_content_type(content_type, 'application/json')
|
389
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
390
|
-
res.unauthorized = out
|
391
|
-
end
|
392
|
-
elsif r.status == 403
|
393
|
-
if Utils.match_content_type(content_type, 'application/json')
|
394
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
395
|
-
res.forbidden = out
|
396
|
-
end
|
397
|
-
elsif r.status == 404
|
398
|
-
if Utils.match_content_type(content_type, 'application/json')
|
399
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
400
|
-
res.not_found = out
|
401
|
-
end
|
402
|
-
elsif r.status == 409
|
403
|
-
if Utils.match_content_type(content_type, 'application/json')
|
404
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
405
|
-
res.conflict = out
|
406
|
-
end
|
407
|
-
elsif r.status == 410
|
408
|
-
if Utils.match_content_type(content_type, 'application/json')
|
409
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
410
|
-
res.invite_expired = out
|
411
|
-
end
|
412
|
-
elsif r.status == 422
|
413
|
-
if Utils.match_content_type(content_type, 'application/json')
|
414
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
415
|
-
res.unprocessable_entity = out
|
416
|
-
end
|
417
|
-
elsif r.status == 429
|
418
|
-
if Utils.match_content_type(content_type, 'application/json')
|
419
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
420
|
-
res.rate_limit_exceeded = out
|
421
|
-
end
|
422
|
-
elsif r.status == 500
|
423
|
-
if Utils.match_content_type(content_type, 'application/json')
|
424
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
425
|
-
res.internal_server_error = out
|
426
|
-
end
|
427
|
-
end
|
428
|
-
|
429
|
-
res
|
430
|
-
end
|
431
|
-
|
432
|
-
|
433
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::UpsertPartnerLinkRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::UpsertPartnerLinkResponse) }
|
434
|
-
def upsert_link(request, timeout_ms = nil)
|
435
|
-
# upsert_link - Upsert a link for a partner
|
436
|
-
# Upsert a link for a partner that is enrolled in your program. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.
|
437
|
-
url, params = @sdk_configuration.get_server_details
|
438
|
-
base_url = Utils.template_url(url, params)
|
439
|
-
url = "#{base_url}/partners/links/upsert"
|
440
|
-
headers = {}
|
441
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
442
|
-
headers['content-type'] = req_content_type
|
443
|
-
|
444
|
-
if form
|
445
|
-
body = Utils.encode_form(form)
|
446
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
447
|
-
body = URI.encode_www_form(data)
|
448
|
-
else
|
449
|
-
body = data
|
450
|
-
end
|
451
|
-
headers['Accept'] = 'application/json'
|
452
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
453
|
-
|
454
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
455
|
-
|
456
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
457
|
-
timeout ||= @sdk_configuration.timeout
|
458
|
-
|
459
|
-
connection = @sdk_configuration.client
|
460
|
-
|
461
|
-
hook_ctx = SDKHooks::HookContext.new(
|
462
|
-
base_url: base_url,
|
463
|
-
oauth2_scopes: nil,
|
464
|
-
operation_id: 'upsertPartnerLink',
|
465
|
-
security_source: @sdk_configuration.security_source
|
466
|
-
)
|
467
|
-
|
468
|
-
error = T.let(nil, T.nilable(StandardError))
|
469
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
470
|
-
|
471
|
-
begin
|
472
|
-
r = connection.put(url) do |req|
|
473
|
-
req.body = body
|
474
|
-
req.headers.merge!(headers)
|
475
|
-
req.options.timeout = timeout unless timeout.nil?
|
476
|
-
Utils.configure_request_security(req, security)
|
477
|
-
|
478
|
-
@sdk_configuration.hooks.before_request(
|
479
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
480
|
-
hook_ctx: hook_ctx
|
481
|
-
),
|
482
|
-
request: req
|
483
|
-
)
|
484
|
-
end
|
485
|
-
rescue StandardError => e
|
486
|
-
error = e
|
487
|
-
ensure
|
488
|
-
if r.nil? || Utils.error_status?(r.status)
|
489
|
-
r = @sdk_configuration.hooks.after_error(
|
490
|
-
error: error,
|
491
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
492
|
-
hook_ctx: hook_ctx
|
493
|
-
),
|
494
|
-
response: r
|
495
|
-
)
|
496
|
-
else
|
497
|
-
r = @sdk_configuration.hooks.after_success(
|
498
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
499
|
-
hook_ctx: hook_ctx
|
500
|
-
),
|
501
|
-
response: r
|
502
|
-
)
|
503
|
-
end
|
504
|
-
|
505
|
-
if r.nil?
|
506
|
-
raise error if !error.nil?
|
507
|
-
raise 'no response'
|
508
|
-
end
|
509
|
-
end
|
510
|
-
|
511
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
512
|
-
|
513
|
-
res = ::OpenApiSDK::Operations::UpsertPartnerLinkResponse.new(
|
514
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
515
|
-
)
|
516
|
-
if r.status == 200
|
517
|
-
if Utils.match_content_type(content_type, 'application/json')
|
518
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::LinkSchema)
|
519
|
-
res.link_schema = out
|
520
|
-
end
|
521
|
-
elsif r.status == 400
|
522
|
-
if Utils.match_content_type(content_type, 'application/json')
|
523
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
524
|
-
res.bad_request = out
|
525
|
-
end
|
526
|
-
elsif r.status == 401
|
527
|
-
if Utils.match_content_type(content_type, 'application/json')
|
528
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
529
|
-
res.unauthorized = out
|
530
|
-
end
|
531
|
-
elsif r.status == 403
|
532
|
-
if Utils.match_content_type(content_type, 'application/json')
|
533
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
534
|
-
res.forbidden = out
|
535
|
-
end
|
536
|
-
elsif r.status == 404
|
537
|
-
if Utils.match_content_type(content_type, 'application/json')
|
538
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
539
|
-
res.not_found = out
|
540
|
-
end
|
541
|
-
elsif r.status == 409
|
542
|
-
if Utils.match_content_type(content_type, 'application/json')
|
543
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
544
|
-
res.conflict = out
|
545
|
-
end
|
546
|
-
elsif r.status == 410
|
547
|
-
if Utils.match_content_type(content_type, 'application/json')
|
548
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
549
|
-
res.invite_expired = out
|
550
|
-
end
|
551
|
-
elsif r.status == 422
|
552
|
-
if Utils.match_content_type(content_type, 'application/json')
|
553
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
554
|
-
res.unprocessable_entity = out
|
555
|
-
end
|
556
|
-
elsif r.status == 429
|
557
|
-
if Utils.match_content_type(content_type, 'application/json')
|
558
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
559
|
-
res.rate_limit_exceeded = out
|
560
|
-
end
|
561
|
-
elsif r.status == 500
|
562
|
-
if Utils.match_content_type(content_type, 'application/json')
|
563
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
564
|
-
res.internal_server_error = out
|
565
|
-
end
|
566
|
-
end
|
567
|
-
|
568
|
-
res
|
569
|
-
end
|
570
|
-
|
571
|
-
|
572
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::RetrievePartnerAnalyticsRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::RetrievePartnerAnalyticsResponse) }
|
573
|
-
def analytics(request, timeout_ms = nil)
|
574
|
-
# analytics - Retrieve analytics for a partner
|
575
|
-
# Retrieve analytics for a partner within a program. The response type vary based on the `groupBy` query parameter.
|
576
|
-
url, params = @sdk_configuration.get_server_details
|
577
|
-
base_url = Utils.template_url(url, params)
|
578
|
-
url = "#{base_url}/partners/analytics"
|
579
|
-
headers = {}
|
580
|
-
query_params = Utils.get_query_params(::OpenApiSDK::Operations::RetrievePartnerAnalyticsRequest, request)
|
581
|
-
headers['Accept'] = 'application/json'
|
582
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
583
|
-
|
584
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
585
|
-
|
586
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
587
|
-
timeout ||= @sdk_configuration.timeout
|
588
|
-
|
589
|
-
connection = @sdk_configuration.client
|
590
|
-
|
591
|
-
hook_ctx = SDKHooks::HookContext.new(
|
592
|
-
base_url: base_url,
|
593
|
-
oauth2_scopes: nil,
|
594
|
-
operation_id: 'retrievePartnerAnalytics',
|
595
|
-
security_source: @sdk_configuration.security_source
|
596
|
-
)
|
597
|
-
|
598
|
-
error = T.let(nil, T.nilable(StandardError))
|
599
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
600
|
-
|
601
|
-
begin
|
602
|
-
r = connection.get(url) do |req|
|
603
|
-
req.headers.merge!(headers)
|
604
|
-
req.options.timeout = timeout unless timeout.nil?
|
605
|
-
req.params = query_params
|
606
|
-
Utils.configure_request_security(req, security)
|
607
|
-
|
608
|
-
@sdk_configuration.hooks.before_request(
|
609
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
610
|
-
hook_ctx: hook_ctx
|
611
|
-
),
|
612
|
-
request: req
|
613
|
-
)
|
614
|
-
end
|
615
|
-
rescue StandardError => e
|
616
|
-
error = e
|
617
|
-
ensure
|
618
|
-
if r.nil? || Utils.error_status?(r.status)
|
619
|
-
r = @sdk_configuration.hooks.after_error(
|
620
|
-
error: error,
|
621
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
622
|
-
hook_ctx: hook_ctx
|
623
|
-
),
|
624
|
-
response: r
|
625
|
-
)
|
626
|
-
else
|
627
|
-
r = @sdk_configuration.hooks.after_success(
|
628
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
629
|
-
hook_ctx: hook_ctx
|
630
|
-
),
|
631
|
-
response: r
|
632
|
-
)
|
633
|
-
end
|
634
|
-
|
635
|
-
if r.nil?
|
636
|
-
raise error if !error.nil?
|
637
|
-
raise 'no response'
|
638
|
-
end
|
639
|
-
end
|
640
|
-
|
641
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
642
|
-
|
643
|
-
res = ::OpenApiSDK::Operations::RetrievePartnerAnalyticsResponse.new(
|
644
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
645
|
-
)
|
646
|
-
if r.status == 200
|
647
|
-
if Utils.match_content_type(content_type, 'application/json')
|
648
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::Object)
|
649
|
-
res.one_of = out
|
650
|
-
end
|
651
|
-
elsif r.status == 400
|
652
|
-
if Utils.match_content_type(content_type, 'application/json')
|
653
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
654
|
-
res.bad_request = out
|
655
|
-
end
|
656
|
-
elsif r.status == 401
|
657
|
-
if Utils.match_content_type(content_type, 'application/json')
|
658
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
659
|
-
res.unauthorized = out
|
660
|
-
end
|
661
|
-
elsif r.status == 403
|
662
|
-
if Utils.match_content_type(content_type, 'application/json')
|
663
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
664
|
-
res.forbidden = out
|
665
|
-
end
|
666
|
-
elsif r.status == 404
|
667
|
-
if Utils.match_content_type(content_type, 'application/json')
|
668
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
669
|
-
res.not_found = out
|
670
|
-
end
|
671
|
-
elsif r.status == 409
|
672
|
-
if Utils.match_content_type(content_type, 'application/json')
|
673
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
674
|
-
res.conflict = out
|
675
|
-
end
|
676
|
-
elsif r.status == 410
|
677
|
-
if Utils.match_content_type(content_type, 'application/json')
|
678
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
679
|
-
res.invite_expired = out
|
680
|
-
end
|
681
|
-
elsif r.status == 422
|
682
|
-
if Utils.match_content_type(content_type, 'application/json')
|
683
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
684
|
-
res.unprocessable_entity = out
|
685
|
-
end
|
686
|
-
elsif r.status == 429
|
687
|
-
if Utils.match_content_type(content_type, 'application/json')
|
688
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
689
|
-
res.rate_limit_exceeded = out
|
690
|
-
end
|
691
|
-
elsif r.status == 500
|
692
|
-
if Utils.match_content_type(content_type, 'application/json')
|
693
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
694
|
-
res.internal_server_error = out
|
695
|
-
end
|
696
|
-
end
|
697
|
-
|
698
|
-
res
|
699
|
-
end
|
700
|
-
|
701
|
-
|
702
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::UpdatePartnerSaleRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::UpdatePartnerSaleResponse) }
|
703
|
-
def update_sale(request, timeout_ms = nil)
|
704
|
-
# update_sale - Update a sale for a partner.
|
705
|
-
# Update an existing sale amount. This is useful for handling refunds (partial or full) or fraudulent sales.
|
706
|
-
url, params = @sdk_configuration.get_server_details
|
707
|
-
base_url = Utils.template_url(url, params)
|
708
|
-
url = "#{base_url}/partners/sales"
|
709
|
-
headers = {}
|
710
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
711
|
-
headers['content-type'] = req_content_type
|
712
|
-
|
713
|
-
if form
|
714
|
-
body = Utils.encode_form(form)
|
715
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
716
|
-
body = URI.encode_www_form(data)
|
717
|
-
else
|
718
|
-
body = data
|
719
|
-
end
|
720
|
-
headers['Accept'] = 'application/json'
|
721
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
722
|
-
|
723
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
724
|
-
|
725
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
726
|
-
timeout ||= @sdk_configuration.timeout
|
727
|
-
|
728
|
-
connection = @sdk_configuration.client
|
729
|
-
|
730
|
-
hook_ctx = SDKHooks::HookContext.new(
|
731
|
-
base_url: base_url,
|
732
|
-
oauth2_scopes: nil,
|
733
|
-
operation_id: 'updatePartnerSale',
|
734
|
-
security_source: @sdk_configuration.security_source
|
735
|
-
)
|
736
|
-
|
737
|
-
error = T.let(nil, T.nilable(StandardError))
|
738
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
739
|
-
|
740
|
-
begin
|
741
|
-
r = connection.patch(url) do |req|
|
742
|
-
req.body = body
|
743
|
-
req.headers.merge!(headers)
|
744
|
-
req.options.timeout = timeout unless timeout.nil?
|
745
|
-
Utils.configure_request_security(req, security)
|
746
|
-
|
747
|
-
@sdk_configuration.hooks.before_request(
|
748
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
749
|
-
hook_ctx: hook_ctx
|
750
|
-
),
|
751
|
-
request: req
|
752
|
-
)
|
753
|
-
end
|
754
|
-
rescue StandardError => e
|
755
|
-
error = e
|
756
|
-
ensure
|
757
|
-
if r.nil? || Utils.error_status?(r.status)
|
758
|
-
r = @sdk_configuration.hooks.after_error(
|
759
|
-
error: error,
|
760
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
761
|
-
hook_ctx: hook_ctx
|
762
|
-
),
|
763
|
-
response: r
|
764
|
-
)
|
765
|
-
else
|
766
|
-
r = @sdk_configuration.hooks.after_success(
|
767
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
768
|
-
hook_ctx: hook_ctx
|
769
|
-
),
|
770
|
-
response: r
|
771
|
-
)
|
772
|
-
end
|
773
|
-
|
774
|
-
if r.nil?
|
775
|
-
raise error if !error.nil?
|
776
|
-
raise 'no response'
|
777
|
-
end
|
778
|
-
end
|
779
|
-
|
780
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
781
|
-
|
782
|
-
res = ::OpenApiSDK::Operations::UpdatePartnerSaleResponse.new(
|
783
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
784
|
-
)
|
785
|
-
if r.status == 200
|
786
|
-
if Utils.match_content_type(content_type, 'application/json')
|
787
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::UpdatePartnerSaleResponseBody)
|
788
|
-
res.object = out
|
789
|
-
end
|
790
|
-
elsif r.status == 400
|
791
|
-
if Utils.match_content_type(content_type, 'application/json')
|
792
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
793
|
-
res.bad_request = out
|
794
|
-
end
|
795
|
-
elsif r.status == 401
|
796
|
-
if Utils.match_content_type(content_type, 'application/json')
|
797
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
798
|
-
res.unauthorized = out
|
799
|
-
end
|
800
|
-
elsif r.status == 403
|
801
|
-
if Utils.match_content_type(content_type, 'application/json')
|
802
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
803
|
-
res.forbidden = out
|
804
|
-
end
|
805
|
-
elsif r.status == 404
|
806
|
-
if Utils.match_content_type(content_type, 'application/json')
|
807
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
808
|
-
res.not_found = out
|
809
|
-
end
|
810
|
-
elsif r.status == 409
|
811
|
-
if Utils.match_content_type(content_type, 'application/json')
|
812
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
813
|
-
res.conflict = out
|
814
|
-
end
|
815
|
-
elsif r.status == 410
|
816
|
-
if Utils.match_content_type(content_type, 'application/json')
|
817
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
818
|
-
res.invite_expired = out
|
819
|
-
end
|
820
|
-
elsif r.status == 422
|
821
|
-
if Utils.match_content_type(content_type, 'application/json')
|
822
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
823
|
-
res.unprocessable_entity = out
|
824
|
-
end
|
825
|
-
elsif r.status == 429
|
826
|
-
if Utils.match_content_type(content_type, 'application/json')
|
827
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
828
|
-
res.rate_limit_exceeded = out
|
829
|
-
end
|
830
|
-
elsif r.status == 500
|
831
|
-
if Utils.match_content_type(content_type, 'application/json')
|
832
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
833
|
-
res.internal_server_error = out
|
834
|
-
end
|
835
|
-
end
|
836
|
-
|
837
|
-
res
|
838
|
-
end
|
839
|
-
end
|
840
|
-
end
|