dub 0.2.2.pre.alpha.81 → 0.2.2.pre.alpha.83

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6070e52c885bb21e132ac5efc8d05103a07ab92ffec985fffb53cdb0d4f7b5da
4
- data.tar.gz: ed96b4a12ac082f95861c8fb44968fc9b338995e2c82b0fab391e5fc924bb043
3
+ metadata.gz: 745b95881d181e0b5dcf2436bdf9b76a572e9972948e47446688f231622439d6
4
+ data.tar.gz: 7f717b4d24ee58d99a5a7bf57e52e4c5e52360d5065047fc9933f0a77bf29600
5
5
  SHA512:
6
- metadata.gz: '089e98e002b8ec7eefb798f4c18e574723bb26f7709e2b70749127c7b57bbcd7707478b6ac84fff78ef13cbf7694c097559c76ae54068dae627673b8a71ea031'
7
- data.tar.gz: 6e35ec6bf19834831bb5f9f334650dc76eb71e151d4dad8884e3c33c2289fe2997bdf0e5217ec46a0be4cdbe40c9aba3279e531c1a7e3faf8d21df69029672ac
6
+ metadata.gz: 30892af68dcd2cd5e9f7b71a5ee53fdec0567aeaabf39ad60734d7d67c61f9d37d01eb50ac74899c46b046b680ce45e9ee997f33d15f3343655bb0fd49ee5506
7
+ data.tar.gz: af053b1547d15a23b91b66daa86cdf893a00d7f26faca0c72dba83a6dcf721b72a7a52a360674ec8c9e159a09218af9f232b2f393b0dc56322ae4e21f76769bf
@@ -0,0 +1,30 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module OpenApiSDK
8
+ module Operations
9
+
10
+
11
+ class RetrieveLinksRequest < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+
15
+ field :program_id, ::String, { 'query_param': { 'field_name': 'programId', 'style': 'form', 'explode': true } }
16
+
17
+ field :partner_id, T.nilable(::String), { 'query_param': { 'field_name': 'partnerId', 'style': 'form', 'explode': true } }
18
+
19
+ field :tenant_id, T.nilable(::String), { 'query_param': { 'field_name': 'tenantId', 'style': 'form', 'explode': true } }
20
+
21
+
22
+ sig { params(program_id: ::String, partner_id: T.nilable(::String), tenant_id: T.nilable(::String)).void }
23
+ def initialize(program_id: nil, partner_id: nil, tenant_id: nil)
24
+ @program_id = program_id
25
+ @partner_id = partner_id
26
+ @tenant_id = tenant_id
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,60 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module OpenApiSDK
8
+ module Operations
9
+
10
+
11
+ class RetrieveLinksResponse < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # HTTP response content type for this operation
15
+ field :content_type, ::String
16
+ # Raw HTTP response; suitable for custom response parsing
17
+ field :raw_response, ::Faraday::Response
18
+ # HTTP response status code for this operation
19
+ field :status_code, ::Integer
20
+ # The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
21
+ field :bad_request, T.nilable(::OpenApiSDK::Shared::BadRequest)
22
+ # This response is sent when a request conflicts with the current state of the server.
23
+ field :conflict, T.nilable(::OpenApiSDK::Shared::Conflict)
24
+ # The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.
25
+ field :forbidden, T.nilable(::OpenApiSDK::Shared::Forbidden)
26
+ # The server has encountered a situation it does not know how to handle.
27
+ field :internal_server_error, T.nilable(::OpenApiSDK::Shared::InternalServerError)
28
+ # This response is sent when the requested content has been permanently deleted from server, with no forwarding address.
29
+ field :invite_expired, T.nilable(::OpenApiSDK::Shared::InviteExpired)
30
+ # The server cannot find the requested resource.
31
+ field :not_found, T.nilable(::OpenApiSDK::Shared::NotFound)
32
+ # The user has sent too many requests in a given amount of time ("rate limiting")
33
+ field :rate_limit_exceeded, T.nilable(::OpenApiSDK::Shared::RateLimitExceeded)
34
+ # The retrieved partner links.
35
+ field :response_bodies, T.nilable(T::Array[::OpenApiSDK::Operations::RetrieveLinksResponseBody])
36
+ # Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
37
+ field :unauthorized, T.nilable(::OpenApiSDK::Shared::Unauthorized)
38
+ # The request was well-formed but was unable to be followed due to semantic errors.
39
+ field :unprocessable_entity, T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)
40
+
41
+
42
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, bad_request: T.nilable(::OpenApiSDK::Shared::BadRequest), conflict: T.nilable(::OpenApiSDK::Shared::Conflict), forbidden: T.nilable(::OpenApiSDK::Shared::Forbidden), internal_server_error: T.nilable(::OpenApiSDK::Shared::InternalServerError), invite_expired: T.nilable(::OpenApiSDK::Shared::InviteExpired), not_found: T.nilable(::OpenApiSDK::Shared::NotFound), rate_limit_exceeded: T.nilable(::OpenApiSDK::Shared::RateLimitExceeded), response_bodies: T.nilable(T::Array[::OpenApiSDK::Operations::RetrieveLinksResponseBody]), unauthorized: T.nilable(::OpenApiSDK::Shared::Unauthorized), unprocessable_entity: T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)).void }
43
+ def initialize(content_type: nil, raw_response: nil, status_code: nil, bad_request: nil, conflict: nil, forbidden: nil, internal_server_error: nil, invite_expired: nil, not_found: nil, rate_limit_exceeded: nil, response_bodies: nil, unauthorized: nil, unprocessable_entity: nil)
44
+ @content_type = content_type
45
+ @raw_response = raw_response
46
+ @status_code = status_code
47
+ @bad_request = bad_request
48
+ @conflict = conflict
49
+ @forbidden = forbidden
50
+ @internal_server_error = internal_server_error
51
+ @invite_expired = invite_expired
52
+ @not_found = not_found
53
+ @rate_limit_exceeded = rate_limit_exceeded
54
+ @response_bodies = response_bodies
55
+ @unauthorized = unauthorized
56
+ @unprocessable_entity = unprocessable_entity
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,48 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module OpenApiSDK
8
+ module Operations
9
+
10
+
11
+ class RetrieveLinksResponseBody < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The number of clicks on the short link.
15
+ field :clicks, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('clicks') } }
16
+ # The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains).
17
+ field :domain, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('domain') } }
18
+ # The unique ID of the short link.
19
+ field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
20
+ # The short link slug. If not provided, a random 7-character slug will be generated.
21
+ field :key, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('key') } }
22
+ # The number of leads the short links has generated.
23
+ field :leads, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('leads') } }
24
+ # The total dollar amount of sales the short links has generated (in cents).
25
+ field :sale_amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('saleAmount') } }
26
+ # The number of sales the short links has generated.
27
+ field :sales, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('sales') } }
28
+ # The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`).
29
+ field :short_link, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('shortLink') } }
30
+ # The destination URL of the short link.
31
+ field :url, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('url') } }
32
+
33
+
34
+ sig { params(clicks: ::Float, domain: ::String, id: ::String, key: ::String, leads: ::Float, sale_amount: ::Float, sales: ::Float, short_link: ::String, url: ::String).void }
35
+ def initialize(clicks: nil, domain: nil, id: nil, key: nil, leads: nil, sale_amount: nil, sales: nil, short_link: nil, url: nil)
36
+ @clicks = clicks
37
+ @domain = domain
38
+ @id = id
39
+ @key = key
40
+ @leads = leads
41
+ @sale_amount = sale_amount
42
+ @sales = sales
43
+ @short_link = short_link
44
+ @url = url
45
+ end
46
+ end
47
+ end
48
+ end
@@ -136,6 +136,9 @@ module OpenApiSDK
136
136
  autoload :CreatePartnerLinkLinkProps, 'open_api_sdk/models/operations/createpartnerlink_linkprops.rb'
