dub 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/dub.rb +23 -0
- data/lib/open_api_sdk/analytics.rb +99 -0
- data/lib/open_api_sdk/domains.rb +577 -0
- data/lib/open_api_sdk/dub.rb +107 -0
- data/lib/open_api_sdk/links.rb +724 -0
- data/lib/open_api_sdk/metatags.rb +58 -0
- data/lib/open_api_sdk/models/operations/adddomain_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/adddomain_requestbody.rb +42 -0
- data/lib/open_api_sdk/models/operations/adddomain_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/bulkcreatelinks_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/bulkcreatelinks_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/color.rb +24 -0
- data/lib/open_api_sdk/models/operations/createlink_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/createlink_requestbody.rb +92 -0
- data/lib/open_api_sdk/models/operations/createlink_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/createtag_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/createtag_requestbody.rb +27 -0
- data/lib/open_api_sdk/models/operations/createtag_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/createworkspace_requestbody.rb +30 -0
- data/lib/open_api_sdk/models/operations/createworkspace_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/deletedomain_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/deletedomain_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/deletedomain_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/deletelink_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/deletelink_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/deletelink_responsebody.rb +24 -0
- data/lib/open_api_sdk/models/operations/event.rb +21 -0
- data/lib/open_api_sdk/models/operations/getlinkinfo_request.rb +39 -0
- data/lib/open_api_sdk/models/operations/getlinkinfo_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/getlinks_request.rb +57 -0
- data/lib/open_api_sdk/models/operations/getlinks_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/getlinkscount_request.rb +54 -0
- data/lib/open_api_sdk/models/operations/getlinkscount_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/getmetatags_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/getmetatags_response.rb +33 -0
- data/lib/open_api_sdk/models/operations/getmetatags_responsebody.rb +30 -0
- data/lib/open_api_sdk/models/operations/getqrcode_request.rb +39 -0
- data/lib/open_api_sdk/models/operations/getqrcode_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/gettags_request.rb +27 -0
- data/lib/open_api_sdk/models/operations/gettags_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/getworkspace_request.rb +24 -0
- data/lib/open_api_sdk/models/operations/getworkspace_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/getworkspaces_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/groupby.rb +28 -0
- data/lib/open_api_sdk/models/operations/interval.rb +25 -0
- data/lib/open_api_sdk/models/operations/level.rb +21 -0
- data/lib/open_api_sdk/models/operations/listdomains_request.rb +27 -0
- data/lib/open_api_sdk/models/operations/listdomains_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/paymentprocessor.rb +20 -0
- data/lib/open_api_sdk/models/operations/requestbody.rb +92 -0
- data/lib/open_api_sdk/models/operations/retrieveanalytics_request.rb +87 -0
- data/lib/open_api_sdk/models/operations/retrieveanalytics_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/setprimarydomain_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/setprimarydomain_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/sort.rb +20 -0
- data/lib/open_api_sdk/models/operations/trackcustomer_requestbody.rb +33 -0
- data/lib/open_api_sdk/models/operations/trackcustomer_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/trackcustomer_responsebody.rb +33 -0
- data/lib/open_api_sdk/models/operations/tracklead_requestbody.rb +42 -0
- data/lib/open_api_sdk/models/operations/tracklead_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/tracklead_responsebody.rb +42 -0
- data/lib/open_api_sdk/models/operations/tracksale_requestbody.rb +39 -0
- data/lib/open_api_sdk/models/operations/tracksale_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/tracksale_responsebody.rb +39 -0
- data/lib/open_api_sdk/models/operations/transferdomain_request.rb +33 -0
- data/lib/open_api_sdk/models/operations/transferdomain_requestbody.rb +24 -0
- data/lib/open_api_sdk/models/operations/transferdomain_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/type.rb +19 -0
- data/lib/open_api_sdk/models/operations/updatedomain_request.rb +33 -0
- data/lib/open_api_sdk/models/operations/updatedomain_requestbody.rb +42 -0
- data/lib/open_api_sdk/models/operations/updatedomain_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/updatedomain_type.rb +19 -0
- data/lib/open_api_sdk/models/operations/updatelink_request.rb +33 -0
- data/lib/open_api_sdk/models/operations/updatelink_requestbody.rb +92 -0
- data/lib/open_api_sdk/models/operations/updatelink_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/upsertlink_request.rb +30 -0
- data/lib/open_api_sdk/models/operations/upsertlink_requestbody.rb +92 -0
- data/lib/open_api_sdk/models/operations/upsertlink_response.rb +60 -0
- data/lib/open_api_sdk/models/operations.rb +81 -0
- data/lib/open_api_sdk/models/shared/badrequest.rb +24 -0
- data/lib/open_api_sdk/models/shared/code.rb +18 -0
- data/lib/open_api_sdk/models/shared/color.rb +24 -0
- data/lib/open_api_sdk/models/shared/conflict.rb +24 -0
- data/lib/open_api_sdk/models/shared/conflict_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/conflict_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/countrycode.rb +267 -0
- data/lib/open_api_sdk/models/shared/domains.rb +27 -0
- data/lib/open_api_sdk/models/shared/domainschema.rb +54 -0
- data/lib/open_api_sdk/models/shared/error.rb +30 -0
- data/lib/open_api_sdk/models/shared/forbidden.rb +24 -0
- data/lib/open_api_sdk/models/shared/forbidden_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/forbidden_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/geo.rb +771 -0
- data/lib/open_api_sdk/models/shared/internalservererror.rb +24 -0
- data/lib/open_api_sdk/models/shared/internalservererror_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/internalservererror_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/inviteexpired.rb +24 -0
- data/lib/open_api_sdk/models/shared/inviteexpired_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/inviteexpired_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/linkgeotargeting.rb +771 -0
- data/lib/open_api_sdk/models/shared/linkschema.rb +139 -0
- data/lib/open_api_sdk/models/shared/notfound.rb +24 -0
- data/lib/open_api_sdk/models/shared/notfound_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/notfound_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/plan.rb +24 -0
- data/lib/open_api_sdk/models/shared/ratelimitexceeded.rb +24 -0
- data/lib/open_api_sdk/models/shared/ratelimitexceeded_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/ratelimitexceeded_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/role.rb +19 -0
- data/lib/open_api_sdk/models/shared/security.rb +24 -0
- data/lib/open_api_sdk/models/shared/tagschema.rb +30 -0
- data/lib/open_api_sdk/models/shared/type.rb +19 -0
- data/lib/open_api_sdk/models/shared/unauthorized.rb +24 -0
- data/lib/open_api_sdk/models/shared/unauthorized_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/unauthorized_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/unprocessableentity.rb +24 -0
- data/lib/open_api_sdk/models/shared/unprocessableentity_code.rb +18 -0
- data/lib/open_api_sdk/models/shared/unprocessableentity_error.rb +30 -0
- data/lib/open_api_sdk/models/shared/users.rb +24 -0
- data/lib/open_api_sdk/models/shared/workspaceschema.rb +81 -0
- data/lib/open_api_sdk/models/shared.rb +50 -0
- data/lib/open_api_sdk/qr_codes.rb +97 -0
- data/lib/open_api_sdk/sdkconfiguration.rb +54 -0
- data/lib/open_api_sdk/tags.rb +197 -0
- data/lib/open_api_sdk/track.rb +276 -0
- data/lib/open_api_sdk/utils/metadata_fields.rb +150 -0
- data/lib/open_api_sdk/utils/t.rb +59 -0
- data/lib/open_api_sdk/utils/utils.rb +772 -0
- data/lib/open_api_sdk/workspaces.rb +268 -0
- metadata +300 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
|
7
|
+
module OpenApiSDK
|
8
|
+
module Shared
|
9
|
+
|
10
|
+
|
11
|
+
class WorkspaceSchema < ::OpenApiSDK::Utils::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
# The date and time when the billing cycle starts for the workspace.
|
15
|
+
field :billing_cycle_start, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('billingCycleStart') } }
|
16
|
+
# The date and time when the workspace was created.
|
17
|
+
field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } }
|
18
|
+
# The domains of the workspace.
|
19
|
+
field :domains, T::Array[::OpenApiSDK::Shared::Domains], { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('domains') } }
|
20
|
+
# The domains limit of the workspace.
|
21
|
+
field :domains_limit, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('domainsLimit') } }
|
22
|
+
# The unique ID of the workspace.
|
23
|
+
field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
|
24
|
+
# The invite code of the workspace.
|
25
|
+
field :invite_code, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('inviteCode') } }
|
26
|
+
# The links limit of the workspace.
|
27
|
+
field :links_limit, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linksLimit') } }
|
28
|
+
# The links usage of the workspace.
|
29
|
+
field :links_usage, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linksUsage') } }
|
30
|
+
# The logo of the workspace.
|
31
|
+
field :logo, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('logo') } }
|
32
|
+
# The name of the workspace.
|
33
|
+
field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } }
|
34
|
+
# The plan of the workspace.
|
35
|
+
field :plan, ::OpenApiSDK::Shared::Plan, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('plan'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Shared::Plan, false) } }
|
36
|
+
# The slug of the workspace.
|
37
|
+
field :slug, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('slug') } }
|
38
|
+
# [BETA]: The Stripe Connect ID of the workspace.
|
39
|
+
field :stripe_connect_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('stripeConnectId') } }
|
40
|
+
# The Stripe ID of the workspace.
|
41
|
+
field :stripe_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('stripeId') } }
|
42
|
+
# The tags limit of the workspace.
|
43
|
+
field :tags_limit, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tagsLimit') } }
|
44
|
+
# The usage of the workspace.
|
45
|
+
field :usage, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('usage') } }
|
46
|
+
# The usage limit of the workspace.
|
47
|
+
field :usage_limit, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('usageLimit') } }
|
48
|
+
# The role of the authenticated user in the workspace.
|
49
|
+
field :users, T::Array[::OpenApiSDK::Shared::Users], { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('users') } }
|
50
|
+
# The users limit of the workspace.
|
51
|
+
field :users_limit, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('usersLimit') } }
|
52
|
+
# Whether the workspace is enrolled in the beta testing program.
|
53
|
+
field :beta_tester, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('betaTester') } }
|
54
|
+
|
55
|
+
|
56
|
+
sig { params(billing_cycle_start: ::Float, created_at: ::String, domains: T::Array[::OpenApiSDK::Shared::Domains], domains_limit: ::Float, id: ::String, invite_code: ::String, links_limit: ::Float, links_usage: ::Float, logo: ::String, name: ::String, plan: ::OpenApiSDK::Shared::Plan, slug: ::String, stripe_connect_id: ::String, stripe_id: ::String, tags_limit: ::Float, usage: ::Float, usage_limit: ::Float, users: T::Array[::OpenApiSDK::Shared::Users], users_limit: ::Float, beta_tester: T.nilable(T::Boolean)).void }
|
57
|
+
def initialize(billing_cycle_start: nil, created_at: nil, domains: nil, domains_limit: nil, id: nil, invite_code: nil, links_limit: nil, links_usage: nil, logo: nil, name: nil, plan: nil, slug: nil, stripe_connect_id: nil, stripe_id: nil, tags_limit: nil, usage: nil, usage_limit: nil, users: nil, users_limit: nil, beta_tester: nil)
|
58
|
+
@billing_cycle_start = billing_cycle_start
|
59
|
+
@created_at = created_at
|
60
|
+
@domains = domains
|
61
|
+
@domains_limit = domains_limit
|
62
|
+
@id = id
|
63
|
+
@invite_code = invite_code
|
64
|
+
@links_limit = links_limit
|
65
|
+
@links_usage = links_usage
|
66
|
+
@logo = logo
|
67
|
+
@name = name
|
68
|
+
@plan = plan
|
69
|
+
@slug = slug
|
70
|
+
@stripe_connect_id = stripe_connect_id
|
71
|
+
@stripe_id = stripe_id
|
72
|
+
@tags_limit = tags_limit
|
73
|
+
@usage = usage
|
74
|
+
@usage_limit = usage_limit
|
75
|
+
@users = users
|
76
|
+
@users_limit = users_limit
|
77
|
+
@beta_tester = beta_tester
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
module OpenApiSDK
|
7
|
+
module Shared
|
8
|
+
autoload :InternalServerErrorCode, 'open_api_sdk/models/shared/internalservererror_code.rb'
|
9
|
+
autoload :InternalServerErrorError, 'open_api_sdk/models/shared/internalservererror_error.rb'
|
10
|
+
autoload :InternalServerError, 'open_api_sdk/models/shared/internalservererror.rb'
|
11
|
+
autoload :RateLimitExceededCode, 'open_api_sdk/models/shared/ratelimitexceeded_code.rb'
|
12
|
+
autoload :RateLimitExceededError, 'open_api_sdk/models/shared/ratelimitexceeded_error.rb'
|
13
|
+
autoload :RateLimitExceeded, 'open_api_sdk/models/shared/ratelimitexceeded.rb'
|
14
|
+
autoload :UnprocessableEntityCode, 'open_api_sdk/models/shared/unprocessableentity_code.rb'
|
15
|
+
autoload :UnprocessableEntityError, 'open_api_sdk/models/shared/unprocessableentity_error.rb'
|
16
|
+
autoload :UnprocessableEntity, 'open_api_sdk/models/shared/unprocessableentity.rb'
|
17
|
+
autoload :InviteExpiredCode, 'open_api_sdk/models/shared/inviteexpired_code.rb'
|
18
|
+
autoload :InviteExpiredError, 'open_api_sdk/models/shared/inviteexpired_error.rb'
|
19
|
+
autoload :InviteExpired, 'open_api_sdk/models/shared/inviteexpired.rb'
|
20
|
+
autoload :ConflictCode, 'open_api_sdk/models/shared/conflict_code.rb'
|
21
|
+
autoload :ConflictError, 'open_api_sdk/models/shared/conflict_error.rb'
|
22
|
+
autoload :Conflict, 'open_api_sdk/models/shared/conflict.rb'
|
23
|
+
autoload :NotFoundCode, 'open_api_sdk/models/shared/notfound_code.rb'
|
24
|
+
autoload :NotFoundError, 'open_api_sdk/models/shared/notfound_error.rb'
|
25
|
+
autoload :NotFound, 'open_api_sdk/models/shared/notfound.rb'
|
26
|
+
autoload :ForbiddenCode, 'open_api_sdk/models/shared/forbidden_code.rb'
|
27
|
+
autoload :ForbiddenError, 'open_api_sdk/models/shared/forbidden_error.rb'
|
28
|
+
autoload :Forbidden, 'open_api_sdk/models/shared/forbidden.rb'
|
29
|
+
autoload :UnauthorizedCode, 'open_api_sdk/models/shared/unauthorized_code.rb'
|
30
|
+
autoload :UnauthorizedError, 'open_api_sdk/models/shared/unauthorized_error.rb'
|
31
|
+
autoload :Unauthorized, 'open_api_sdk/models/shared/unauthorized.rb'
|
32
|
+
autoload :Code, 'open_api_sdk/models/shared/code.rb'
|
33
|
+
autoload :Error, 'open_api_sdk/models/shared/error.rb'
|
34
|
+
autoload :BadRequest, 'open_api_sdk/models/shared/badrequest.rb'
|
35
|
+
autoload :Geo, 'open_api_sdk/models/shared/geo.rb'
|
36
|
+
autoload :LinkSchema, 'open_api_sdk/models/shared/linkschema.rb'
|
37
|
+
autoload :Color, 'open_api_sdk/models/shared/color.rb'
|
38
|
+
autoload :TagSchema, 'open_api_sdk/models/shared/tagschema.rb'
|
39
|
+
autoload :LinkGeoTargeting, 'open_api_sdk/models/shared/linkgeotargeting.rb'
|
40
|
+
autoload :CountryCode, 'open_api_sdk/models/shared/countrycode.rb'
|
41
|
+
autoload :Plan, 'open_api_sdk/models/shared/plan.rb'
|
42
|
+
autoload :Role, 'open_api_sdk/models/shared/role.rb'
|
43
|
+
autoload :Users, 'open_api_sdk/models/shared/users.rb'
|
44
|
+
autoload :Domains, 'open_api_sdk/models/shared/domains.rb'
|
45
|
+
autoload :WorkspaceSchema, 'open_api_sdk/models/shared/workspaceschema.rb'
|
46
|
+
autoload :Type, 'open_api_sdk/models/shared/type.rb'
|
47
|
+
autoload :DomainSchema, 'open_api_sdk/models/shared/domainschema.rb'
|
48
|
+
autoload :Security, 'open_api_sdk/models/shared/security.rb'
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module OpenApiSDK
|
11
|
+
extend T::Sig
|
12
|
+
class QRCodes
|
13
|
+
extend T::Sig
|
14
|
+
|
15
|
+
|
16
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
17
|
+
def initialize(sdk_config)
|
18
|
+
@sdk_configuration = sdk_config
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
sig { params(request: T.nilable(::OpenApiSDK::Operations::GetQRCodeRequest)).returns(::OpenApiSDK::Operations::GetQRCodeResponse) }
|
23
|
+
def get(request)
|
24
|
+
# get - Retrieve a QR code
|
25
|
+
# Retrieve a QR code for a link.
|
26
|
+
url, params = @sdk_configuration.get_server_details
|
27
|
+
base_url = Utils.template_url(url, params)
|
28
|
+
url = "#{base_url}/qr"
|
29
|
+
headers = {}
|
30
|
+
query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetQRCodeRequest, request, @sdk_configuration.globals)
|
31
|
+
headers['Accept'] = 'application/json;q=1, image/png;q=0'
|
32
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
33
|
+
|
34
|
+
r = @sdk_configuration.client.get(url) do |req|
|
35
|
+
req.headers = headers
|
36
|
+
req.params = query_params
|
37
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
38
|
+
end
|
39
|
+
|
40
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
41
|
+
|
42
|
+
res = ::OpenApiSDK::Operations::GetQRCodeResponse.new(
|
43
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
44
|
+
)
|
45
|
+
if r.status == 200
|
46
|
+
res.res = r.env.response_body if Utils.match_content_type(content_type, 'image/png')
|
47
|
+
|
48
|
+
elsif r.status == 400
|
49
|
+
if Utils.match_content_type(content_type, 'application/json')
|
50
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::BadRequest)
|
51
|
+
res.bad_request = out
|
52
|
+
end
|
53
|
+
elsif r.status == 401
|
54
|
+
if Utils.match_content_type(content_type, 'application/json')
|
55
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Unauthorized)
|
56
|
+
res.unauthorized = out
|
57
|
+
end
|
58
|
+
elsif r.status == 403
|
59
|
+
if Utils.match_content_type(content_type, 'application/json')
|
60
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Forbidden)
|
61
|
+
res.forbidden = out
|
62
|
+
end
|
63
|
+
elsif r.status == 404
|
64
|
+
if Utils.match_content_type(content_type, 'application/json')
|
65
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::NotFound)
|
66
|
+
res.not_found = out
|
67
|
+
end
|
68
|
+
elsif r.status == 409
|
69
|
+
if Utils.match_content_type(content_type, 'application/json')
|
70
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Conflict)
|
71
|
+
res.conflict = out
|
72
|
+
end
|
73
|
+
elsif r.status == 410
|
74
|
+
if Utils.match_content_type(content_type, 'application/json')
|
75
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InviteExpired)
|
76
|
+
res.invite_expired = out
|
77
|
+
end
|
78
|
+
elsif r.status == 422
|
79
|
+
if Utils.match_content_type(content_type, 'application/json')
|
80
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::UnprocessableEntity)
|
81
|
+
res.unprocessable_entity = out
|
82
|
+
end
|
83
|
+
elsif r.status == 429
|
84
|
+
if Utils.match_content_type(content_type, 'application/json')
|
85
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::RateLimitExceeded)
|
86
|
+
res.rate_limit_exceeded = out
|
87
|
+
end
|
88
|
+
elsif r.status == 500
|
89
|
+
if Utils.match_content_type(content_type, 'application/json')
|
90
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InternalServerError)
|
91
|
+
res.internal_server_error = out
|
92
|
+
end
|
93
|
+
end
|
94
|
+
res
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module OpenApiSDK
|
11
|
+
extend T::Sig
|
12
|
+
|
13
|
+
SERVERS = [
|
14
|
+
'https://api.dub.co', # 1 - Production API
|
15
|
+
].freeze
|
16
|
+
# Contains the list of servers available to the SDK
|
17
|
+
|
18
|
+
class SDKConfiguration < ::OpenApiSDK::Utils::FieldAugmented
|
19
|
+
extend T::Sig
|
20
|
+
|
21
|
+
field :client, T.nilable(Faraday::Connection)
|
22
|
+
field :security, T.nilable(::OpenApiSDK::Shared::Security)
|
23
|
+
field :server_url, T.nilable(String)
|
24
|
+
field :server_idx, T.nilable(Integer)
|
25
|
+
field :globals, Hash[Symbol, Hash[Symbol, Hash[Symbol, Object]]]
|
26
|
+
field :language, String
|
27
|
+
field :openapi_doc_version, String
|
28
|
+
field :sdk_version, String
|
29
|
+
field :gen_version, String
|
30
|
+
field :user_agent, String
|
31
|
+
|
32
|
+
|
33
|
+
sig { params(client: Faraday::Connection, security: T.nilable(::OpenApiSDK::Shared::Security), server_url: T.nilable(String), server_idx: T.nilable(Integer), globals: T::Hash[Symbol, T::Hash[Symbol, T::Hash[Symbol, Object]]]).void }
|
34
|
+
def initialize(client, security, server_url, server_idx, globals)
|
35
|
+
@client = client
|
36
|
+
@server_url = server_url
|
37
|
+
@server_idx = server_idx.nil? ? 0 : server_idx
|
38
|
+
raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length
|
39
|
+
@security = security
|
40
|
+
@globals = globals.nil? ? {} : globals
|
41
|
+
@language = 'ruby'
|
42
|
+
@openapi_doc_version = '0.0.1'
|
43
|
+
@sdk_version = '0.0.2'
|
44
|
+
@gen_version = '2.338.7'
|
45
|
+
@user_agent = 'speakeasy-sdk/ruby 0.0.2 2.338.7 0.0.1 dub'
|
46
|
+
end
|
47
|
+
|
48
|
+
sig { returns([String, T::Hash[Symbol, String]]) }
|
49
|
+
def get_server_details
|
50
|
+
return [@server_url.delete_suffix('/'), {}] if !@server_url.nil?
|
51
|
+
[SERVERS[@server_idx], {}]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'sorbet-runtime'
|
9
|
+
|
10
|
+
module OpenApiSDK
|
11
|
+
extend T::Sig
|
12
|
+
class Tags
|
13
|
+
extend T::Sig
|
14
|
+
|
15
|
+
|
16
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
17
|
+
def initialize(sdk_config)
|
18
|
+
@sdk_configuration = sdk_config
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
sig { params(workspace_id: T.nilable(::String), project_slug: T.nilable(::String)).returns(::OpenApiSDK::Operations::GetTagsResponse) }
|
23
|
+
def list(workspace_id = nil, project_slug = nil)
|
24
|
+
# list - Retrieve a list of tags
|
25
|
+
# Retrieve a list of tags for the authenticated workspace.
|
26
|
+
request = ::OpenApiSDK::Operations::GetTagsRequest.new(
|
27
|
+
|
28
|
+
workspace_id: workspace_id,
|
29
|
+
project_slug: project_slug
|
30
|
+
)
|
31
|
+
url, params = @sdk_configuration.get_server_details
|
32
|
+
base_url = Utils.template_url(url, params)
|
33
|
+
url = "#{base_url}/tags"
|
34
|
+
headers = {}
|
35
|
+
query_params = Utils.get_query_params(::OpenApiSDK::Operations::GetTagsRequest, request, @sdk_configuration.globals)
|
36
|
+
headers['Accept'] = 'application/json'
|
37
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
38
|
+
|
39
|
+
r = @sdk_configuration.client.get(url) do |req|
|
40
|
+
req.headers = headers
|
41
|
+
req.params = query_params
|
42
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
43
|
+
end
|
44
|
+
|
45
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
46
|
+
|
47
|
+
res = ::OpenApiSDK::Operations::GetTagsResponse.new(
|
48
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
49
|
+
)
|
50
|
+
if r.status == 200
|
51
|
+
if Utils.match_content_type(content_type, 'application/json')
|
52
|
+
out = Utils.unmarshal_complex(r.env.response_body, T::Array[::OpenApiSDK::Shared::TagSchema])
|
53
|
+
res.tag_schemas = out
|
54
|
+
end
|
55
|
+
elsif r.status == 400
|
56
|
+
if Utils.match_content_type(content_type, 'application/json')
|
57
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::BadRequest)
|
58
|
+
res.bad_request = out
|
59
|
+
end
|
60
|
+
elsif r.status == 401
|
61
|
+
if Utils.match_content_type(content_type, 'application/json')
|
62
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Unauthorized)
|
63
|
+
res.unauthorized = out
|
64
|
+
end
|
65
|
+
elsif r.status == 403
|
66
|
+
if Utils.match_content_type(content_type, 'application/json')
|
67
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Forbidden)
|
68
|
+
res.forbidden = out
|
69
|
+
end
|
70
|
+
elsif r.status == 404
|
71
|
+
if Utils.match_content_type(content_type, 'application/json')
|
72
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::NotFound)
|
73
|
+
res.not_found = out
|
74
|
+
end
|
75
|
+
elsif r.status == 409
|
76
|
+
if Utils.match_content_type(content_type, 'application/json')
|
77
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Conflict)
|
78
|
+
res.conflict = out
|
79
|
+
end
|
80
|
+
elsif r.status == 410
|
81
|
+
if Utils.match_content_type(content_type, 'application/json')
|
82
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InviteExpired)
|
83
|
+
res.invite_expired = out
|
84
|
+
end
|
85
|
+
elsif r.status == 422
|
86
|
+
if Utils.match_content_type(content_type, 'application/json')
|
87
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::UnprocessableEntity)
|
88
|
+
res.unprocessable_entity = out
|
89
|
+
end
|
90
|
+
elsif r.status == 429
|
91
|
+
if Utils.match_content_type(content_type, 'application/json')
|
92
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::RateLimitExceeded)
|
93
|
+
res.rate_limit_exceeded = out
|
94
|
+
end
|
95
|
+
elsif r.status == 500
|
96
|
+
if Utils.match_content_type(content_type, 'application/json')
|
97
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InternalServerError)
|
98
|
+
res.internal_server_error = out
|
99
|
+
end
|
100
|
+
end
|
101
|
+
res
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
sig { params(workspace_id: T.nilable(::String), project_slug: T.nilable(::String), request_body: T.nilable(::OpenApiSDK::Operations::CreateTagRequestBody)).returns(::OpenApiSDK::Operations::CreateTagResponse) }
|
106
|
+
def create(workspace_id = nil, project_slug = nil, request_body = nil)
|
107
|
+
# create - Create a new tag
|
108
|
+
# Create a new tag for the authenticated workspace.
|
109
|
+
request = ::OpenApiSDK::Operations::CreateTagRequest.new(
|
110
|
+
|
111
|
+
workspace_id: workspace_id,
|
112
|
+
project_slug: project_slug,
|
113
|
+
request_body: request_body
|
114
|
+
)
|
115
|
+
url, params = @sdk_configuration.get_server_details
|
116
|
+
base_url = Utils.template_url(url, params)
|
117
|
+
url = "#{base_url}/tags"
|
118
|
+
headers = {}
|
119
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :request_body, :json)
|
120
|
+
headers['content-type'] = req_content_type
|
121
|
+
query_params = Utils.get_query_params(::OpenApiSDK::Operations::CreateTagRequest, request, @sdk_configuration.globals)
|
122
|
+
headers['Accept'] = 'application/json'
|
123
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
124
|
+
|
125
|
+
r = @sdk_configuration.client.post(url) do |req|
|
126
|
+
req.headers = headers
|
127
|
+
req.params = query_params
|
128
|
+
Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil?
|
129
|
+
if form
|
130
|
+
req.body = Utils.encode_form(form)
|
131
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
132
|
+
req.body = URI.encode_www_form(data)
|
133
|
+
else
|
134
|
+
req.body = data
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
139
|
+
|
140
|
+
res = ::OpenApiSDK::Operations::CreateTagResponse.new(
|
141
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
142
|
+
)
|
143
|
+
if r.status == 201
|
144
|
+
if Utils.match_content_type(content_type, 'application/json')
|
145
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::TagSchema)
|
146
|
+
res.tag_schema = out
|
147
|
+
end
|
148
|
+
elsif r.status == 400
|
149
|
+
if Utils.match_content_type(content_type, 'application/json')
|
150
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::BadRequest)
|
151
|
+
res.bad_request = out
|
152
|
+
end
|
153
|
+
elsif r.status == 401
|
154
|
+
if Utils.match_content_type(content_type, 'application/json')
|
155
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Unauthorized)
|
156
|
+
res.unauthorized = out
|
157
|
+
end
|
158
|
+
elsif r.status == 403
|
159
|
+
if Utils.match_content_type(content_type, 'application/json')
|
160
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Forbidden)
|
161
|
+
res.forbidden = out
|
162
|
+
end
|
163
|
+
elsif r.status == 404
|
164
|
+
if Utils.match_content_type(content_type, 'application/json')
|
165
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::NotFound)
|
166
|
+
res.not_found = out
|
167
|
+
end
|
168
|
+
elsif r.status == 409
|
169
|
+
if Utils.match_content_type(content_type, 'application/json')
|
170
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Conflict)
|
171
|
+
res.conflict = out
|
172
|
+
end
|
173
|
+
elsif r.status == 410
|
174
|
+
if Utils.match_content_type(content_type, 'application/json')
|
175
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InviteExpired)
|
176
|
+
res.invite_expired = out
|
177
|
+
end
|
178
|
+
elsif r.status == 422
|
179
|
+
if Utils.match_content_type(content_type, 'application/json')
|
180
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::UnprocessableEntity)
|
181
|
+
res.unprocessable_entity = out
|
182
|
+
end
|
183
|
+
elsif r.status == 429
|
184
|
+
if Utils.match_content_type(content_type, 'application/json')
|
185
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::RateLimitExceeded)
|
186
|
+
res.rate_limit_exceeded = out
|
187
|
+
end
|
188
|
+
elsif r.status == 500
|
189
|
+
if Utils.match_content_type(content_type, 'application/json')
|
190
|
+
out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InternalServerError)
|
191
|
+
res.internal_server_error = out
|
192
|
+
end
|
193
|
+
end
|
194
|
+
res
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|