From 9e20d4282ef2bb48861b450f7fc848b4b84f45df Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 23 Jul 2024 03:26:06 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.345.1 --- .speakeasy/gen.lock | 13 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 12 +- CONTRIBUTING.md | 26 ++ RELEASES.md | 12 +- codeSamples.yaml | 354 +++++++++--------- docs/models/components/linkschema.md | 1 + .../operations/createlinkrequestbody.md | 7 +- docs/models/operations/data.md | 7 +- docs/models/operations/requestbody.md | 7 +- .../operations/updatelinkrequestbody.md | 7 +- .../operations/upsertlinkrequestbody.md | 7 +- dub.go | 6 +- internal/utils/queryparams.go | 5 + models/components/linkschema.go | 9 + models/operations/bulkcreatelinks.go | 15 +- models/operations/bulkupdatelinks.go | 15 +- models/operations/createlink.go | 15 +- models/operations/options.go | 14 + models/operations/updatelink.go | 15 +- models/operations/upsertlink.go | 15 +- 21 files changed, 340 insertions(+), 224 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index daa764e..772d9c4 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 1773e9c7-1931-4663-8ac8-4deaf8db76f5 management: - docChecksum: d0b5f8295789a6e5094c2a864663e7e5 + docChecksum: ff99d725530dd92bf929c57a1840df75 docVersion: 0.0.1 - speakeasyVersion: 1.335.2 - generationVersion: 2.372.3 - releaseVersion: 0.5.0 - configChecksum: 9b1e5088d20454a155a12dc6327558f1 + speakeasyVersion: 1.345.1 + generationVersion: 2.378.1 + releaseVersion: 0.6.0 + configChecksum: c061d57e659dc9af6059fd898a004acb repoURL: https://github.com/dubinc/dub-go.git installationURL: https://github.com/dubinc/dub-go features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.4 - core: 3.4.15 + core: 3.5.0 defaultEnabledRetries: 0.2.0 deprecations: 2.81.1 envVarSecurityUsage: 0.2.0 @@ -276,3 +276,4 @@ generatedFiles: - models/operations/options.go - .gitattributes - internal/hooks/hooks.go + - CONTRIBUTING.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index c1c041a..0303a83 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.5.0 + version: 0.6.0 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 25c853e..37b2365 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.335.2 +speakeasyVersion: 1.345.1 sources: dub: sourceNamespace: dub - sourceRevisionDigest: sha256:c587bff6e3db7867005682cab20e660641bbf2c1ea28cf3cc92a550d84029f2c - sourceBlobDigest: sha256:5e204d44356874328856c99a25ed0126496096cd23f6705616ca44c3480e35e3 + sourceRevisionDigest: sha256:ef976222d48aa35608b1a3ea176361d7cccd6ea28281fca063f6e265af129e7f + sourceBlobDigest: sha256:e60ad4ae8e7bfafaa8c5299f0a10760706acf65d110e3520333973f42e99ef0e tags: - latest - main @@ -11,10 +11,10 @@ targets: my-first-target: source: dub sourceNamespace: dub - sourceRevisionDigest: sha256:c587bff6e3db7867005682cab20e660641bbf2c1ea28cf3cc92a550d84029f2c - sourceBlobDigest: sha256:5e204d44356874328856c99a25ed0126496096cd23f6705616ca44c3480e35e3 + sourceRevisionDigest: sha256:ef976222d48aa35608b1a3ea176361d7cccd6ea28281fca063f6e265af129e7f + sourceBlobDigest: sha256:e60ad4ae8e7bfafaa8c5299f0a10760706acf65d110e3520333973f42e99ef0e codeSamplesNamespace: code-samples-go-my-first-target - codeSamplesRevisionDigest: sha256:acdb5910b5527b2634d2e1cee2f2c3b72497c307ea2bf482b67dd2eb0c26d583 + codeSamplesRevisionDigest: sha256:18535d7be5a9321d79aa3e479cc36c4950845c989d993b70188dbd3d6f9b9e11 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d585717 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/RELEASES.md b/RELEASES.md index 3f47b68..e71b26d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -198,4 +198,14 @@ Based on: ### Generated - [go v0.5.0] . ### Releases -- [Go v0.5.0] https://github.com/dubinc/dub-go/releases/tag/v0.5.0 - . \ No newline at end of file +- [Go v0.5.0] https://github.com/dubinc/dub-go/releases/tag/v0.5.0 - . + +## 2024-07-23 03:24:54 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.345.1 (2.378.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.6.0] . +### Releases +- [Go v0.6.0] https://github.com/dubinc/dub-go/releases/tag/v0.6.0 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 92ea388..599f325 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,16 +3,17 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: - - target: $["paths"]["/links/{linkId}"]["delete"] + - target: $["paths"]["/links/count"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "deleteLink" + "label": "getLinksCount" "source": |- package main import( dubgo "github.com/dubinc/dub-go" + "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -21,9 +22,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var linkID string = "" + request := operations.GetLinksCountRequest{} ctx := context.Background() - res, err := s.Links.Delete(ctx, linkID) + res, err := s.Links.Count(ctx, request) if err != nil { log.Fatal(err) } @@ -31,11 +32,11 @@ actions: // handle response } } - - target: $["paths"]["/links/bulk"]["patch"] + - target: $["paths"]["/analytics"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "bulkUpdateLinks" + "label": "retrieveAnalytics" "source": |- package main @@ -50,21 +51,16 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.BulkUpdateLinksRequestBody = &operations.BulkUpdateLinksRequestBody{ - LinkIds: []string{ - "", - }, - Data: operations.Data{ - URL: dubgo.String("https://google.com"), - TagIds: operations.CreateBulkUpdateLinksTagIdsArrayOfStr( - []string{ - "clux0rgak00011...", - }, - ), - }, + request := operations.RetrieveAnalyticsRequest{ + Timezone: dubgo.String("America/New_York"), + City: dubgo.String("New York"), + Device: dubgo.String("Desktop"), + Browser: dubgo.String("Chrome"), + Os: dubgo.String("Windows"), + Referer: dubgo.String("google.com"), } ctx := context.Background() - res, err := s.Links.UpdateMany(ctx, request) + res, err := s.Analytics.Retrieve(ctx, request) if err != nil { log.Fatal(err) } @@ -72,17 +68,16 @@ actions: // handle response } } - - target: $["paths"]["/qr"]["get"] + - target: $["paths"]["/links/{linkId}"]["delete"] update: "x-codeSamples": - "lang": "go" - "label": "getQRCode" + "label": "deleteLink" "source": |- package main import( dubgo "github.com/dubinc/dub-go" - "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -91,11 +86,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetQRCodeRequest{ - URL: "https://brief-micronutrient.org", - } + var linkID string = "" ctx := context.Background() - res, err := s.QRCodes.Get(ctx, request) + res, err := s.Links.Delete(ctx, linkID) if err != nil { log.Fatal(err) } @@ -103,11 +96,11 @@ actions: // handle response } } - - target: $["paths"]["/analytics"]["get"] + - target: $["paths"]["/links/{linkId}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "retrieveAnalytics" + "label": "updateLink" "source": |- package main @@ -122,16 +115,19 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.RetrieveAnalyticsRequest{ - Timezone: dubgo.String("America/New_York"), - City: dubgo.String("New York"), - Device: dubgo.String("Desktop"), - Browser: dubgo.String("Chrome"), - Os: dubgo.String("Windows"), - Referer: dubgo.String("google.com"), + var linkID string = "" + + var requestBody *operations.UpdateLinkRequestBody = &operations.UpdateLinkRequestBody{ + URL: dubgo.String("https://google.com"), + ExternalID: dubgo.String("123456"), + TagIds: operations.CreateUpdateLinkTagIdsArrayOfStr( + []string{ + "clux0rgak00011...", + }, + ), } ctx := context.Background() - res, err := s.Analytics.Retrieve(ctx, request) + res, err := s.Links.Update(ctx, linkID, requestBody) if err != nil { log.Fatal(err) } @@ -139,16 +135,17 @@ actions: // handle response } } - - target: $["paths"]["/domains/{slug}"]["delete"] + - target: $["paths"]["/links/bulk"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "deleteDomain" + "label": "bulkCreateLinks" "source": |- package main import( dubgo "github.com/dubinc/dub-go" + "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -157,9 +154,19 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var slug string = "acme.com" + var request []operations.RequestBody = []operations.RequestBody{ + operations.RequestBody{ + URL: "https://google.com", + ExternalID: dubgo.String("123456"), + TagIds: operations.CreateBulkCreateLinksTagIdsArrayOfStr( + []string{ + "clux0rgak00011...", + }, + ), + }, + } ctx := context.Background() - res, err := s.Domains.Delete(ctx, slug) + res, err := s.Links.CreateMany(ctx, request) if err != nil { log.Fatal(err) } @@ -167,11 +174,11 @@ actions: // handle response } } - - target: $["paths"]["/domains/{slug}"]["patch"] + - target: $["paths"]["/links/bulk"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "updateDomain" + "label": "bulkUpdateLinks" "source": |- package main @@ -186,16 +193,21 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var slug string = "acme.com" - - var requestBody *operations.UpdateDomainRequestBody = &operations.UpdateDomainRequestBody{ - Slug: dubgo.String("acme.com"), - ExpiredURL: dubgo.String("https://acme.com/expired"), - Archived: dubgo.Bool(false), - Placeholder: dubgo.String("https://dub.co/help/article/what-is-dub"), + var request *operations.BulkUpdateLinksRequestBody = &operations.BulkUpdateLinksRequestBody{ + LinkIds: []string{ + "", + }, + Data: operations.Data{ + URL: dubgo.String("https://google.com"), + TagIds: operations.CreateBulkUpdateLinksTagIdsArrayOfStr( + []string{ + "clux0rgak00011...", + }, + ), + }, } ctx := context.Background() - res, err := s.Domains.Update(ctx, slug, requestBody) + res, err := s.Links.UpdateMany(ctx, request) if err != nil { log.Fatal(err) } @@ -203,11 +215,11 @@ actions: // handle response } } - - target: $["paths"]["/links/upsert"]["put"] + - target: $["paths"]["/qr"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "upsertLink" + "label": "getQRCode" "source": |- package main @@ -222,17 +234,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.UpsertLinkRequestBody = &operations.UpsertLinkRequestBody{ - URL: "https://google.com", - ExternalID: dubgo.String("123456"), - TagIds: operations.CreateUpsertLinkTagIdsArrayOfStr( - []string{ - "clux0rgak00011...", - }, - ), + request := operations.GetQRCodeRequest{ + URL: "https://brief-micronutrient.org", } ctx := context.Background() - res, err := s.Links.Upsert(ctx, request) + res, err := s.QRCodes.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -240,11 +246,11 @@ actions: // handle response } } - - target: $["paths"]["/links/count"]["get"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "getLinksCount" + "label": "updateWorkspace" "source": |- package main @@ -259,9 +265,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetLinksCountRequest{} + var idOrSlug string = "" + + var requestBody *operations.UpdateWorkspaceRequestBody = &operations.UpdateWorkspaceRequestBody{} ctx := context.Background() - res, err := s.Links.Count(ctx, request) + res, err := s.Workspaces.Update(ctx, idOrSlug, requestBody) if err != nil { log.Fatal(err) } @@ -269,11 +277,11 @@ actions: // handle response } } - - target: $["paths"]["/links/bulk"]["post"] + - target: $["paths"]["/links/upsert"]["put"] update: "x-codeSamples": - "lang": "go" - "label": "bulkCreateLinks" + "label": "upsertLink" "source": |- package main @@ -288,19 +296,17 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request []operations.RequestBody = []operations.RequestBody{ - operations.RequestBody{ - URL: "https://google.com", - ExternalID: dubgo.String("123456"), - TagIds: operations.CreateBulkCreateLinksTagIdsArrayOfStr( - []string{ - "clux0rgak00011...", - }, - ), - }, + var request *operations.UpsertLinkRequestBody = &operations.UpsertLinkRequestBody{ + URL: "https://google.com", + ExternalID: dubgo.String("123456"), + TagIds: operations.CreateUpsertLinkTagIdsArrayOfStr( + []string{ + "clux0rgak00011...", + }, + ), } ctx := context.Background() - res, err := s.Links.CreateMany(ctx, request) + res, err := s.Links.Upsert(ctx, request) if err != nil { log.Fatal(err) } @@ -308,11 +314,11 @@ actions: // handle response } } - - target: $["paths"]["/tags/{id}"]["patch"] + - target: $["paths"]["/links/info"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "updateTag" + "label": "getLinkInfo" "source": |- package main @@ -327,11 +333,12 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var id string = "" - - var requestBody *operations.UpdateTagRequestBody = &operations.UpdateTagRequestBody{} + request := operations.GetLinkInfoRequest{ + LinkID: dubgo.String("clux0rgak00011..."), + ExternalID: dubgo.String("ext_123456"), + } ctx := context.Background() - res, err := s.Tags.Update(ctx, id, requestBody) + res, err := s.Links.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -339,11 +346,11 @@ actions: // handle response } } - - target: $["paths"]["/links"]["post"] + - target: $["paths"]["/domains"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "createLink" + "label": "createDomain" "source": |- package main @@ -358,17 +365,14 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.CreateLinkRequestBody = &operations.CreateLinkRequestBody{ - URL: "https://google.com", - ExternalID: dubgo.String("123456"), - TagIds: operations.CreateTagIdsArrayOfStr( - []string{ - "clux0rgak00011...", - }, - ), + var request *operations.CreateDomainRequestBody = &operations.CreateDomainRequestBody{ + Slug: "acme.com", + ExpiredURL: dubgo.String("https://acme.com/expired"), + Archived: dubgo.Bool(false), + Placeholder: dubgo.String("https://dub.co/help/article/what-is-dub"), } ctx := context.Background() - res, err := s.Links.Create(ctx, request) + res, err := s.Domains.Create(ctx, request) if err != nil { log.Fatal(err) } @@ -376,11 +380,11 @@ actions: // handle response } } - - target: $["paths"]["/links/{linkId}"]["patch"] + - target: $["paths"]["/track/sale"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "updateLink" + "label": "trackSale" "source": |- package main @@ -395,19 +399,14 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var linkID string = "" - - var requestBody *operations.UpdateLinkRequestBody = &operations.UpdateLinkRequestBody{ - URL: dubgo.String("https://google.com"), - ExternalID: dubgo.String("123456"), - TagIds: operations.CreateUpdateLinkTagIdsArrayOfStr( - []string{ - "clux0rgak00011...", - }, - ), + var request *operations.TrackSaleRequestBody = &operations.TrackSaleRequestBody{ + CustomerID: "", + Amount: 996500, + PaymentProcessor: operations.PaymentProcessorShopify, + EventName: dubgo.String("Purchase"), } ctx := context.Background() - res, err := s.Links.Update(ctx, linkID, requestBody) + res, err := s.Track.Sale(ctx, request) if err != nil { log.Fatal(err) } @@ -415,11 +414,11 @@ actions: // handle response } } - - target: $["paths"]["/workspaces/{idOrSlug}"]["patch"] + - target: $["paths"]["/tags/{id}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "updateWorkspace" + "label": "updateTag" "source": |- package main @@ -434,11 +433,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var idOrSlug string = "" + var id string = "" - var requestBody *operations.UpdateWorkspaceRequestBody = &operations.UpdateWorkspaceRequestBody{} + var requestBody *operations.UpdateTagRequestBody = &operations.UpdateTagRequestBody{} ctx := context.Background() - res, err := s.Workspaces.Update(ctx, idOrSlug, requestBody) + res, err := s.Tags.Update(ctx, id, requestBody) if err != nil { log.Fatal(err) } @@ -446,11 +445,11 @@ actions: // handle response } } - - target: $["paths"]["/tags"]["get"] + - target: $["paths"]["/domains"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getTags" + "label": "listDomains" "source": |- package main @@ -466,7 +465,7 @@ actions: ) ctx := context.Background() - res, err := s.Tags.List(ctx) + res, err := s.Domains.List(ctx) if err != nil { log.Fatal(err) } @@ -474,11 +473,11 @@ actions: // handle response } } - - target: $["paths"]["/tags"]["post"] + - target: $["paths"]["/track/lead"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "createTag" + "label": "trackLead" "source": |- package main @@ -493,9 +492,13 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.CreateTagRequestBody = &operations.CreateTagRequestBody{} + var request *operations.TrackLeadRequestBody = &operations.TrackLeadRequestBody{ + ClickID: "", + EventName: "Sign up", + CustomerID: "", + } ctx := context.Background() - res, err := s.Tags.Create(ctx, request) + res, err := s.Track.Lead(ctx, request) if err != nil { log.Fatal(err) } @@ -503,16 +506,17 @@ actions: // handle response } } - - target: $["paths"]["/domains"]["get"] + - target: $["paths"]["/track/customer"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "listDomains" + "label": "trackCustomer" "source": |- package main import( dubgo "github.com/dubinc/dub-go" + "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -521,9 +525,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - + var request *operations.TrackCustomerRequestBody = &operations.TrackCustomerRequestBody{ + CustomerID: "", + } ctx := context.Background() - res, err := s.Domains.List(ctx) + res, err := s.Track.Customer(ctx, request) if err != nil { log.Fatal(err) } @@ -531,11 +537,11 @@ actions: // handle response } } - - target: $["paths"]["/domains"]["post"] + - target: $["paths"]["/metatags"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "createDomain" + "label": "getMetatags" "source": |- package main @@ -550,14 +556,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.CreateDomainRequestBody = &operations.CreateDomainRequestBody{ - Slug: "acme.com", - ExpiredURL: dubgo.String("https://acme.com/expired"), - Archived: dubgo.Bool(false), - Placeholder: dubgo.String("https://dub.co/help/article/what-is-dub"), + request := operations.GetMetatagsRequest{ + URL: "https://dub.co", } ctx := context.Background() - res, err := s.Domains.Create(ctx, request) + res, err := s.Metatags.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -565,11 +568,11 @@ actions: // handle response } } - - target: $["paths"]["/track/lead"]["post"] + - target: $["paths"]["/tags"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "trackLead" + "label": "createTag" "source": |- package main @@ -584,13 +587,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.TrackLeadRequestBody = &operations.TrackLeadRequestBody{ - ClickID: "", - EventName: "Sign up", - CustomerID: "", - } + var request *operations.CreateTagRequestBody = &operations.CreateTagRequestBody{} ctx := context.Background() - res, err := s.Track.Lead(ctx, request) + res, err := s.Tags.Create(ctx, request) if err != nil { log.Fatal(err) } @@ -598,11 +597,11 @@ actions: // handle response } } - - target: $["paths"]["/track/sale"]["post"] + - target: $["paths"]["/domains/{slug}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "trackSale" + "label": "updateDomain" "source": |- package main @@ -617,14 +616,16 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.TrackSaleRequestBody = &operations.TrackSaleRequestBody{ - CustomerID: "", - Amount: 996500, - PaymentProcessor: operations.PaymentProcessorShopify, - EventName: dubgo.String("Purchase"), + var slug string = "acme.com" + + var requestBody *operations.UpdateDomainRequestBody = &operations.UpdateDomainRequestBody{ + Slug: dubgo.String("acme.com"), + ExpiredURL: dubgo.String("https://acme.com/expired"), + Archived: dubgo.Bool(false), + Placeholder: dubgo.String("https://dub.co/help/article/what-is-dub"), } ctx := context.Background() - res, err := s.Track.Sale(ctx, request) + res, err := s.Domains.Update(ctx, slug, requestBody) if err != nil { log.Fatal(err) } @@ -632,11 +633,11 @@ actions: // handle response } } - - target: $["paths"]["/track/customer"]["post"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "trackCustomer" + "label": "getWorkspace" "source": |- package main @@ -651,11 +652,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.TrackCustomerRequestBody = &operations.TrackCustomerRequestBody{ - CustomerID: "", + request := operations.GetWorkspaceRequest{ + IDOrSlug: "", } ctx := context.Background() - res, err := s.Track.Customer(ctx, request) + res, err := s.Workspaces.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -663,17 +664,16 @@ actions: // handle response } } - - target: $["paths"]["/metatags"]["get"] + - target: $["paths"]["/tags"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getMetatags" + "label": "getTags" "source": |- package main import( dubgo "github.com/dubinc/dub-go" - "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -682,11 +682,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetMetatagsRequest{ - URL: "https://dub.co", - } + ctx := context.Background() - res, err := s.Metatags.Get(ctx, request) + res, err := s.Tags.List(ctx) if err != nil { log.Fatal(err) } @@ -694,17 +692,16 @@ actions: // handle response } } - - target: $["paths"]["/links"]["get"] + - target: $["paths"]["/domains/{slug}"]["delete"] update: "x-codeSamples": - "lang": "go" - "label": "getLinks" + "label": "deleteDomain" "source": |- package main import( dubgo "github.com/dubinc/dub-go" - "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -713,9 +710,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetLinksRequest{} + var slug string = "acme.com" ctx := context.Background() - res, err := s.Links.List(ctx, request) + res, err := s.Domains.Delete(ctx, slug) if err != nil { log.Fatal(err) } @@ -723,11 +720,11 @@ actions: // handle response } } - - target: $["paths"]["/links/info"]["get"] + - target: $["paths"]["/links"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "getLinkInfo" + "label": "createLink" "source": |- package main @@ -742,12 +739,17 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetLinkInfoRequest{ - LinkID: dubgo.String("clux0rgak00011..."), - ExternalID: dubgo.String("ext_123456"), + var request *operations.CreateLinkRequestBody = &operations.CreateLinkRequestBody{ + URL: "https://google.com", + ExternalID: dubgo.String("123456"), + TagIds: operations.CreateTagIdsArrayOfStr( + []string{ + "clux0rgak00011...", + }, + ), } ctx := context.Background() - res, err := s.Links.Get(ctx, request) + res, err := s.Links.Create(ctx, request) if err != nil { log.Fatal(err) } @@ -755,11 +757,11 @@ actions: // handle response } } - - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] + - target: $["paths"]["/links"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getWorkspace" + "label": "getLinks" "source": |- package main @@ -774,11 +776,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetWorkspaceRequest{ - IDOrSlug: "", - } + request := operations.GetLinksRequest{} ctx := context.Background() - res, err := s.Workspaces.Get(ctx, request) + res, err := s.Links.List(ctx, request) if err != nil { log.Fatal(err) } diff --git a/docs/models/components/linkschema.md b/docs/models/components/linkschema.md index 21b474e..ea003de 100644 --- a/docs/models/components/linkschema.md +++ b/docs/models/components/linkschema.md @@ -19,6 +19,7 @@ | `Title` | *string* | :heavy_check_mark: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | `Description` | *string* | :heavy_check_mark: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | `Image` | *string* | :heavy_check_mark: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `Video` | *string* | :heavy_check_mark: | 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` | **bool* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | `DoIndex` | **bool* | :heavy_minus_sign: | Whether to allow search engines to index the short link. | | `Ios` | *string* | :heavy_check_mark: | The iOS destination URL for the short link for iOS device targeting. | diff --git a/docs/models/operations/createlinkrequestbody.md b/docs/models/operations/createlinkrequestbody.md index a5477d8..b6f9236 100644 --- a/docs/models/operations/createlinkrequestbody.md +++ b/docs/models/operations/createlinkrequestbody.md @@ -21,9 +21,10 @@ | `ExpiredURL` | **string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `Password` | **string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `Proxy` | **bool* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `Title` | **string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Description` | **string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Image` | **string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `Title` | **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` | **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` | **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` | **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` | **bool* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `Ios` | **string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `Android` | **string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/data.md b/docs/models/operations/data.md index 36ebc2f..1b4e1ea 100644 --- a/docs/models/operations/data.md +++ b/docs/models/operations/data.md @@ -17,9 +17,10 @@ | `ExpiredURL` | **string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `Password` | **string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `Proxy` | **bool* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `Title` | **string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Description` | **string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Image` | **string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `Title` | **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` | **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` | **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` | **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` | **bool* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `Ios` | **string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `Android` | **string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/requestbody.md b/docs/models/operations/requestbody.md index 26b3e75..5e42548 100644 --- a/docs/models/operations/requestbody.md +++ b/docs/models/operations/requestbody.md @@ -21,9 +21,10 @@ | `ExpiredURL` | **string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `Password` | **string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `Proxy` | **bool* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `Title` | **string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Description` | **string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Image` | **string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `Title` | **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` | **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` | **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` | **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` | **bool* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `Ios` | **string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `Android` | **string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/updatelinkrequestbody.md b/docs/models/operations/updatelinkrequestbody.md index 6921f0a..80a10f1 100644 --- a/docs/models/operations/updatelinkrequestbody.md +++ b/docs/models/operations/updatelinkrequestbody.md @@ -21,9 +21,10 @@ | `ExpiredURL` | **string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `Password` | **string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `Proxy` | **bool* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `Title` | **string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Description` | **string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Image` | **string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `Title` | **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` | **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` | **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` | **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` | **bool* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `Ios` | **string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `Android` | **string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/upsertlinkrequestbody.md b/docs/models/operations/upsertlinkrequestbody.md index 38ee6c1..c893b43 100644 --- a/docs/models/operations/upsertlinkrequestbody.md +++ b/docs/models/operations/upsertlinkrequestbody.md @@ -21,9 +21,10 @@ | `ExpiredURL` | **string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `Password` | **string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `Proxy` | **bool* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `Title` | **string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Description` | **string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `Image` | **string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `Title` | **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` | **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` | **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` | **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` | **bool* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `Ios` | **string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `Android` | **string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/dub.go b/dub.go index 33aee2a..aab5ccf 100644 --- a/dub.go +++ b/dub.go @@ -153,9 +153,9 @@ func New(opts ...SDKOption) *Dub { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.1", - SDKVersion: "0.5.0", - GenVersion: "2.372.3", - UserAgent: "speakeasy-sdk/go 0.5.0 2.372.3 0.0.1 github.com/dubinc/dub-go", + SDKVersion: "0.6.0", + GenVersion: "2.378.1", + UserAgent: "speakeasy-sdk/go 0.6.0 2.378.1 0.0.1 github.com/dubinc/dub-go", Hooks: hooks.New(), }, } diff --git a/internal/utils/queryparams.go b/internal/utils/queryparams.go index 10fc8a4..b0ded92 100644 --- a/internal/utils/queryparams.go +++ b/internal/utils/queryparams.go @@ -18,6 +18,11 @@ import ( ) func PopulateQueryParams(_ context.Context, req *http.Request, queryParams interface{}, globals interface{}) error { + // Query parameters may already be present from overriding URL + if req.URL.RawQuery != "" { + return nil + } + values := url.Values{} globalsAlreadyPopulated, err := populateQueryParams(queryParams, globals, values, []string{}) diff --git a/models/components/linkschema.go b/models/components/linkschema.go index a08da9d..d8c35a0 100644 --- a/models/components/linkschema.go +++ b/models/components/linkschema.go @@ -2039,6 +2039,8 @@ type LinkSchema struct { Description *string `json:"description"` // The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. Image *string `json:"image"` + // 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 + Video *string `json:"video"` // Whether the short link uses link cloaking. Rewrite *bool `default:"false" json:"rewrite"` // Whether to allow search engines to index the short link. @@ -2204,6 +2206,13 @@ func (o *LinkSchema) GetImage() *string { return o.Image } +func (o *LinkSchema) GetVideo() *string { + if o == nil { + return nil + } + return o.Video +} + func (o *LinkSchema) GetRewrite() *bool { if o == nil { return nil diff --git a/models/operations/bulkcreatelinks.go b/models/operations/bulkcreatelinks.go index 38e8637..d80ad43 100644 --- a/models/operations/bulkcreatelinks.go +++ b/models/operations/bulkcreatelinks.go @@ -172,12 +172,14 @@ type RequestBody struct { Password *string `json:"password,omitempty"` // Whether the short link uses Custom Social Media Cards feature. Proxy *bool `default:"false" json:"proxy"` - // The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Title *string `json:"title,omitempty"` - // The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Description *string `json:"description,omitempty"` - // The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Image *string `json:"image,omitempty"` + // 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 + Video *string `json:"video,omitempty"` // Whether the short link uses link cloaking. Rewrite *bool `default:"false" json:"rewrite"` // The iOS destination URL for the short link for iOS device targeting. @@ -334,6 +336,13 @@ func (o *RequestBody) GetImage() *string { return o.Image } +func (o *RequestBody) GetVideo() *string { + if o == nil { + return nil + } + return o.Video +} + func (o *RequestBody) GetRewrite() *bool { if o == nil { return nil diff --git a/models/operations/bulkupdatelinks.go b/models/operations/bulkupdatelinks.go index 1d1df79..7178bb2 100644 --- a/models/operations/bulkupdatelinks.go +++ b/models/operations/bulkupdatelinks.go @@ -164,12 +164,14 @@ type Data struct { Password *string `json:"password,omitempty"` // Whether the short link uses Custom Social Media Cards feature. Proxy *bool `default:"false" json:"proxy"` - // The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Title *string `json:"title,omitempty"` - // The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Description *string `json:"description,omitempty"` - // The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Image *string `json:"image,omitempty"` + // 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 + Video *string `json:"video,omitempty"` // Whether the short link uses link cloaking. Rewrite *bool `default:"false" json:"rewrite"` // The iOS destination URL for the short link for iOS device targeting. @@ -298,6 +300,13 @@ func (o *Data) GetImage() *string { return o.Image } +func (o *Data) GetVideo() *string { + if o == nil { + return nil + } + return o.Video +} + func (o *Data) GetRewrite() *bool { if o == nil { return nil diff --git a/models/operations/createlink.go b/models/operations/createlink.go index 7e01f81..f1bb917 100644 --- a/models/operations/createlink.go +++ b/models/operations/createlink.go @@ -172,12 +172,14 @@ type CreateLinkRequestBody struct { Password *string `json:"password,omitempty"` // Whether the short link uses Custom Social Media Cards feature. Proxy *bool `default:"false" json:"proxy"` - // The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Title *string `json:"title,omitempty"` - // The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Description *string `json:"description,omitempty"` - // The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Image *string `json:"image,omitempty"` + // 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 + Video *string `json:"video,omitempty"` // Whether the short link uses link cloaking. Rewrite *bool `default:"false" json:"rewrite"` // The iOS destination URL for the short link for iOS device targeting. @@ -334,6 +336,13 @@ func (o *CreateLinkRequestBody) GetImage() *string { return o.Image } +func (o *CreateLinkRequestBody) GetVideo() *string { + if o == nil { + return nil + } + return o.Video +} + func (o *CreateLinkRequestBody) GetRewrite() *bool { if o == nil { return nil diff --git a/models/operations/options.go b/models/operations/options.go index 9e44a49..6e80f95 100644 --- a/models/operations/options.go +++ b/models/operations/options.go @@ -16,6 +16,7 @@ const ( SupportedOptionRetries = "retries" SupportedOptionTimeout = "timeout" SupportedOptionAcceptHeaderOverride = "acceptHeaderOverride" + SupportedOptionURLOverride = "urlOverride" ) type AcceptHeaderEnum string @@ -34,6 +35,7 @@ type Options struct { Retries *retry.Config Timeout *time.Duration AcceptHeaderOverride *AcceptHeaderEnum + URLOverride *string } type Option func(*Options, ...string) error @@ -100,3 +102,15 @@ func WithAcceptHeaderOverride(acceptHeaderOverride AcceptHeaderEnum) Option { return nil } } + +// WithURLOverride allows overriding the URL. +func WithURLOverride(urlOverride string) Option { + return func(opts *Options, supportedOptions ...string) error { + if !utils.Contains(supportedOptions, SupportedOptionURLOverride) { + return ErrUnsupportedOption + } + + opts.URLOverride = &urlOverride + return nil + } +} diff --git a/models/operations/updatelink.go b/models/operations/updatelink.go index d38bdff..a282e5f 100644 --- a/models/operations/updatelink.go +++ b/models/operations/updatelink.go @@ -172,12 +172,14 @@ type UpdateLinkRequestBody struct { Password *string `json:"password,omitempty"` // Whether the short link uses Custom Social Media Cards feature. Proxy *bool `default:"false" json:"proxy"` - // The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Title *string `json:"title,omitempty"` - // The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Description *string `json:"description,omitempty"` - // The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Image *string `json:"image,omitempty"` + // 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 + Video *string `json:"video,omitempty"` // Whether the short link uses link cloaking. Rewrite *bool `default:"false" json:"rewrite"` // The iOS destination URL for the short link for iOS device targeting. @@ -333,6 +335,13 @@ func (o *UpdateLinkRequestBody) GetImage() *string { return o.Image } +func (o *UpdateLinkRequestBody) GetVideo() *string { + if o == nil { + return nil + } + return o.Video +} + func (o *UpdateLinkRequestBody) GetRewrite() *bool { if o == nil { return nil diff --git a/models/operations/upsertlink.go b/models/operations/upsertlink.go index 1d31aa9..409a242 100644 --- a/models/operations/upsertlink.go +++ b/models/operations/upsertlink.go @@ -172,12 +172,14 @@ type UpsertLinkRequestBody struct { Password *string `json:"password,omitempty"` // Whether the short link uses Custom Social Media Cards feature. Proxy *bool `default:"false" json:"proxy"` - // The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Title *string `json:"title,omitempty"` - // The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Description *string `json:"description,omitempty"` - // The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + // 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 Image *string `json:"image,omitempty"` + // 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 + Video *string `json:"video,omitempty"` // Whether the short link uses link cloaking. Rewrite *bool `default:"false" json:"rewrite"` // The iOS destination URL for the short link for iOS device targeting. @@ -334,6 +336,13 @@ func (o *UpsertLinkRequestBody) GetImage() *string { return o.Image } +func (o *UpsertLinkRequestBody) GetVideo() *string { + if o == nil { + return nil + } + return o.Video +} + func (o *UpsertLinkRequestBody) GetRewrite() *bool { if o == nil { return nil