137
137
  autoload :CreatePartnerLinkRequestBody, 'open_api_sdk/models/operations/createpartnerlink_requestbody.rb'
138
138
  autoload :CreatePartnerLinkResponse, 'open_api_sdk/models/operations/createpartnerlink_response.rb'
139
+ autoload :RetrieveLinksRequest, 'open_api_sdk/models/operations/retrievelinks_request.rb'
140
+ autoload :RetrieveLinksResponseBody, 'open_api_sdk/models/operations/retrievelinks_responsebody.rb'
141
+ autoload :RetrieveLinksResponse, 'open_api_sdk/models/operations/retrievelinks_response.rb'
139
142
  autoload :UpsertPartnerLinkLinkProps, 'open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb'
140
143
  autoload :UpsertPartnerLinkRequestBody, 'open_api_sdk/models/operations/upsertpartnerlink_requestbody.rb'
141
144
  autoload :UpsertPartnerLinkResponse, 'open_api_sdk/models/operations/upsertpartnerlink_response.rb'
@@ -300,6 +300,136 @@ module OpenApiSDK
300
300
  end
301
301
 
302
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
+
303
433
  sig { params(request: T.nilable(::OpenApiSDK::Operations::UpsertPartnerLinkRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::UpsertPartnerLinkResponse) }
304
434
  def upsert_link(request, timeout_ms = nil)
305
435
  # upsert_link - Upsert a link for a partner
@@ -61,9 +61,9 @@ module OpenApiSDK
61
61
  end
62
62
  @language = 'ruby'
63
63
  @openapi_doc_version = '0.0.1'
64
- @sdk_version = '0.2.2-alpha.81'
65
- @gen_version = '2.562.2'
66
- @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.81 2.562.2 0.0.1 dub'
64
+ @sdk_version = '0.2.2-alpha.83'
65
+ @gen_version = '2.563.0'
66
+ @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.83 2.563.0 0.0.1 dub'
67
67
  end
68
68
 
69
69
  sig { returns([String, T::Hash[Symbol, String]]) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.pre.alpha.81
4
+ version: 0.2.2.pre.alpha.83
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-03-27 00:00:00.000000000 Z
11
+ date: 2025-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -307,6 +307,9 @@ files:
307
307
  - lib/open_api_sdk/models/operations/responsebody.rb
308
308
  - lib/open_api_sdk/models/operations/retrieveanalytics_request.rb
309
309
  - lib/open_api_sdk/models/operations/retrieveanalytics_response.rb
310
+ - lib/open_api_sdk/models/operations/retrievelinks_request.rb
311
+ - lib/open_api_sdk/models/operations/retrievelinks_response.rb
312
+ - lib/open_api_sdk/models/operations/retrievelinks_responsebody.rb
310
313
  - lib/open_api_sdk/models/operations/retrievepartneranalytics_queryparam_interval.rb
311
314
  - lib/open_api_sdk/models/operations/retrievepartneranalytics_request.rb
312
315
  - lib/open_api_sdk/models/operations/retrievepartneranalytics_response.rb