diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d55bfa7..a1f21a2 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: 74d0358382bb4e56092e3d6743506d52 + docChecksum: a7b1bff0696d0e354d1e5a6b91b8ae7f docVersion: 0.0.1 - speakeasyVersion: 1.484.1 - generationVersion: 2.503.2 - releaseVersion: 0.2.2-alpha.61 - configChecksum: e3646bb66df4284ef4e195c57cb6778d + speakeasyVersion: 1.487.0 + generationVersion: 2.506.0 + releaseVersion: 0.2.2-alpha.62 + configChecksum: 9121977e32728c1d037c1adadbef2dfa repoURL: https://github.com/dubinc/dub-ruby.git installationURL: https://github.com/dubinc/dub-ruby published: true @@ -166,6 +166,9 @@ generatedFiles: - docs/models/operations/updateworkspaceresponse.md - docs/models/operations/upsertlinkrequestbody.md - docs/models/operations/upsertlinkresponse.md + - docs/models/operations/upsertpartnerlinklinkprops.md + - docs/models/operations/upsertpartnerlinkrequestbody.md + - docs/models/operations/upsertpartnerlinkresponse.md - docs/models/shared/badrequest.md - docs/models/shared/click.md - docs/models/shared/clickevent.md @@ -376,6 +379,9 @@ generatedFiles: - lib/open_api_sdk/models/operations/updateworkspace_response.rb - lib/open_api_sdk/models/operations/upsertlink_requestbody.rb - lib/open_api_sdk/models/operations/upsertlink_response.rb + - lib/open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb + - lib/open_api_sdk/models/operations/upsertpartnerlink_requestbody.rb + - lib/open_api_sdk/models/operations/upsertpartnerlink_response.rb - lib/open_api_sdk/models/shared.rb - lib/open_api_sdk/models/shared/badrequest.rb - lib/open_api_sdk/models/shared/click.rb @@ -1338,5 +1344,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"}} + upsertPartnerLink: + speakeasy-default-upsert-partner-link: + requestBody: + application/json: {"programId": "", "url": "https://unsteady-lobster.com/", "linkProps": {"externalId": "123456", "tagIds": ["clux0rgak00011..."]}} + responses: + "200": + application/json: {"id": "", "domain": "snoopy-exasperation.name", "key": "", "url": "https://defenseless-suitcase.org/", "trackConversion": false, "externalId": "", "tenantId": "", "programId": "", "partnerId": "", "archived": false, "expiresAt": "1758310011121", "expiredUrl": "https://serene-pants.com", "password": "Fj89Olng6LL82os", "proxy": false, "title": "", "description": "flashy petticoat than discontinue blink remand", "image": "https://picsum.photos/seed/v1k3M4GxN/2021/480", "video": "https://picsum.videos/seed/LiWqM7t/1298/1639", "rewrite": true, "doIndex": true, "ios": "", "android": "", "geo": {}, "publicStats": true, "tagId": "", "tags": [{"id": "", "name": "", "color": "green"}], "webhookIds": ["", ""], "comments": "doubtfully brr up behind above slake maroon upside-down repeatedly source while obstruct oof questionably familiar hidden into", "shortLink": "https://waterlogged-valentine.name", "qrCode": "https://quintessential-bowler.net", "utm_source": "", "utm_medium": "", "utm_campaign": "", "utm_term": "", "utm_content": "", "userId": "", "workspaceId": "", "clicks": 5717.16, "lastClicked": "", "leads": 6527.5, "sales": 7465.08, "saleAmount": 8176.49, "createdAt": "1722447375210", "updatedAt": "1738812840712", "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 977b17b..3fe8ea0 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: false ruby: - version: 0.2.2-alpha.61 + version: 0.2.2-alpha.62 author: Dub description: Ruby Client SDK Generated by Speakeasy imports: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d3e8799..5e18953 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.484.1 +speakeasyVersion: 1.487.0 sources: dub: sourceNamespace: dub - sourceRevisionDigest: sha256:cfb9bcc2cc70be03b705a5db7b86cd977466f1235414a5b212a57ab7345e514e - sourceBlobDigest: sha256:69653130c0b9c888c7d5862e01c34def8bd58d82dd1f30e17dd975305122b5dc + sourceRevisionDigest: sha256:371140ed311988935048aad28f29cf2934b0ceee28b12a09114080c4083d5acb + sourceBlobDigest: sha256:302af5af57801c13e8eae76439ce161f3027ad63927e360e1152ba4f786f7d91 tags: - latest - - speakeasy-sdk-regen-1738801618 + - speakeasy-sdk-regen-1738888006 - 0.0.1 targets: my-first-target: source: dub sourceNamespace: dub - sourceRevisionDigest: sha256:cfb9bcc2cc70be03b705a5db7b86cd977466f1235414a5b212a57ab7345e514e - sourceBlobDigest: sha256:69653130c0b9c888c7d5862e01c34def8bd58d82dd1f30e17dd975305122b5dc + sourceRevisionDigest: sha256:371140ed311988935048aad28f29cf2934b0ceee28b12a09114080c4083d5acb + sourceBlobDigest: sha256:302af5af57801c13e8eae76439ce161f3027ad63927e360e1152ba4f786f7d91 codeSamplesNamespace: code-samples-ruby-my-first-target - codeSamplesRevisionDigest: sha256:e6cbd5b633f7b5199d174ea3230b174015a43d667fe96f87b77a249212ea5635 + codeSamplesRevisionDigest: sha256:08b1e0e9763b6355dce8368f90a844a0821f6b6048c44a41ffb22d1968125e26 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/Gemfile.lock b/Gemfile.lock index 7acb055..ee88f7b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dub (0.2.2.pre.alpha.61) + dub (0.2.2.pre.alpha.62) faraday faraday-multipart rack diff --git a/README.md b/README.md index ca5cd67..a32ff73 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ end * [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 +* [upsert_link](docs/sdks/partners/README.md#upsert_link) - Upsert a link for a partner ### [qr_codes](docs/sdks/qrcodes/README.md) diff --git a/RELEASES.md b/RELEASES.md index 113341f..55d787e 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -758,4 +758,14 @@ Based on: ### Generated - [ruby v0.2.2-alpha.61] . ### Releases -- [Ruby Gems v0.2.2-alpha.61] https://rubygems.org/gems/dub/versions/0.2.2-alpha.61 - . \ No newline at end of file +- [Ruby Gems v0.2.2-alpha.61] https://rubygems.org/gems/dub/versions/0.2.2-alpha.61 - . + +## 2025-02-07 00:26:32 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.487.0 (2.506.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [ruby v0.2.2-alpha.62] . +### Releases +- [Ruby Gems v0.2.2-alpha.62] https://rubygems.org/gems/dub/versions/0.2.2-alpha.62 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 0c4ac6f..37b0db0 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -141,6 +141,12 @@ actions: - "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"]["/partners/links/upsert"]["put"] + update: + "x-codeSamples": + - "lang": "ruby" + "label": "upsertPartnerLink" + "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::UpsertPartnerLinkRequestBody.new(\n program_id: \"\",\n url: \"https://unsteady-lobster.com/\",\n link_props: ::OpenApiSDK::Operations::UpsertPartnerLinkLinkProps.new(\n external_id: \"123456\",\n tag_ids: [\n \"clux0rgak00011...\",\n ],\n ),\n)\n \nres = s.partners.upsert_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/createcustomerresponsebody.md b/docs/models/operations/createcustomerresponsebody.md index 1bf80fd..a9a471e 100644 --- a/docs/models/operations/createcustomerresponsebody.md +++ b/docs/models/operations/createcustomerresponsebody.md @@ -5,15 +5,15 @@ The customer was created. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | -| `name` | *::String* | :heavy_check_mark: | Name of the customer. | -| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | -| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | -| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | -| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | -| `link` | [T.nilable(::OpenApiSDK::Operations::CreateCustomerLink)](../../models/operations/createcustomerlink.md) | :heavy_minus_sign: | N/A | -| `partner` | [T.nilable(::OpenApiSDK::Operations::CreateCustomerPartner)](../../models/operations/createcustomerpartner.md) | :heavy_minus_sign: | N/A | -| `discount` | [T.nilable(::OpenApiSDK::Operations::CreateCustomerDiscount)](../../models/operations/createcustomerdiscount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | +| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | +| `name` | *::String* | :heavy_check_mark: | Name of the customer. | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | +| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | +| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | +| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | +| `link` | [T.nilable(::OpenApiSDK::Operations::CreateCustomerLink)](../../models/operations/createcustomerlink.md) | :heavy_minus_sign: | N/A | +| `partner` | [T.nilable(::OpenApiSDK::Operations::CreateCustomerPartner)](../../models/operations/createcustomerpartner.md) | :heavy_minus_sign: | N/A | +| `discount` | [T.nilable(::OpenApiSDK::Operations::CreateCustomerDiscount)](../../models/operations/createcustomerdiscount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createpartnerlinkresponse.md b/docs/models/operations/createpartnerlinkresponse.md index 455672e..b27be26 100644 --- a/docs/models/operations/createpartnerlinkresponse.md +++ b/docs/models/operations/createpartnerlinkresponse.md @@ -8,7 +8,7 @@ | `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 | +| `link_schema` | [T.nilable(::OpenApiSDK::Shared::LinkSchema)](../../models/shared/linkschema.md) | :heavy_minus_sign: | The created partner link | | `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. | diff --git a/docs/models/operations/deletecustomerrequest.md b/docs/models/operations/deletecustomerrequest.md index 6da00c0..2295a5a 100644 --- a/docs/models/operations/deletecustomerrequest.md +++ b/docs/models/operations/deletecustomerrequest.md @@ -3,6 +3,6 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | \ No newline at end of file diff --git a/docs/models/operations/deletecustomerresponsebody.md b/docs/models/operations/deletecustomerresponsebody.md index adeb855..5a9de82 100644 --- a/docs/models/operations/deletecustomerresponsebody.md +++ b/docs/models/operations/deletecustomerresponsebody.md @@ -5,6 +5,6 @@ The customer was deleted. ## Fields -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | \ No newline at end of file diff --git a/docs/models/operations/getcustomerrequest.md b/docs/models/operations/getcustomerrequest.md index ee83831..36fc093 100644 --- a/docs/models/operations/getcustomerrequest.md +++ b/docs/models/operations/getcustomerrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `include_expanded_fields` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | +| `include_expanded_fields` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). | \ No newline at end of file diff --git a/docs/models/operations/getcustomerresponsebody.md b/docs/models/operations/getcustomerresponsebody.md index cb7811e..6d7d4e7 100644 --- a/docs/models/operations/getcustomerresponsebody.md +++ b/docs/models/operations/getcustomerresponsebody.md @@ -5,15 +5,15 @@ The customer object. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | -| `name` | *::String* | :heavy_check_mark: | Name of the customer. | -| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | -| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | -| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | -| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | -| `link` | [T.nilable(::OpenApiSDK::Operations::GetCustomerLink)](../../models/operations/getcustomerlink.md) | :heavy_minus_sign: | N/A | -| `partner` | [T.nilable(::OpenApiSDK::Operations::GetCustomerPartner)](../../models/operations/getcustomerpartner.md) | :heavy_minus_sign: | N/A | -| `discount` | [T.nilable(::OpenApiSDK::Operations::GetCustomerDiscount)](../../models/operations/getcustomerdiscount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | +| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | +| `name` | *::String* | :heavy_check_mark: | Name of the customer. | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | +| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | +| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | +| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | +| `link` | [T.nilable(::OpenApiSDK::Operations::GetCustomerLink)](../../models/operations/getcustomerlink.md) | :heavy_minus_sign: | N/A | +| `partner` | [T.nilable(::OpenApiSDK::Operations::GetCustomerPartner)](../../models/operations/getcustomerpartner.md) | :heavy_minus_sign: | N/A | +| `discount` | [T.nilable(::OpenApiSDK::Operations::GetCustomerDiscount)](../../models/operations/getcustomerdiscount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/responsebody.md b/docs/models/operations/responsebody.md index 392f443..9ae67a1 100644 --- a/docs/models/operations/responsebody.md +++ b/docs/models/operations/responsebody.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | -| `name` | *::String* | :heavy_check_mark: | Name of the customer. | -| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | -| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | -| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | -| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | -| `link` | [T.nilable(::OpenApiSDK::Operations::Link)](../../models/operations/link.md) | :heavy_minus_sign: | N/A | -| `partner` | [T.nilable(::OpenApiSDK::Operations::Partner)](../../models/operations/partner.md) | :heavy_minus_sign: | N/A | -| `discount` | [T.nilable(::OpenApiSDK::Operations::Discount)](../../models/operations/discount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | +| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | +| `name` | *::String* | :heavy_check_mark: | Name of the customer. | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | +| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | +| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | +| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | +| `link` | [T.nilable(::OpenApiSDK::Operations::Link)](../../models/operations/link.md) | :heavy_minus_sign: | N/A | +| `partner` | [T.nilable(::OpenApiSDK::Operations::Partner)](../../models/operations/partner.md) | :heavy_minus_sign: | N/A | +| `discount` | [T.nilable(::OpenApiSDK::Operations::Discount)](../../models/operations/discount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatecustomerrequest.md b/docs/models/operations/updatecustomerrequest.md index 60946be..f948b06 100644 --- a/docs/models/operations/updatecustomerrequest.md +++ b/docs/models/operations/updatecustomerrequest.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `include_expanded_fields` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). | -| `request_body` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerRequestBody)](../../models/operations/updatecustomerrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | +| `include_expanded_fields` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether to include expanded fields on the customer (`link`, `partner`, `discount`). | +| `request_body` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerRequestBody)](../../models/operations/updatecustomerrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatecustomerresponsebody.md b/docs/models/operations/updatecustomerresponsebody.md index a32a17e..d6249d8 100644 --- a/docs/models/operations/updatecustomerresponsebody.md +++ b/docs/models/operations/updatecustomerresponsebody.md @@ -5,15 +5,15 @@ The customer was updated. ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | -| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | -| `name` | *::String* | :heavy_check_mark: | Name of the customer. | -| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | -| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | -| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | -| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | -| `link` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerLink)](../../models/operations/updatecustomerlink.md) | :heavy_minus_sign: | N/A | -| `partner` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerPartner)](../../models/operations/updatecustomerpartner.md) | :heavy_minus_sign: | N/A | -| `discount` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerDiscount)](../../models/operations/updatecustomerdiscount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | +| `external_id` | *::String* | :heavy_check_mark: | Unique identifier for the customer in the client's app. | +| `name` | *::String* | :heavy_check_mark: | Name of the customer. | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Email of the customer. | +| `avatar` | *T.nilable(::String)* | :heavy_minus_sign: | Avatar URL of the customer. | +| `country` | *T.nilable(::String)* | :heavy_minus_sign: | Country of the customer. | +| `created_at` | *::String* | :heavy_check_mark: | The date the customer was created. | +| `link` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerLink)](../../models/operations/updatecustomerlink.md) | :heavy_minus_sign: | N/A | +| `partner` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerPartner)](../../models/operations/updatecustomerpartner.md) | :heavy_minus_sign: | N/A | +| `discount` | [T.nilable(::OpenApiSDK::Operations::UpdateCustomerDiscount)](../../models/operations/updatecustomerdiscount.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/upsertpartnerlinklinkprops.md b/docs/models/operations/upsertpartnerlinklinkprops.md new file mode 100644 index 0000000..26e1e77 --- /dev/null +++ b/docs/models/operations/upsertpartnerlinklinkprops.md @@ -0,0 +1,35 @@ +# UpsertPartnerLinkLinkProps + +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/upsertpartnerlinkrequestbody.md b/docs/models/operations/upsertpartnerlinkrequestbody.md new file mode 100644 index 0000000..7eb938f --- /dev/null +++ b/docs/models/operations/upsertpartnerlinkrequestbody.md @@ -0,0 +1,13 @@ +# UpsertPartnerLinkRequestBody + + +## 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::UpsertPartnerLinkLinkProps)](../../models/operations/upsertpartnerlinklinkprops.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/upsertpartnerlinkresponse.md b/docs/models/operations/upsertpartnerlinkresponse.md new file mode 100644 index 0000000..8448bc8 --- /dev/null +++ b/docs/models/operations/upsertpartnerlinkresponse.md @@ -0,0 +1,20 @@ +# UpsertPartnerLinkResponse + + +## 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 upserted partner link | +| `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/customers/README.md b/docs/sdks/customers/README.md index fc7ce89..e73a82e 100644 --- a/docs/sdks/customers/README.md +++ b/docs/sdks/customers/README.md @@ -207,9 +207,9 @@ end ### Parameters -| Parameter | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `id` | *::String* | :heavy_check_mark: | The unique identifier of the customer in Dub. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). | ### Response diff --git a/docs/sdks/partners/README.md b/docs/sdks/partners/README.md index 193541f..4504d21 100644 --- a/docs/sdks/partners/README.md +++ b/docs/sdks/partners/README.md @@ -7,6 +7,7 @@ * [create](#create) - Create a new partner * [create_link](#create_link) - Create a link for a partner +* [upsert_link](#upsert_link) - Upsert a link for a partner ## create @@ -61,7 +62,7 @@ end ## create_link -Create a new link for a partner that is enrolled in your program +Create a new link for a partner that is enrolled in your program. ### Example Usage @@ -106,3 +107,52 @@ end **[T.nilable(::OpenApiSDK::Operations::CreatePartnerLinkResponse)](../../models/operations/createpartnerlinkresponse.md)** + + +## upsert_link + +Upsert a link for a partner that is enrolled in your program. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created. + +### Example Usage + +```ruby +require 'dub' + + +s = ::OpenApiSDK::Dub.new +s.config_security( + ::OpenApiSDK::Shared::Security.new( + token: "DUB_API_KEY", + ) +) + + +req = ::OpenApiSDK::Operations::UpsertPartnerLinkRequestBody.new( + program_id: "", + url: "https://unsteady-lobster.com/", + link_props: ::OpenApiSDK::Operations::UpsertPartnerLinkLinkProps.new( + external_id: "123456", + tag_ids: [ + "clux0rgak00011...", + ], + ), +) + +res = s.partners.upsert_link(req) + +if ! res.link_schema.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `request` | [::OpenApiSDK::Operations::UpsertPartnerLinkRequestBody](../../models/operations/upsertpartnerlinkrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(::OpenApiSDK::Operations::UpsertPartnerLinkResponse)](../../models/operations/upsertpartnerlinkresponse.md)** + diff --git a/dub.gemspec b/dub.gemspec index 771e9ce..249b9d0 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.61' + s.version = '0.2.2-alpha.62' 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 e637451..cae40c9 100644 --- a/lib/open_api_sdk/models/operations.rb +++ b/lib/open_api_sdk/models/operations.rb @@ -130,6 +130,9 @@ module Operations 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 :UpsertPartnerLinkLinkProps, 'open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb' + autoload :UpsertPartnerLinkRequestBody, 'open_api_sdk/models/operations/upsertpartnerlink_requestbody.rb' + autoload :UpsertPartnerLinkResponse, 'open_api_sdk/models/operations/upsertpartnerlink_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/createcustomer_responsebody.rb b/lib/open_api_sdk/models/operations/createcustomer_responsebody.rb index 3c1fbb2..e4ca13f 100644 --- a/lib/open_api_sdk/models/operations/createcustomer_responsebody.rb +++ b/lib/open_api_sdk/models/operations/createcustomer_responsebody.rb @@ -15,7 +15,7 @@ class CreateCustomerResponseBody < ::OpenApiSDK::Utils::FieldAugmented field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } } # Unique identifier for the customer in the client's app. field :external_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('externalId') } } - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } } # Name of the customer. field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } } diff --git a/lib/open_api_sdk/models/operations/createpartnerlink_response.rb b/lib/open_api_sdk/models/operations/createpartnerlink_response.rb index 7336915..f4a27fe 100644 --- a/lib/open_api_sdk/models/operations/createpartnerlink_response.rb +++ b/lib/open_api_sdk/models/operations/createpartnerlink_response.rb @@ -27,7 +27,7 @@ class CreatePartnerLinkResponse < ::OpenApiSDK::Utils::FieldAugmented 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 + # The created partner link field :link_schema, T.nilable(::OpenApiSDK::Shared::LinkSchema) # The server cannot find the requested resource. field :not_found, T.nilable(::OpenApiSDK::Shared::NotFound) diff --git a/lib/open_api_sdk/models/operations/deletecustomer_request.rb b/lib/open_api_sdk/models/operations/deletecustomer_request.rb index 7a875ce..9cd07ed 100644 --- a/lib/open_api_sdk/models/operations/deletecustomer_request.rb +++ b/lib/open_api_sdk/models/operations/deletecustomer_request.rb @@ -11,7 +11,7 @@ module Operations class DeleteCustomerRequest < ::OpenApiSDK::Utils::FieldAugmented extend T::Sig - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': false } } diff --git a/lib/open_api_sdk/models/operations/deletecustomer_responsebody.rb b/lib/open_api_sdk/models/operations/deletecustomer_responsebody.rb index 5bcb28a..fc56f2e 100644 --- a/lib/open_api_sdk/models/operations/deletecustomer_responsebody.rb +++ b/lib/open_api_sdk/models/operations/deletecustomer_responsebody.rb @@ -11,7 +11,7 @@ module Operations class DeleteCustomerResponseBody < ::OpenApiSDK::Utils::FieldAugmented extend T::Sig - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } } diff --git a/lib/open_api_sdk/models/operations/getcustomer_request.rb b/lib/open_api_sdk/models/operations/getcustomer_request.rb index 87b7ea7..dcb31b7 100644 --- a/lib/open_api_sdk/models/operations/getcustomer_request.rb +++ b/lib/open_api_sdk/models/operations/getcustomer_request.rb @@ -11,7 +11,7 @@ module Operations class GetCustomerRequest < ::OpenApiSDK::Utils::FieldAugmented extend T::Sig - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': false } } # Whether to include expanded fields on the customer (`link`, `partner`, `discount`). field :include_expanded_fields, T.nilable(T::Boolean), { 'query_param': { 'field_name': 'includeExpandedFields', 'style': 'form', 'explode': true } } diff --git a/lib/open_api_sdk/models/operations/getcustomer_responsebody.rb b/lib/open_api_sdk/models/operations/getcustomer_responsebody.rb index a3835fd..7868e37 100644 --- a/lib/open_api_sdk/models/operations/getcustomer_responsebody.rb +++ b/lib/open_api_sdk/models/operations/getcustomer_responsebody.rb @@ -15,7 +15,7 @@ class GetCustomerResponseBody < ::OpenApiSDK::Utils::FieldAugmented field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } } # Unique identifier for the customer in the client's app. field :external_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('externalId') } } - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } } # Name of the customer. field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } } diff --git a/lib/open_api_sdk/models/operations/responsebody.rb b/lib/open_api_sdk/models/operations/responsebody.rb index 082e695..20800dc 100644 --- a/lib/open_api_sdk/models/operations/responsebody.rb +++ b/lib/open_api_sdk/models/operations/responsebody.rb @@ -15,7 +15,7 @@ class ResponseBody < ::OpenApiSDK::Utils::FieldAugmented field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } } # Unique identifier for the customer in the client's app. field :external_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('externalId') } } - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } } # Name of the customer. field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } } diff --git a/lib/open_api_sdk/models/operations/updatecustomer_request.rb b/lib/open_api_sdk/models/operations/updatecustomer_request.rb index 1b9462f..e202aa8 100644 --- a/lib/open_api_sdk/models/operations/updatecustomer_request.rb +++ b/lib/open_api_sdk/models/operations/updatecustomer_request.rb @@ -11,7 +11,7 @@ module Operations class UpdateCustomerRequest < ::OpenApiSDK::Utils::FieldAugmented extend T::Sig - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': false } } # Whether to include expanded fields on the customer (`link`, `partner`, `discount`). field :include_expanded_fields, T.nilable(T::Boolean), { 'query_param': { 'field_name': 'includeExpandedFields', 'style': 'form', 'explode': true } } diff --git a/lib/open_api_sdk/models/operations/updatecustomer_responsebody.rb b/lib/open_api_sdk/models/operations/updatecustomer_responsebody.rb index 7504c90..510c4af 100644 --- a/lib/open_api_sdk/models/operations/updatecustomer_responsebody.rb +++ b/lib/open_api_sdk/models/operations/updatecustomer_responsebody.rb @@ -15,7 +15,7 @@ class UpdateCustomerResponseBody < ::OpenApiSDK::Utils::FieldAugmented field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } } # Unique identifier for the customer in the client's app. field :external_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('externalId') } } - # The unique identifier of the customer in Dub. + # The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`). field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } } # Name of the customer. field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } } diff --git a/lib/open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb b/lib/open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb new file mode 100644 index 0000000..a4a66e6 --- /dev/null +++ b/lib/open_api_sdk/models/operations/upsertpartnerlink_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 UpsertPartnerLinkLinkProps < ::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/upsertpartnerlink_requestbody.rb b/lib/open_api_sdk/models/operations/upsertpartnerlink_requestbody.rb new file mode 100644 index 0000000..e3149c3 --- /dev/null +++ b/lib/open_api_sdk/models/operations/upsertpartnerlink_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 UpsertPartnerLinkRequestBody < ::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::UpsertPartnerLinkLinkProps), { '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::UpsertPartnerLinkLinkProps), 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/upsertpartnerlink_response.rb b/lib/open_api_sdk/models/operations/upsertpartnerlink_response.rb new file mode 100644 index 0000000..f9ae197 --- /dev/null +++ b/lib/open_api_sdk/models/operations/upsertpartnerlink_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 UpsertPartnerLinkResponse < ::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 upserted partner link + 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 5b33c31..0169e0c 100644 --- a/lib/open_api_sdk/partners.rb +++ b/lib/open_api_sdk/partners.rb @@ -108,7 +108,7 @@ def create(request) 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 + # 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" @@ -189,5 +189,91 @@ def create_link(request) res end + + + sig { params(request: T.nilable(::OpenApiSDK::Operations::UpsertPartnerLinkRequestBody)).returns(::OpenApiSDK::Operations::UpsertPartnerLinkResponse) } + def upsert_link(request) + # upsert_link - Upsert a link for a partner + # Upsert a link for a partner that is enrolled in your program. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/partners/links/upsert" + 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.put(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::UpsertPartnerLinkResponse.new( + status_code: r.status, content_type: content_type, raw_response: r + ) + if r.status == 200 + 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 b53f5c8..2305b17 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.61' - @gen_version = '2.503.2' - @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.61 2.503.2 0.0.1 dub' + @sdk_version = '0.2.2-alpha.62' + @gen_version = '2.506.0' + @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.62 2.506.0 0.0.1 dub' end sig { returns([String, T::Hash[Symbol, String]]) }