From 87aaebd9c15cfcb6c064f9c344e90ba4650aae22 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 4 Feb 2025 00:27:06 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.483.0 --- .speakeasy/gen.lock | 41 +++++++- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 14 +-- Gemfile.lock | 2 +- README.md | 1 + RELEASES.md | 12 ++- codeSamples.yaml | 6 ++ .../operations/createpartnerlinklinkprops.md | 35 +++++++ .../createpartnerlinkrequestbody.md | 13 +++ .../operations/createpartnerlinkresponse.md | 20 ++++ docs/sdks/partners/README.md | 50 ++++++++++ dub.gemspec | 2 +- lib/open_api_sdk/models/operations.rb | 3 + .../operations/createpartnerlink_linkprops.rb | 99 +++++++++++++++++++ .../createpartnerlink_requestbody.rb | 39 ++++++++ .../operations/createpartnerlink_response.rb | 60 +++++++++++ lib/open_api_sdk/partners.rb | 86 ++++++++++++++++ lib/open_api_sdk/sdkconfiguration.rb | 6 +- 18 files changed, 472 insertions(+), 19 deletions(-) create mode 100644 docs/models/operations/createpartnerlinklinkprops.md create mode 100644 docs/models/operations/createpartnerlinkrequestbody.md create mode 100644 docs/models/operations/createpartnerlinkresponse.md create mode 100644 lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb create mode 100644 lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb create mode 100644 lib/open_api_sdk/models/operations/createpartnerlink_response.rb diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 4f22dd2..f059299 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 5a2dd83e-da98-455b-8ef9-0100a914efdf management: - docChecksum: 35e4c58336f3289dc7d36cd16ac407d9 + docChecksum: 3221eb44e26e0b7b6262f2e3cf1c786a docVersion: 0.0.1 - speakeasyVersion: 1.481.1 - generationVersion: 2.500.5 - releaseVersion: 0.2.2-alpha.59 - configChecksum: 07f8c5e6cf1fe76e341758cb8b0ba8aa + speakeasyVersion: 1.483.0 + generationVersion: 2.502.0 + releaseVersion: 0.2.2-alpha.60 + configChecksum: 8bca03315bcd90a5ae26d298bc60493f repoURL: https://github.com/dubinc/dub-ruby.git installationURL: https://github.com/dubinc/dub-ruby published: true @@ -53,6 +53,9 @@ generatedFiles: - docs/models/operations/createlinkresponse.md - docs/models/operations/createpartnerdiscount.md - docs/models/operations/createpartnerinterval.md + - docs/models/operations/createpartnerlinklinkprops.md + - docs/models/operations/createpartnerlinkrequestbody.md + - docs/models/operations/createpartnerlinkresponse.md - docs/models/operations/createpartnerrequestbody.md - docs/models/operations/createpartnerresponse.md - docs/models/operations/createpartnerresponsebody.md @@ -264,6 +267,9 @@ generatedFiles: - lib/open_api_sdk/models/operations/createpartner_response.rb - lib/open_api_sdk/models/operations/createpartner_responsebody.rb - lib/open_api_sdk/models/operations/createpartner_type.rb + - lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb + - lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb + - lib/open_api_sdk/models/operations/createpartnerlink_response.rb - lib/open_api_sdk/models/operations/createtag_requestbody.rb - lib/open_api_sdk/models/operations/createtag_response.rb - lib/open_api_sdk/models/operations/customer.rb @@ -1307,5 +1313,30 @@ examples: application/json: {"error": {"code": "rate_limit_exceeded", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"}} "500": application/json: {"error": {"code": "internal_server_error", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"}} + createPartnerLink: + speakeasy-default-create-partner-link: + requestBody: + application/json: {"programId": "", "url": "https://necessary-brief.name", "linkProps": {"externalId": "123456", "tagIds": ["clux0rgak00011..."]}} + responses: + "201": + application/json: {"id": "", "domain": "inferior-louse.org", "key": "", "url": "https://lighthearted-subexpression.net", "trackConversion": true, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1754305632811", "expiredUrl": "https://acceptable-solution.com", "password": "CRFmmigZdFo7_Sd", "proxy": true, "title": "", "description": "merrily stay ouch starch glittering repeat", "image": "https://picsum.photos/seed/qQVGzy2/555/2692", "video": "https://picsum.videos/seed/tYFhXY/1788/3108", "rewrite": true, "doIndex": false, "ios": "", "android": "", "geo": {}, "publicStats": false, "tagId": "", "tags": [{"id": "", "name": "", "color": "purple"}], "webhookIds": [""], "comments": "per blissfully maintainer moist lest unless", "shortLink": "https://equatorial-mouser.biz", "qrCode": "https://wry-baritone.net/", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 2531.62, "lastClicked": "", "leads": 189.59, "sales": 4658.39, "saleAmount": 9705.38, "createdAt": "1719659714941", "updatedAt": "1738625113730", "projectId": ""} + "400": + application/json: {"error": {"code": "bad_request", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#bad-request"}} + "401": + application/json: {"error": {"code": "unauthorized", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#unauthorized"}} + "403": + application/json: {"error": {"code": "forbidden", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#forbidden"}} + "404": + application/json: {"error": {"code": "not_found", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#not-found"}} + "409": + application/json: {"error": {"code": "conflict", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#conflict"}} + "410": + application/json: {"error": {"code": "invite_expired", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#invite-expired"}} + "422": + application/json: {"error": {"code": "unprocessable_entity", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#unprocessable-entity"}} + "429": + application/json: {"error": {"code": "rate_limit_exceeded", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#rate-limit_exceeded"}} + "500": + application/json: {"error": {"code": "internal_server_error", "message": "The requested resource was not found.", "doc_url": "https://dub.co/docs/api-reference/errors#internal-server_error"}} examplesVersion: 1.0.0 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c13c9e4..819bdbd 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false ruby: - version: 0.2.2-alpha.59 + version: 0.2.2-alpha.60 author: Dub description: Ruby Client SDK Generated by Speakeasy imports: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4ec664a..ae40750 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.481.1 +speakeasyVersion: 1.483.0 sources: dub: sourceNamespace: dub - sourceRevisionDigest: sha256:35e0d43bc22466f2b3123c89af55fb2795faab7ba45d389e579d3e5a35b5b788 - sourceBlobDigest: sha256:451be136201f6f2abfe71e31c9d268f24d14c1a911aad964414e9e62d708dda3 + sourceRevisionDigest: sha256:3a88f242a386976ac33526c0985b9764422ced71d5bfd20486c90a013d7e0087 + sourceBlobDigest: sha256:07d9325feb01f432d02cf3ae4943fed8a9f9c9fdacf649eb143973253d0348ac tags: - latest - - speakeasy-sdk-regen-1738369717 + - speakeasy-sdk-regen-1738628770 - 0.0.1 targets: my-first-target: source: dub sourceNamespace: dub - sourceRevisionDigest: sha256:35e0d43bc22466f2b3123c89af55fb2795faab7ba45d389e579d3e5a35b5b788 - sourceBlobDigest: sha256:451be136201f6f2abfe71e31c9d268f24d14c1a911aad964414e9e62d708dda3 + sourceRevisionDigest: sha256:3a88f242a386976ac33526c0985b9764422ced71d5bfd20486c90a013d7e0087 + sourceBlobDigest: sha256:07d9325feb01f432d02cf3ae4943fed8a9f9c9fdacf649eb143973253d0348ac codeSamplesNamespace: code-samples-ruby-my-first-target - codeSamplesRevisionDigest: sha256:594b3c73bd192d59f28e76933b794bf931fc02131877af3bdba5a5d4cc2dd1e7 + codeSamplesRevisionDigest: sha256:96db8b1fcdfb3b696fda1765fdb9606fc139cd5bf8f0fbea5916c135f1f92b1d workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/Gemfile.lock b/Gemfile.lock index d491a68..fd8e242 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dub (0.2.2.pre.alpha.59) + dub (0.2.2.pre.alpha.60) faraday faraday-multipart rack diff --git a/README.md b/README.md index 1afd8c4..ca5cd67 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ end ### [partners](docs/sdks/partners/README.md) * [create](docs/sdks/partners/README.md#create) - Create a new partner +* [create_link](docs/sdks/partners/README.md#create_link) - Create a link for a partner ### [qr_codes](docs/sdks/qrcodes/README.md) diff --git a/RELEASES.md b/RELEASES.md index ff5bbea..fff949f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -738,4 +738,14 @@ Based on: ### Generated - [ruby v0.2.2-alpha.59] . ### Releases -- [Ruby Gems v0.2.2-alpha.59] https://rubygems.org/gems/dub/versions/0.2.2-alpha.59 - . \ No newline at end of file +- [Ruby Gems v0.2.2-alpha.59] https://rubygems.org/gems/dub/versions/0.2.2-alpha.59 - . + +## 2025-02-04 00:25:56 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.483.0 (2.502.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [ruby v0.2.2-alpha.60] . +### Releases +- [Ruby Gems v0.2.2-alpha.60] https://rubygems.org/gems/dub/versions/0.2.2-alpha.60 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 39feb60..0c4ac6f 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -135,6 +135,12 @@ actions: - "lang": "ruby" "label": "createPartner" "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::CreatePartnerRequestBody.new(\n program_id: \"\",\n name: \"\",\n email: \"Loyal79@yahoo.com\",\n username: \"Aaliyah_Borer\",\n link_props: ::OpenApiSDK::Operations::LinkProps.new(\n external_id: \"123456\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n ),\n)\n \nres = s.partners.create(req)\n\nif ! res.object.nil?\n # handle response\nend" + - target: $["paths"]["/partners/links"]["post"] + update: + "x-codeSamples": + - "lang": "ruby" + "label": "createPartnerLink" + "source": "require 'dub'\n\n\ns = ::OpenApiSDK::Dub.new\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n token: \"DUB_API_KEY\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::CreatePartnerLinkRequestBody.new(\n program_id: \"\",\n url: \"https://necessary-brief.name\",\n link_props: ::OpenApiSDK::Operations::CreatePartnerLinkLinkProps.new(\n external_id: \"123456\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n ),\n)\n \nres = s.partners.create_link(req)\n\nif ! res.link_schema.nil?\n # handle response\nend" - target: $["paths"]["/qr"]["get"] update: "x-codeSamples": diff --git a/docs/models/operations/createpartnerlinklinkprops.md b/docs/models/operations/createpartnerlinklinkprops.md new file mode 100644 index 0000000..fa15db6 --- /dev/null +++ b/docs/models/operations/createpartnerlinklinkprops.md @@ -0,0 +1,35 @@ +# CreatePartnerLinkLinkProps + +Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `external_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace. | 123456 | +| `tenant_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant. | | +| `partner_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the partner the short link is associated with. | | +| `prefix` | *T.nilable(::String)* | :heavy_minus_sign: | The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. | | +| `archived` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the short link is archived. Defaults to `false` if not provided. | | +| `tag_ids` | *T.nilable(::Object)* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | [
"clux0rgak00011..."
] | +| `tag_names` | *T.nilable(::Object)* | :heavy_minus_sign: | The unique name of the tags assigned to the short link (case insensitive). | | +| `comments` | *T.nilable(::String)* | :heavy_minus_sign: | The comments for the short link. | | +| `expires_at` | *T.nilable(::String)* | :heavy_minus_sign: | The date and time when the short link will expire at. | | +| `expired_url` | *T.nilable(::String)* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | +| `password` | *T.nilable(::String)* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | +| `proxy` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. Defaults to `false` if not provided. | | +| `title` | *T.nilable(::String)* | :heavy_minus_sign: | The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `image` | *T.nilable(::String)* | :heavy_minus_sign: | The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `video` | *T.nilable(::String)* | :heavy_minus_sign: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `rewrite` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the short link uses link cloaking. Defaults to `false` if not provided. | | +| `ios` | *T.nilable(::String)* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | +| `android` | *T.nilable(::String)* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | +| `do_index` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex | | +| `utm_source` | *T.nilable(::String)* | :heavy_minus_sign: | The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. | | +| `utm_medium` | *T.nilable(::String)* | :heavy_minus_sign: | The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL. | | +| `utm_campaign` | *T.nilable(::String)* | :heavy_minus_sign: | The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL. | | +| `utm_term` | *T.nilable(::String)* | :heavy_minus_sign: | The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL. | | +| `utm_content` | *T.nilable(::String)* | :heavy_minus_sign: | The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL. | | +| `ref` | *T.nilable(::String)* | :heavy_minus_sign: | The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL. | | \ No newline at end of file diff --git a/docs/models/operations/createpartnerlinkrequestbody.md b/docs/models/operations/createpartnerlinkrequestbody.md new file mode 100644 index 0000000..92909ca --- /dev/null +++ b/docs/models/operations/createpartnerlinkrequestbody.md @@ -0,0 +1,13 @@ +# CreatePartnerLinkRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `program_id` | *::String* | :heavy_check_mark: | The ID of the program that the partner is enrolled in. | +| `partner_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the partner to create a link for. Will take precedence over `tenantId` if provided. | +| `tenant_id` | *T.nilable(::String)* | :heavy_minus_sign: | The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown. | +| `url` | *::String* | :heavy_check_mark: | The URL to shorten. Will throw an error if the domain doesn't match the program's default URL domain. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | The short link slug. If not provided, a random 7-character slug will be generated. | +| `link_props` | [T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkLinkProps)](../../models/operations/createpartnerlinklinkprops.md) | :heavy_minus_sign: | Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. | \ No newline at end of file diff --git a/docs/models/operations/createpartnerlinkresponse.md b/docs/models/operations/createpartnerlinkresponse.md new file mode 100644 index 0000000..455672e --- /dev/null +++ b/docs/models/operations/createpartnerlinkresponse.md @@ -0,0 +1,20 @@ +# CreatePartnerLinkResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `link_schema` | [T.nilable(::OpenApiSDK::Shared::LinkSchema)](../../models/shared/linkschema.md) | :heavy_minus_sign: | The created partner | +| `bad_request` | [T.nilable(::OpenApiSDK::Shared::BadRequest)](../../models/shared/badrequest.md) | :heavy_minus_sign: | 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). | +| `unauthorized` | [T.nilable(::OpenApiSDK::Shared::Unauthorized)](../../models/shared/unauthorized.md) | :heavy_minus_sign: | Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. | +| `forbidden` | [T.nilable(::OpenApiSDK::Shared::Forbidden)](../../models/shared/forbidden.md) | :heavy_minus_sign: | 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. | +| `not_found` | [T.nilable(::OpenApiSDK::Shared::NotFound)](../../models/shared/notfound.md) | :heavy_minus_sign: | The server cannot find the requested resource. | +| `conflict` | [T.nilable(::OpenApiSDK::Shared::Conflict)](../../models/shared/conflict.md) | :heavy_minus_sign: | This response is sent when a request conflicts with the current state of the server. | +| `invite_expired` | [T.nilable(::OpenApiSDK::Shared::InviteExpired)](../../models/shared/inviteexpired.md) | :heavy_minus_sign: | This response is sent when the requested content has been permanently deleted from server, with no forwarding address. | +| `unprocessable_entity` | [T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)](../../models/shared/unprocessableentity.md) | :heavy_minus_sign: | The request was well-formed but was unable to be followed due to semantic errors. | +| `rate_limit_exceeded` | [T.nilable(::OpenApiSDK::Shared::RateLimitExceeded)](../../models/shared/ratelimitexceeded.md) | :heavy_minus_sign: | The user has sent too many requests in a given amount of time ("rate limiting") | +| `internal_server_error` | [T.nilable(::OpenApiSDK::Shared::InternalServerError)](../../models/shared/internalservererror.md) | :heavy_minus_sign: | The server has encountered a situation it does not know how to handle. | \ No newline at end of file diff --git a/docs/sdks/partners/README.md b/docs/sdks/partners/README.md index d26ac0f..193541f 100644 --- a/docs/sdks/partners/README.md +++ b/docs/sdks/partners/README.md @@ -6,6 +6,7 @@ ### Available Operations * [create](#create) - Create a new partner +* [create_link](#create_link) - Create a link for a partner ## create @@ -56,3 +57,52 @@ end **[T.nilable(::OpenApiSDK::Operations::CreatePartnerResponse)](../../models/operations/createpartnerresponse.md)** + + +## create_link + +Create a new link for a partner that is enrolled in your program + +### Example Usage + +```ruby +require 'dub' + + +s = ::OpenApiSDK::Dub.new +s.config_security( + ::OpenApiSDK::Shared::Security.new( + token: "DUB_API_KEY", + ) +) + + +req = ::OpenApiSDK::Operations::CreatePartnerLinkRequestBody.new( + program_id: "", + url: "https://necessary-brief.name", + link_props: ::OpenApiSDK::Operations::CreatePartnerLinkLinkProps.new( + external_id: "123456", + tag_ids: [ + "clux0rgak00011...", + ], + ), +) + +res = s.partners.create_link(req) + +if ! res.link_schema.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `request` | [::OpenApiSDK::Operations::CreatePartnerLinkRequestBody](../../models/operations/createpartnerlinkrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkResponse)](../../models/operations/createpartnerlinkresponse.md)** + diff --git a/dub.gemspec b/dub.gemspec index b5fdfc3..fcf1c9c 100644 --- a/dub.gemspec +++ b/dub.gemspec @@ -4,7 +4,7 @@ $LOAD_PATH.push File.expand_path('lib', __dir__) Gem::Specification.new do |s| s.name = 'dub' - s.version = '0.2.2-alpha.59' + s.version = '0.2.2-alpha.60' s.platform = Gem::Platform::RUBY s.licenses = ['Apache-2.0'] s.summary = '' diff --git a/lib/open_api_sdk/models/operations.rb b/lib/open_api_sdk/models/operations.rb index 522792b..e637451 100644 --- a/lib/open_api_sdk/models/operations.rb +++ b/lib/open_api_sdk/models/operations.rb @@ -127,6 +127,9 @@ module Operations autoload :CreatePartnerDiscount, 'open_api_sdk/models/operations/createpartner_discount.rb' autoload :CreatePartnerResponseBody, 'open_api_sdk/models/operations/createpartner_responsebody.rb' autoload :CreatePartnerResponse, 'open_api_sdk/models/operations/createpartner_response.rb' + autoload :CreatePartnerLinkLinkProps, 'open_api_sdk/models/operations/createpartnerlink_linkprops.rb' + autoload :CreatePartnerLinkRequestBody, 'open_api_sdk/models/operations/createpartnerlink_requestbody.rb' + autoload :CreatePartnerLinkResponse, 'open_api_sdk/models/operations/createpartnerlink_response.rb' autoload :GetWorkspaceRequest, 'open_api_sdk/models/operations/getworkspace_request.rb' autoload :GetWorkspaceResponse, 'open_api_sdk/models/operations/getworkspace_response.rb' autoload :UpdateWorkspaceRequestBody, 'open_api_sdk/models/operations/updateworkspace_requestbody.rb' diff --git a/lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb b/lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb new file mode 100644 index 0000000..68a6f68 --- /dev/null +++ b/lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb @@ -0,0 +1,99 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + + +module OpenApiSDK + module Operations + + # Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. + class CreatePartnerLinkLinkProps < ::OpenApiSDK::Utils::FieldAugmented + extend T::Sig + + # The Android destination URL for the short link for Android device targeting. + field :android, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('android') } } + # Whether the short link is archived. Defaults to `false` if not provided. + field :archived, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('archived') } } + # The comments for the short link. + field :comments, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('comments') } } + # The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + field :description, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description') } } + # Allow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex + field :do_index, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('doIndex') } } + # The URL to redirect to when the short link has expired. + field :expired_url, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('expiredUrl') } } + # The date and time when the short link will expire at. + field :expires_at, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('expiresAt') } } + # The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace. + field :external_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('externalId') } } + # The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + field :image, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('image') } } + # The iOS destination URL for the short link for iOS device targeting. + field :ios, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('ios') } } + # The ID of the partner the short link is associated with. + field :partner_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('partnerId') } } + # The password required to access the destination URL of the short link. + field :password, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('password') } } + # The prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided. + field :prefix, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('prefix') } } + # Whether the short link uses Custom Social Media Cards feature. Defaults to `false` if not provided. + field :proxy, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('proxy') } } + # The referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL. + field :ref, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('ref') } } + # Whether the short link uses link cloaking. Defaults to `false` if not provided. + field :rewrite, T.nilable(T::Boolean), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('rewrite') } } + # The unique IDs of the tags assigned to the short link. + field :tag_ids, T.nilable(::Object), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tagIds') } } + # The unique name of the tags assigned to the short link (case insensitive). + field :tag_names, T.nilable(::Object), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tagNames') } } + # The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant. + field :tenant_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tenantId') } } + # The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + field :title, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('title') } } + # The UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL. + field :utm_campaign, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('utm_campaign') } } + # The UTM content of the short link. If set, this will populate or override the UTM content in the destination URL. + field :utm_content, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('utm_content') } } + # The UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL. + field :utm_medium, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('utm_medium') } } + # The UTM source of the short link. If set, this will populate or override the UTM source in the destination URL. + field :utm_source, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('utm_source') } } + # The UTM term of the short link. If set, this will populate or override the UTM term in the destination URL. + field :utm_term, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('utm_term') } } + # The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + field :video, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('video') } } + + + sig { params(android: T.nilable(::String), archived: T.nilable(T::Boolean), comments: T.nilable(::String), description: T.nilable(::String), do_index: T.nilable(T::Boolean), expired_url: T.nilable(::String), expires_at: T.nilable(::String), external_id: T.nilable(::String), image: T.nilable(::String), ios: T.nilable(::String), partner_id: T.nilable(::String), password: T.nilable(::String), prefix: T.nilable(::String), proxy: T.nilable(T::Boolean), ref: T.nilable(::String), rewrite: T.nilable(T::Boolean), tag_ids: T.nilable(::Object), tag_names: T.nilable(::Object), tenant_id: T.nilable(::String), title: T.nilable(::String), utm_campaign: T.nilable(::String), utm_content: T.nilable(::String), utm_medium: T.nilable(::String), utm_source: T.nilable(::String), utm_term: T.nilable(::String), video: T.nilable(::String)).void } + def initialize(android: nil, archived: nil, comments: nil, description: nil, do_index: nil, expired_url: nil, expires_at: nil, external_id: nil, image: nil, ios: nil, partner_id: nil, password: nil, prefix: nil, proxy: nil, ref: nil, rewrite: nil, tag_ids: nil, tag_names: nil, tenant_id: nil, title: nil, utm_campaign: nil, utm_content: nil, utm_medium: nil, utm_source: nil, utm_term: nil, video: nil) + @android = android + @archived = archived + @comments = comments + @description = description + @do_index = do_index + @expired_url = expired_url + @expires_at = expires_at + @external_id = external_id + @image = image + @ios = ios + @partner_id = partner_id + @password = password + @prefix = prefix + @proxy = proxy + @ref = ref + @rewrite = rewrite + @tag_ids = tag_ids + @tag_names = tag_names + @tenant_id = tenant_id + @title = title + @utm_campaign = utm_campaign + @utm_content = utm_content + @utm_medium = utm_medium + @utm_source = utm_source + @utm_term = utm_term + @video = video + end + end + end +end diff --git a/lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb b/lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb new file mode 100644 index 0000000..28e29a6 --- /dev/null +++ b/lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + + +module OpenApiSDK + module Operations + + + class CreatePartnerLinkRequestBody < ::OpenApiSDK::Utils::FieldAugmented + extend T::Sig + + # The ID of the program that the partner is enrolled in. + field :program_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('programId') } } + # The URL to shorten. Will throw an error if the domain doesn't match the program's default URL domain. + field :url, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('url') } } + # The short link slug. If not provided, a random 7-character slug will be generated. + field :key, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('key') } } + # Additional properties that you can pass to the partner's short link. Will be used to override the default link properties for this partner. + field :link_props, T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkLinkProps), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linkProps') } } + # The ID of the partner to create a link for. Will take precedence over `tenantId` if provided. + field :partner_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('partnerId') } } + # The ID of the partner in your system. If both `partnerId` and `tenantId` are not provided, an error will be thrown. + field :tenant_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tenantId') } } + + + sig { params(program_id: ::String, url: ::String, key: T.nilable(::String), link_props: T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkLinkProps), partner_id: T.nilable(::String), tenant_id: T.nilable(::String)).void } + def initialize(program_id: nil, url: nil, key: nil, link_props: nil, partner_id: nil, tenant_id: nil) + @program_id = program_id + @url = url + @key = key + @link_props = link_props + @partner_id = partner_id + @tenant_id = tenant_id + end + end + end +end diff --git a/lib/open_api_sdk/models/operations/createpartnerlink_response.rb b/lib/open_api_sdk/models/operations/createpartnerlink_response.rb new file mode 100644 index 0000000..7336915 --- /dev/null +++ b/lib/open_api_sdk/models/operations/createpartnerlink_response.rb @@ -0,0 +1,60 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + + +module OpenApiSDK + module Operations + + + class CreatePartnerLinkResponse < ::OpenApiSDK::Utils::FieldAugmented + extend T::Sig + + # HTTP response content type for this operation + field :content_type, ::String + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # HTTP response status code for this operation + field :status_code, ::Integer + # 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). + field :bad_request, T.nilable(::OpenApiSDK::Shared::BadRequest) + # This response is sent when a request conflicts with the current state of the server. + field :conflict, T.nilable(::OpenApiSDK::Shared::Conflict) + # 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. + field :forbidden, T.nilable(::OpenApiSDK::Shared::Forbidden) + # The server has encountered a situation it does not know how to handle. + field :internal_server_error, T.nilable(::OpenApiSDK::Shared::InternalServerError) + # This response is sent when the requested content has been permanently deleted from server, with no forwarding address. + field :invite_expired, T.nilable(::OpenApiSDK::Shared::InviteExpired) + # The created partner + field :link_schema, T.nilable(::OpenApiSDK::Shared::LinkSchema) + # The server cannot find the requested resource. + field :not_found, T.nilable(::OpenApiSDK::Shared::NotFound) + # The user has sent too many requests in a given amount of time ("rate limiting") + field :rate_limit_exceeded, T.nilable(::OpenApiSDK::Shared::RateLimitExceeded) + # Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response. + field :unauthorized, T.nilable(::OpenApiSDK::Shared::Unauthorized) + # The request was well-formed but was unable to be followed due to semantic errors. + field :unprocessable_entity, T.nilable(::OpenApiSDK::Shared::UnprocessableEntity) + + + 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), link_schema: T.nilable(::OpenApiSDK::Shared::LinkSchema), not_found: T.nilable(::OpenApiSDK::Shared::NotFound), rate_limit_exceeded: T.nilable(::OpenApiSDK::Shared::RateLimitExceeded), unauthorized: T.nilable(::OpenApiSDK::Shared::Unauthorized), unprocessable_entity: T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)).void } + 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, link_schema: nil, not_found: nil, rate_limit_exceeded: nil, unauthorized: nil, unprocessable_entity: nil) + @content_type = content_type + @raw_response = raw_response + @status_code = status_code + @bad_request = bad_request + @conflict = conflict + @forbidden = forbidden + @internal_server_error = internal_server_error + @invite_expired = invite_expired + @link_schema = link_schema + @not_found = not_found + @rate_limit_exceeded = rate_limit_exceeded + @unauthorized = unauthorized + @unprocessable_entity = unprocessable_entity + end + end + end +end diff --git a/lib/open_api_sdk/partners.rb b/lib/open_api_sdk/partners.rb index 35f85f1..5b33c31 100644 --- a/lib/open_api_sdk/partners.rb +++ b/lib/open_api_sdk/partners.rb @@ -103,5 +103,91 @@ def create(request) res end + + + sig { params(request: T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkRequestBody)).returns(::OpenApiSDK::Operations::CreatePartnerLinkResponse) } + def create_link(request) + # create_link - Create a link for a partner + # Create a new link for a partner that is enrolled in your program + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/partners/links" + headers = {} + req_content_type, data, form = Utils.serialize_request_body(request, :request, :json) + headers['content-type'] = req_content_type + headers['Accept'] = 'application/json' + headers['user-agent'] = @sdk_configuration.user_agent + + r = @sdk_configuration.client.post(url) do |req| + req.headers = headers + Utils.configure_request_security(req, @sdk_configuration.security) if !@sdk_configuration.nil? && !@sdk_configuration.security.nil? + if form + req.body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded') + req.body = URI.encode_www_form(data) + else + req.body = data + end + end + + content_type = r.headers.fetch('Content-Type', 'application/octet-stream') + + res = ::OpenApiSDK::Operations::CreatePartnerLinkResponse.new( + status_code: r.status, content_type: content_type, raw_response: r + ) + if r.status == 201 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::LinkSchema) + res.link_schema = out + end + elsif r.status == 400 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::BadRequest) + res.bad_request = out + end + elsif r.status == 401 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Unauthorized) + res.unauthorized = out + end + elsif r.status == 403 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Forbidden) + res.forbidden = out + end + elsif r.status == 404 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::NotFound) + res.not_found = out + end + elsif r.status == 409 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::Conflict) + res.conflict = out + end + elsif r.status == 410 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InviteExpired) + res.invite_expired = out + end + elsif r.status == 422 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::UnprocessableEntity) + res.unprocessable_entity = out + end + elsif r.status == 429 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::RateLimitExceeded) + res.rate_limit_exceeded = out + end + elsif r.status == 500 + if Utils.match_content_type(content_type, 'application/json') + out = Utils.unmarshal_complex(r.env.response_body, ::OpenApiSDK::Shared::InternalServerError) + res.internal_server_error = out + end + end + + res + end end end diff --git a/lib/open_api_sdk/sdkconfiguration.rb b/lib/open_api_sdk/sdkconfiguration.rb index 8e467af..74c5937 100644 --- a/lib/open_api_sdk/sdkconfiguration.rb +++ b/lib/open_api_sdk/sdkconfiguration.rb @@ -38,9 +38,9 @@ def initialize(client, security, server_url, server_idx) @security = security @language = 'ruby' @openapi_doc_version = '0.0.1' - @sdk_version = '0.2.2-alpha.59' - @gen_version = '2.500.5' - @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.59 2.500.5 0.0.1 dub' + @sdk_version = '0.2.2-alpha.60' + @gen_version = '2.502.0' + @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.60 2.502.0 0.0.1 dub' end sig { returns([String, T::Hash[Symbol, String]]) }