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,709 +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 Customers
|
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::GetCustomersRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::GetCustomersResponse) }
|
26
|
-
def list(request, timeout_ms = nil)
|
27
|
-
# list - Retrieve a list of customers
|
28
|
-
# Retrieve a list of customers for the authenticated workspace.
|
29
|
-
url, params = @sdk_configuration.get_server_details
|
30
|
-
base_url = Utils.template_url(url, params)
|
31
|
-
url = "#{base_url}/customers"
|
32
|
-
headers = {}
|
33
|
-
query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetCustomersRequest, request)
|
34
|
-
headers['Accept'] = 'application/json'
|
35
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
36
|
-
|
37
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
38
|
-
|
39
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
40
|
-
timeout ||= @sdk_configuration.timeout
|
41
|
-
|
42
|
-
connection = @sdk_configuration.client
|
43
|
-
|
44
|
-
hook_ctx = SDKHooks::HookContext.new(
|
45
|
-
base_url: base_url,
|
46
|
-
oauth2_scopes: nil,
|
47
|
-
operation_id: 'getCustomers',
|
48
|
-
security_source: @sdk_configuration.security_source
|
49
|
-
)
|
50
|
-
|
51
|
-
error = T.let(nil, T.nilable(StandardError))
|
52
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
53
|
-
|
54
|
-
begin
|
55
|
-
r = connection.get(url) do |req|
|
56
|
-
req.headers.merge!(headers)
|
57
|
-
req.options.timeout = timeout unless timeout.nil?
|
58
|
-
req.params = query_params
|
59
|
-
Utils.configure_request_security(req, security)
|
60
|
-
|
61
|
-
@sdk_configuration.hooks.before_request(
|
62
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
63
|
-
hook_ctx: hook_ctx
|
64
|
-
),
|
65
|
-
request: req
|
66
|
-
)
|
67
|
-
end
|
68
|
-
rescue StandardError => e
|
69
|
-
error = e
|
70
|
-
ensure
|
71
|
-
if r.nil? || Utils.error_status?(r.status)
|
72
|
-
r = @sdk_configuration.hooks.after_error(
|
73
|
-
error: error,
|
74
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
75
|
-
hook_ctx: hook_ctx
|
76
|
-
),
|
77
|
-
response: r
|
78
|
-
)
|
79
|
-
else
|
80
|
-
r = @sdk_configuration.hooks.after_success(
|
81
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
82
|
-
hook_ctx: hook_ctx
|
83
|
-
),
|
84
|
-
response: r
|
85
|
-
)
|
86
|
-
end
|
87
|
-
|
88
|
-
if r.nil?
|
89
|
-
raise error if !error.nil?
|
90
|
-
raise 'no response'
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
95
|
-
|
96
|
-
res = ::OpenApiSDK::Operations::GetCustomersResponse.new(
|
97
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
98
|
-
)
|
99
|
-
if r.status == 200
|
100
|
-
if Utils.match_content_type(content_type, 'application/json')
|
101
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), T::Array[::OpenApiSDK::Operations::ResponseBody])
|
102
|
-
res.response_bodies = out
|
103
|
-
end
|
104
|
-
elsif r.status == 400
|
105
|
-
if Utils.match_content_type(content_type, 'application/json')
|
106
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
107
|
-
res.bad_request = out
|
108
|
-
end
|
109
|
-
elsif r.status == 401
|
110
|
-
if Utils.match_content_type(content_type, 'application/json')
|
111
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
112
|
-
res.unauthorized = out
|
113
|
-
end
|
114
|
-
elsif r.status == 403
|
115
|
-
if Utils.match_content_type(content_type, 'application/json')
|
116
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
117
|
-
res.forbidden = out
|
118
|
-
end
|
119
|
-
elsif r.status == 404
|
120
|
-
if Utils.match_content_type(content_type, 'application/json')
|
121
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
122
|
-
res.not_found = out
|
123
|
-
end
|
124
|
-
elsif r.status == 409
|
125
|
-
if Utils.match_content_type(content_type, 'application/json')
|
126
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
127
|
-
res.conflict = out
|
128
|
-
end
|
129
|
-
elsif r.status == 410
|
130
|
-
if Utils.match_content_type(content_type, 'application/json')
|
131
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
132
|
-
res.invite_expired = out
|
133
|
-
end
|
134
|
-
elsif r.status == 422
|
135
|
-
if Utils.match_content_type(content_type, 'application/json')
|
136
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
137
|
-
res.unprocessable_entity = out
|
138
|
-
end
|
139
|
-
elsif r.status == 429
|
140
|
-
if Utils.match_content_type(content_type, 'application/json')
|
141
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
142
|
-
res.rate_limit_exceeded = out
|
143
|
-
end
|
144
|
-
elsif r.status == 500
|
145
|
-
if Utils.match_content_type(content_type, 'application/json')
|
146
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
147
|
-
res.internal_server_error = out
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
res
|
152
|
-
end
|
153
|
-
|
154
|
-
|
155
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::CreateCustomerRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::CreateCustomerResponse) }
|
156
|
-
def create(request, timeout_ms = nil)
|
157
|
-
# create - Create a customer
|
158
|
-
# [Deprecated]: Customer creation can only be done via tracking a lead event. Use the /track/lead endpoint instead.
|
159
|
-
#
|
160
|
-
# @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
|
161
|
-
url, params = @sdk_configuration.get_server_details
|
162
|
-
base_url = Utils.template_url(url, params)
|
163
|
-
url = "#{base_url}/customers"
|
164
|
-
headers = {}
|
165
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
|
166
|
-
headers['content-type'] = req_content_type
|
167
|
-
|
168
|
-
if form
|
169
|
-
body = Utils.encode_form(form)
|
170
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
171
|
-
body = URI.encode_www_form(data)
|
172
|
-
else
|
173
|
-
body = data
|
174
|
-
end
|
175
|
-
headers['Accept'] = 'application/json'
|
176
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
177
|
-
|
178
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
179
|
-
|
180
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
181
|
-
timeout ||= @sdk_configuration.timeout
|
182
|
-
|
183
|
-
connection = @sdk_configuration.client
|
184
|
-
|
185
|
-
hook_ctx = SDKHooks::HookContext.new(
|
186
|
-
base_url: base_url,
|
187
|
-
oauth2_scopes: nil,
|
188
|
-
operation_id: 'createCustomer',
|
189
|
-
security_source: @sdk_configuration.security_source
|
190
|
-
)
|
191
|
-
|
192
|
-
error = T.let(nil, T.nilable(StandardError))
|
193
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
194
|
-
|
195
|
-
begin
|
196
|
-
r = connection.post(url) do |req|
|
197
|
-
req.body = body
|
198
|
-
req.headers.merge!(headers)
|
199
|
-
req.options.timeout = timeout unless timeout.nil?
|
200
|
-
Utils.configure_request_security(req, security)
|
201
|
-
|
202
|
-
@sdk_configuration.hooks.before_request(
|
203
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
204
|
-
hook_ctx: hook_ctx
|
205
|
-
),
|
206
|
-
request: req
|
207
|
-
)
|
208
|
-
end
|
209
|
-
rescue StandardError => e
|
210
|
-
error = e
|
211
|
-
ensure
|
212
|
-
if r.nil? || Utils.error_status?(r.status)
|
213
|
-
r = @sdk_configuration.hooks.after_error(
|
214
|
-
error: error,
|
215
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
216
|
-
hook_ctx: hook_ctx
|
217
|
-
),
|
218
|
-
response: r
|
219
|
-
)
|
220
|
-
else
|
221
|
-
r = @sdk_configuration.hooks.after_success(
|
222
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
223
|
-
hook_ctx: hook_ctx
|
224
|
-
),
|
225
|
-
response: r
|
226
|
-
)
|
227
|
-
end
|
228
|
-
|
229
|
-
if r.nil?
|
230
|
-
raise error if !error.nil?
|
231
|
-
raise 'no response'
|
232
|
-
end
|
233
|
-
end
|
234
|
-
|
235
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
236
|
-
|
237
|
-
res = ::OpenApiSDK::Operations::CreateCustomerResponse.new(
|
238
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
239
|
-
)
|
240
|
-
if r.status == 201
|
241
|
-
if Utils.match_content_type(content_type, 'application/json')
|
242
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::CreateCustomerResponseBody)
|
243
|
-
res.object = out
|
244
|
-
end
|
245
|
-
elsif r.status == 400
|
246
|
-
if Utils.match_content_type(content_type, 'application/json')
|
247
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
248
|
-
res.bad_request = out
|
249
|
-
end
|
250
|
-
elsif r.status == 401
|
251
|
-
if Utils.match_content_type(content_type, 'application/json')
|
252
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
253
|
-
res.unauthorized = out
|
254
|
-
end
|
255
|
-
elsif r.status == 403
|
256
|
-
if Utils.match_content_type(content_type, 'application/json')
|
257
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
258
|
-
res.forbidden = out
|
259
|
-
end
|
260
|
-
elsif r.status == 404
|
261
|
-
if Utils.match_content_type(content_type, 'application/json')
|
262
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
263
|
-
res.not_found = out
|
264
|
-
end
|
265
|
-
elsif r.status == 409
|
266
|
-
if Utils.match_content_type(content_type, 'application/json')
|
267
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
268
|
-
res.conflict = out
|
269
|
-
end
|
270
|
-
elsif r.status == 410
|
271
|
-
if Utils.match_content_type(content_type, 'application/json')
|
272
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
273
|
-
res.invite_expired = out
|
274
|
-
end
|
275
|
-
elsif r.status == 422
|
276
|
-
if Utils.match_content_type(content_type, 'application/json')
|
277
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
278
|
-
res.unprocessable_entity = out
|
279
|
-
end
|
280
|
-
elsif r.status == 429
|
281
|
-
if Utils.match_content_type(content_type, 'application/json')
|
282
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
283
|
-
res.rate_limit_exceeded = out
|
284
|
-
end
|
285
|
-
elsif r.status == 500
|
286
|
-
if Utils.match_content_type(content_type, 'application/json')
|
287
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
288
|
-
res.internal_server_error = out
|
289
|
-
end
|
290
|
-
end
|
291
|
-
|
292
|
-
res
|
293
|
-
end
|
294
|
-
|
295
|
-
|
296
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::GetCustomerRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::GetCustomerResponse) }
|
297
|
-
def get(request, timeout_ms = nil)
|
298
|
-
# get - Retrieve a customer
|
299
|
-
# Retrieve a customer by ID for the authenticated workspace.
|
300
|
-
url, params = @sdk_configuration.get_server_details
|
301
|
-
base_url = Utils.template_url(url, params)
|
302
|
-
url = Utils.generate_url(
|
303
|
-
::OpenApiSDK::Operations::GetCustomerRequest,
|
304
|
-
base_url,
|
305
|
-
'/customers/{id}',
|
306
|
-
request
|
307
|
-
)
|
308
|
-
headers = {}
|
309
|
-
query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetCustomerRequest, request)
|
310
|
-
headers['Accept'] = 'application/json'
|
311
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
312
|
-
|
313
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
314
|
-
|
315
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
316
|
-
timeout ||= @sdk_configuration.timeout
|
317
|
-
|
318
|
-
connection = @sdk_configuration.client
|
319
|
-
|
320
|
-
hook_ctx = SDKHooks::HookContext.new(
|
321
|
-
base_url: base_url,
|
322
|
-
oauth2_scopes: nil,
|
323
|
-
operation_id: 'getCustomer',
|
324
|
-
security_source: @sdk_configuration.security_source
|
325
|
-
)
|
326
|
-
|
327
|
-
error = T.let(nil, T.nilable(StandardError))
|
328
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
329
|
-
|
330
|
-
begin
|
331
|
-
r = connection.get(url) do |req|
|
332
|
-
req.headers.merge!(headers)
|
333
|
-
req.options.timeout = timeout unless timeout.nil?
|
334
|
-
req.params = query_params
|
335
|
-
Utils.configure_request_security(req, security)
|
336
|
-
|
337
|
-
@sdk_configuration.hooks.before_request(
|
338
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
339
|
-
hook_ctx: hook_ctx
|
340
|
-
),
|
341
|
-
request: req
|
342
|
-
)
|
343
|
-
end
|
344
|
-
rescue StandardError => e
|
345
|
-
error = e
|
346
|
-
ensure
|
347
|
-
if r.nil? || Utils.error_status?(r.status)
|
348
|
-
r = @sdk_configuration.hooks.after_error(
|
349
|
-
error: error,
|
350
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
351
|
-
hook_ctx: hook_ctx
|
352
|
-
),
|
353
|
-
response: r
|
354
|
-
)
|
355
|
-
else
|
356
|
-
r = @sdk_configuration.hooks.after_success(
|
357
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
358
|
-
hook_ctx: hook_ctx
|
359
|
-
),
|
360
|
-
response: r
|
361
|
-
)
|
362
|
-
end
|
363
|
-
|
364
|
-
if r.nil?
|
365
|
-
raise error if !error.nil?
|
366
|
-
raise 'no response'
|
367
|
-
end
|
368
|
-
end
|
369
|
-
|
370
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
371
|
-
|
372
|
-
res = ::OpenApiSDK::Operations::GetCustomerResponse.new(
|
373
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
374
|
-
)
|
375
|
-
if r.status == 200
|
376
|
-
if Utils.match_content_type(content_type, 'application/json')
|
377
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::GetCustomerResponseBody)
|
378
|
-
res.object = out
|
379
|
-
end
|
380
|
-
elsif r.status == 400
|
381
|
-
if Utils.match_content_type(content_type, 'application/json')
|
382
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
383
|
-
res.bad_request = out
|
384
|
-
end
|
385
|
-
elsif r.status == 401
|
386
|
-
if Utils.match_content_type(content_type, 'application/json')
|
387
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
388
|
-
res.unauthorized = out
|
389
|
-
end
|
390
|
-
elsif r.status == 403
|
391
|
-
if Utils.match_content_type(content_type, 'application/json')
|
392
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
393
|
-
res.forbidden = out
|
394
|
-
end
|
395
|
-
elsif r.status == 404
|
396
|
-
if Utils.match_content_type(content_type, 'application/json')
|
397
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
398
|
-
res.not_found = out
|
399
|
-
end
|
400
|
-
elsif r.status == 409
|
401
|
-
if Utils.match_content_type(content_type, 'application/json')
|
402
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
403
|
-
res.conflict = out
|
404
|
-
end
|
405
|
-
elsif r.status == 410
|
406
|
-
if Utils.match_content_type(content_type, 'application/json')
|
407
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
408
|
-
res.invite_expired = out
|
409
|
-
end
|
410
|
-
elsif r.status == 422
|
411
|
-
if Utils.match_content_type(content_type, 'application/json')
|
412
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
413
|
-
res.unprocessable_entity = out
|
414
|
-
end
|
415
|
-
elsif r.status == 429
|
416
|
-
if Utils.match_content_type(content_type, 'application/json')
|
417
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
418
|
-
res.rate_limit_exceeded = out
|
419
|
-
end
|
420
|
-
elsif r.status == 500
|
421
|
-
if Utils.match_content_type(content_type, 'application/json')
|
422
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
423
|
-
res.internal_server_error = out
|
424
|
-
end
|
425
|
-
end
|
426
|
-
|
427
|
-
res
|
428
|
-
end
|
429
|
-
|
430
|
-
|
431
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::UpdateCustomerRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::UpdateCustomerResponse) }
|
432
|
-
def update(request, timeout_ms = nil)
|
433
|
-
# update - Update a customer
|
434
|
-
# Update a customer for the authenticated workspace.
|
435
|
-
url, params = @sdk_configuration.get_server_details
|
436
|
-
base_url = Utils.template_url(url, params)
|
437
|
-
url = Utils.generate_url(
|
438
|
-
::OpenApiSDK::Operations::UpdateCustomerRequest,
|
439
|
-
base_url,
|
440
|
-
'/customers/{id}',
|
441
|
-
request
|
442
|
-
)
|
443
|
-
headers = {}
|
444
|
-
req_content_type, data, form = Utils.serialize_request_body(request, :request_body, :json)
|
445
|
-
headers['content-type'] = req_content_type
|
446
|
-
|
447
|
-
if form
|
448
|
-
body = Utils.encode_form(form)
|
449
|
-
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
450
|
-
body = URI.encode_www_form(data)
|
451
|
-
else
|
452
|
-
body = data
|
453
|
-
end
|
454
|
-
query_params = Utils.get_query_params(::OpenApiSDK::Operations::UpdateCustomerRequest, request)
|
455
|
-
headers['Accept'] = 'application/json'
|
456
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
457
|
-
|
458
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
459
|
-
|
460
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
461
|
-
timeout ||= @sdk_configuration.timeout
|
462
|
-
|
463
|
-
connection = @sdk_configuration.client
|
464
|
-
|
465
|
-
hook_ctx = SDKHooks::HookContext.new(
|
466
|
-
base_url: base_url,
|
467
|
-
oauth2_scopes: nil,
|
468
|
-
operation_id: 'updateCustomer',
|
469
|
-
security_source: @sdk_configuration.security_source
|
470
|
-
)
|
471
|
-
|
472
|
-
error = T.let(nil, T.nilable(StandardError))
|
473
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
474
|
-
|
475
|
-
begin
|
476
|
-
r = connection.patch(url) do |req|
|
477
|
-
req.body = body
|
478
|
-
req.headers.merge!(headers)
|
479
|
-
req.options.timeout = timeout unless timeout.nil?
|
480
|
-
req.params = query_params
|
481
|
-
Utils.configure_request_security(req, security)
|
482
|
-
|
483
|
-
@sdk_configuration.hooks.before_request(
|
484
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
485
|
-
hook_ctx: hook_ctx
|
486
|
-
),
|
487
|
-
request: req
|
488
|
-
)
|
489
|
-
end
|
490
|
-
rescue StandardError => e
|
491
|
-
error = e
|
492
|
-
ensure
|
493
|
-
if r.nil? || Utils.error_status?(r.status)
|
494
|
-
r = @sdk_configuration.hooks.after_error(
|
495
|
-
error: error,
|
496
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
497
|
-
hook_ctx: hook_ctx
|
498
|
-
),
|
499
|
-
response: r
|
500
|
-
)
|
501
|
-
else
|
502
|
-
r = @sdk_configuration.hooks.after_success(
|
503
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
504
|
-
hook_ctx: hook_ctx
|
505
|
-
),
|
506
|
-
response: r
|
507
|
-
)
|
508
|
-
end
|
509
|
-
|
510
|
-
if r.nil?
|
511
|
-
raise error if !error.nil?
|
512
|
-
raise 'no response'
|
513
|
-
end
|
514
|
-
end
|
515
|
-
|
516
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
517
|
-
|
518
|
-
res = ::OpenApiSDK::Operations::UpdateCustomerResponse.new(
|
519
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
520
|
-
)
|
521
|
-
if r.status == 200
|
522
|
-
if Utils.match_content_type(content_type, 'application/json')
|
523
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::UpdateCustomerResponseBody)
|
524
|
-
res.object = out
|
525
|
-
end
|
526
|
-
elsif r.status == 400
|
527
|
-
if Utils.match_content_type(content_type, 'application/json')
|
528
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
529
|
-
res.bad_request = out
|
530
|
-
end
|
531
|
-
elsif r.status == 401
|
532
|
-
if Utils.match_content_type(content_type, 'application/json')
|
533
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
534
|
-
res.unauthorized = out
|
535
|
-
end
|
536
|
-
elsif r.status == 403
|
537
|
-
if Utils.match_content_type(content_type, 'application/json')
|
538
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
539
|
-
res.forbidden = out
|
540
|
-
end
|
541
|
-
elsif r.status == 404
|
542
|
-
if Utils.match_content_type(content_type, 'application/json')
|
543
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
544
|
-
res.not_found = out
|
545
|
-
end
|
546
|
-
elsif r.status == 409
|
547
|
-
if Utils.match_content_type(content_type, 'application/json')
|
548
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
549
|
-
res.conflict = out
|
550
|
-
end
|
551
|
-
elsif r.status == 410
|
552
|
-
if Utils.match_content_type(content_type, 'application/json')
|
553
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
554
|
-
res.invite_expired = out
|
555
|
-
end
|
556
|
-
elsif r.status == 422
|
557
|
-
if Utils.match_content_type(content_type, 'application/json')
|
558
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
559
|
-
res.unprocessable_entity = out
|
560
|
-
end
|
561
|
-
elsif r.status == 429
|
562
|
-
if Utils.match_content_type(content_type, 'application/json')
|
563
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
564
|
-
res.rate_limit_exceeded = out
|
565
|
-
end
|
566
|
-
elsif r.status == 500
|
567
|
-
if Utils.match_content_type(content_type, 'application/json')
|
568
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
569
|
-
res.internal_server_error = out
|
570
|
-
end
|
571
|
-
end
|
572
|
-
|
573
|
-
res
|
574
|
-
end
|
575
|
-
|
576
|
-
|
577
|
-
sig { params(request: T.nilable(::OpenApiSDK::Operations::DeleteCustomerRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::DeleteCustomerResponse) }
|
578
|
-
def delete(request, timeout_ms = nil)
|
579
|
-
# delete - Delete a customer
|
580
|
-
# Delete a customer from a workspace.
|
581
|
-
url, params = @sdk_configuration.get_server_details
|
582
|
-
base_url = Utils.template_url(url, params)
|
583
|
-
url = Utils.generate_url(
|
584
|
-
::OpenApiSDK::Operations::DeleteCustomerRequest,
|
585
|
-
base_url,
|
586
|
-
'/customers/{id}',
|
587
|
-
request
|
588
|
-
)
|
589
|
-
headers = {}
|
590
|
-
headers['Accept'] = 'application/json'
|
591
|
-
headers['user-agent'] = @sdk_configuration.user_agent
|
592
|
-
|
593
|
-
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
594
|
-
|
595
|
-
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
596
|
-
timeout ||= @sdk_configuration.timeout
|
597
|
-
|
598
|
-
connection = @sdk_configuration.client
|
599
|
-
|
600
|
-
hook_ctx = SDKHooks::HookContext.new(
|
601
|
-
base_url: base_url,
|
602
|
-
oauth2_scopes: nil,
|
603
|
-
operation_id: 'deleteCustomer',
|
604
|
-
security_source: @sdk_configuration.security_source
|
605
|
-
)
|
606
|
-
|
607
|
-
error = T.let(nil, T.nilable(StandardError))
|
608
|
-
r = T.let(nil, T.nilable(Faraday::Response))
|
609
|
-
|
610
|
-
begin
|
611
|
-
r = connection.delete(url) do |req|
|
612
|
-
req.headers.merge!(headers)
|
613
|
-
req.options.timeout = timeout unless timeout.nil?
|
614
|
-
Utils.configure_request_security(req, security)
|
615
|
-
|
616
|
-
@sdk_configuration.hooks.before_request(
|
617
|
-
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
618
|
-
hook_ctx: hook_ctx
|
619
|
-
),
|
620
|
-
request: req
|
621
|
-
)
|
622
|
-
end
|
623
|
-
rescue StandardError => e
|
624
|
-
error = e
|
625
|
-
ensure
|
626
|
-
if r.nil? || Utils.error_status?(r.status)
|
627
|
-
r = @sdk_configuration.hooks.after_error(
|
628
|
-
error: error,
|
629
|
-
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
630
|
-
hook_ctx: hook_ctx
|
631
|
-
),
|
632
|
-
response: r
|
633
|
-
)
|
634
|
-
else
|
635
|
-
r = @sdk_configuration.hooks.after_success(
|
636
|
-
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
637
|
-
hook_ctx: hook_ctx
|
638
|
-
),
|
639
|
-
response: r
|
640
|
-
)
|
641
|
-
end
|
642
|
-
|
643
|
-
if r.nil?
|
644
|
-
raise error if !error.nil?
|
645
|
-
raise 'no response'
|
646
|
-
end
|
647
|
-
end
|
648
|
-
|
649
|
-
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
650
|
-
|
651
|
-
res = ::OpenApiSDK::Operations::DeleteCustomerResponse.new(
|
652
|
-
status_code: r.status, content_type: content_type, raw_response: r
|
653
|
-
)
|
654
|
-
if r.status == 200
|
655
|
-
if Utils.match_content_type(content_type, 'application/json')
|
656
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::DeleteCustomerResponseBody)
|
657
|
-
res.object = out
|
658
|
-
end
|
659
|
-
elsif r.status == 400
|
660
|
-
if Utils.match_content_type(content_type, 'application/json')
|
661
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
662
|
-
res.bad_request = out
|
663
|
-
end
|
664
|
-
elsif r.status == 401
|
665
|
-
if Utils.match_content_type(content_type, 'application/json')
|
666
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
667
|
-
res.unauthorized = out
|
668
|
-
end
|
669
|
-
elsif r.status == 403
|
670
|
-
if Utils.match_content_type(content_type, 'application/json')
|
671
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
672
|
-
res.forbidden = out
|
673
|
-
end
|
674
|
-
elsif r.status == 404
|
675
|
-
if Utils.match_content_type(content_type, 'application/json')
|
676
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
677
|
-
res.not_found = out
|
678
|
-
end
|
679
|
-
elsif r.status == 409
|
680
|
-
if Utils.match_content_type(content_type, 'application/json')
|
681
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
682
|
-
res.conflict = out
|
683
|
-
end
|
684
|
-
elsif r.status == 410
|
685
|
-
if Utils.match_content_type(content_type, 'application/json')
|
686
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
687
|
-
res.invite_expired = out
|
688
|
-
end
|
689
|
-
elsif r.status == 422
|
690
|
-
if Utils.match_content_type(content_type, 'application/json')
|
691
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
692
|
-
res.unprocessable_entity = out
|
693
|
-
end
|
694
|
-
elsif r.status == 429
|
695
|
-
if Utils.match_content_type(content_type, 'application/json')
|
696
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
697
|
-
res.rate_limit_exceeded = out
|
698
|
-
end
|
699
|
-
elsif r.status == 500
|
700
|
-
if Utils.match_content_type(content_type, 'application/json')
|
701
|
-
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
702
|
-
res.internal_server_error = out
|
703
|
-
end
|
704
|
-
end
|
705
|
-
|
706
|
-
res
|
707
|
-
end
|
708
|
-
end
|
709
|
-
end
|