From 13bc971c5bea1a29c11221e67e28b80304a6fbb9 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 10 Jul 2024 00:55:24 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.330.0 --- .speakeasy/gen.lock | 7 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- codeSamples.yaml | 354 +++++++++++++++++++-------------------- dub.go | 4 +- 6 files changed, 200 insertions(+), 189 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 37fac15..bb94677 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 1773e9c7-1931-4663-8ac8-4deaf8db76f5 management: - docChecksum: 2dc0e57ebc2df7985435f1560ba8e4cc + docChecksum: d074e83422312242c953b9123b5c20aa docVersion: 0.0.1 speakeasyVersion: 1.330.0 generationVersion: 2.361.10 - releaseVersion: 0.2.0 - configChecksum: ab1c33481fd4da8596cb76915aa7e813 + releaseVersion: 0.3.0 + configChecksum: 9e76a310714fd8ff92b97c1df6333893 repoURL: https://github.com/dubinc/dub-go.git installationURL: https://github.com/dubinc/dub-go features: @@ -15,6 +15,7 @@ features: constsAndDefaults: 0.1.4 core: 3.4.14 deprecations: 2.81.1 + errors: 2.81.9 examples: 2.81.3 flattening: 2.81.1 globalSecurity: 2.82.9 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a80c058..2b0fd45 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.2.0 + version: 0.3.0 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index f130650..ffb89a5 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.330.0 sources: dub: sourceNamespace: dub - sourceRevisionDigest: sha256:c669f56483cb7280a1bf163fb3e3933d2e12aac038992cae465343e3aac9ed9e - sourceBlobDigest: sha256:949d9b8c580edf1d004b7303501264e41151c8e82389c347c57c7895784139ad + sourceRevisionDigest: sha256:95ccf7bea79aba9ea7582f8507ca89a10e7bdd9611ca7c36d59a98ea69788151 + sourceBlobDigest: sha256:6575f8802c2603ceb58125fa04397628b6c147bcf919a849f7e921a9be31a62e tags: - latest - main @@ -11,10 +11,10 @@ targets: my-first-target: source: dub sourceNamespace: dub - sourceRevisionDigest: sha256:c669f56483cb7280a1bf163fb3e3933d2e12aac038992cae465343e3aac9ed9e - sourceBlobDigest: sha256:949d9b8c580edf1d004b7303501264e41151c8e82389c347c57c7895784139ad + sourceRevisionDigest: sha256:95ccf7bea79aba9ea7582f8507ca89a10e7bdd9611ca7c36d59a98ea69788151 + sourceBlobDigest: sha256:6575f8802c2603ceb58125fa04397628b6c147bcf919a849f7e921a9be31a62e codeSamplesNamespace: code-samples-go-my-first-target - codeSamplesRevisionDigest: sha256:04b67a6373a87b5faa92595798bc9fc3c33feb5b2e54333f46e150d0a404470b + codeSamplesRevisionDigest: sha256:d3b1c7d1d00593a74d0ad5ad3a7489563469759538eb9aafe281ed268f083a09 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 6b97977..cdbdcc4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -158,4 +158,14 @@ Based on: ### Generated - [go v0.2.0] . ### Releases -- [Go v0.2.0] https://github.com/dubinc/dub-go/releases/tag/v0.2.0 - . \ No newline at end of file +- [Go v0.2.0] https://github.com/dubinc/dub-go/releases/tag/v0.2.0 - . + +## 2024-07-10 00:54:14 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.330.0 (2.361.10) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.3.0] . +### Releases +- [Go v0.3.0] https://github.com/dubinc/dub-go/releases/tag/v0.3.0 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 3055315..545ba96 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: - - target: $["paths"]["/qr"]["get"] + - target: $["paths"]["/metatags"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getQRCode" + "label": "getMetatags" "source": |- package main @@ -22,11 +22,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetQRCodeRequest{ - URL: "https://brief-micronutrient.org", + request := operations.GetMetatagsRequest{ + URL: "https://dub.co", } ctx := context.Background() - res, err := s.QRCodes.Get(ctx, request) + res, err := s.Metatags.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -34,11 +34,11 @@ actions: // handle response } } - - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] + - target: $["paths"]["/links/upsert"]["put"] update: "x-codeSamples": - "lang": "go" - "label": "getWorkspace" + "label": "upsertLink" "source": |- package main @@ -53,11 +53,17 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetWorkspaceRequest{ - IDOrSlug: "", + 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.Workspaces.Get(ctx, request) + res, err := s.Links.Upsert(ctx, request) if err != nil { log.Fatal(err) } @@ -65,11 +71,11 @@ actions: // handle response } } - - target: $["paths"]["/tags"]["post"] + - target: $["paths"]["/links/bulk"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "createTag" + "label": "bulkCreateLinks" "source": |- package main @@ -84,9 +90,19 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.CreateTagRequestBody = &operations.CreateTagRequestBody{} + 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.Tags.Create(ctx, request) + res, err := s.Links.CreateMany(ctx, request) if err != nil { log.Fatal(err) } @@ -94,11 +110,11 @@ actions: // handle response } } - - target: $["paths"]["/links"]["post"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "createLink" + "label": "updateWorkspace" "source": |- package main @@ -113,17 +129,11 @@ 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 idOrSlug string = "" + + var requestBody *operations.UpdateWorkspaceRequestBody = &operations.UpdateWorkspaceRequestBody{} ctx := context.Background() - res, err := s.Links.Create(ctx, request) + res, err := s.Workspaces.Update(ctx, idOrSlug, requestBody) if err != nil { log.Fatal(err) } @@ -131,11 +141,11 @@ actions: // handle response } } - - target: $["paths"]["/links/bulk"]["post"] + - target: $["paths"]["/analytics"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "bulkCreateLinks" + "label": "retrieveAnalytics" "source": |- package main @@ -150,19 +160,16 @@ 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...", - }, - ), - }, + 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.CreateMany(ctx, request) + res, err := s.Analytics.Retrieve(ctx, request) if err != nil { log.Fatal(err) } @@ -170,16 +177,17 @@ actions: // handle response } } - - target: $["paths"]["/links/{linkId}"]["delete"] + - target: $["paths"]["/tags"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "deleteLink" + "label": "createTag" "source": |- package main import( dubgo "github.com/dubinc/dub-go" + "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -188,9 +196,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var linkID string = "" + var request *operations.CreateTagRequestBody = &operations.CreateTagRequestBody{} ctx := context.Background() - res, err := s.Links.Delete(ctx, linkID) + res, err := s.Tags.Create(ctx, request) if err != nil { log.Fatal(err) } @@ -198,11 +206,11 @@ actions: // handle response } } - - target: $["paths"]["/analytics"]["get"] + - target: $["paths"]["/track/customer"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "retrieveAnalytics" + "label": "trackCustomer" "source": |- package main @@ -217,16 +225,11 @@ 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 request *operations.TrackCustomerRequestBody = &operations.TrackCustomerRequestBody{ + CustomerID: "", } ctx := context.Background() - res, err := s.Analytics.Retrieve(ctx, request) + res, err := s.Track.Customer(ctx, request) if err != nil { log.Fatal(err) } @@ -234,11 +237,11 @@ actions: // handle response } } - - target: $["paths"]["/workspaces/{idOrSlug}"]["patch"] + - target: $["paths"]["/links"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "updateWorkspace" + "label": "createLink" "source": |- package main @@ -253,11 +256,17 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var idOrSlug string = "" - - var requestBody *operations.UpdateWorkspaceRequestBody = &operations.UpdateWorkspaceRequestBody{} + 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.Workspaces.Update(ctx, idOrSlug, requestBody) + res, err := s.Links.Create(ctx, request) if err != nil { log.Fatal(err) } @@ -265,16 +274,17 @@ actions: // handle response } } - - target: $["paths"]["/tags"]["get"] + - target: $["paths"]["/links"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getTags" + "label": "getLinks" "source": |- package main import( dubgo "github.com/dubinc/dub-go" + "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -283,9 +293,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - + request := operations.GetLinksRequest{} ctx := context.Background() - res, err := s.Tags.List(ctx) + res, err := s.Links.List(ctx, request) if err != nil { log.Fatal(err) } @@ -293,11 +303,11 @@ actions: // handle response } } - - target: $["paths"]["/domains"]["post"] + - target: $["paths"]["/links/info"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "createDomain" + "label": "getLinkInfo" "source": |- package main @@ -312,14 +322,12 @@ 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.GetLinkInfoRequest{ + LinkID: dubgo.String("clux0rgak00011..."), + ExternalID: dubgo.String("ext_123456"), } ctx := context.Background() - res, err := s.Domains.Create(ctx, request) + res, err := s.Links.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -327,11 +335,11 @@ actions: // handle response } } - - target: $["paths"]["/domains/{slug}"]["patch"] + - target: $["paths"]["/tags/{id}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "updateDomain" + "label": "updateTag" "source": |- package main @@ -346,16 +354,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var slug string = "acme.com" + var id string = "" - 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 requestBody *operations.UpdateTagRequestBody = &operations.UpdateTagRequestBody{} ctx := context.Background() - res, err := s.Domains.Update(ctx, slug, requestBody) + res, err := s.Tags.Update(ctx, id, requestBody) if err != nil { log.Fatal(err) } @@ -363,11 +366,11 @@ actions: // handle response } } - - target: $["paths"]["/links/upsert"]["put"] + - target: $["paths"]["/domains"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "upsertLink" + "label": "createDomain" "source": |- package main @@ -382,17 +385,14 @@ 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...", - }, - ), + 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.Upsert(ctx, request) + res, err := s.Domains.Create(ctx, request) if err != nil { log.Fatal(err) } @@ -400,17 +400,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" ) @@ -419,9 +418,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) } @@ -429,11 +428,11 @@ actions: // handle response } } - - target: $["paths"]["/track/customer"]["post"] + - target: $["paths"]["/domains/{slug}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "trackCustomer" + "label": "updateDomain" "source": |- package main @@ -448,11 +447,16 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.TrackCustomerRequestBody = &operations.TrackCustomerRequestBody{ - CustomerID: "", + 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.Customer(ctx, request) + res, err := s.Domains.Update(ctx, slug, requestBody) if err != nil { log.Fatal(err) } @@ -460,11 +464,11 @@ actions: // handle response } } - - target: $["paths"]["/links/bulk"]["patch"] + - target: $["paths"]["/track/lead"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "bulkUpdateLinks" + "label": "trackLead" "source": |- package main @@ -479,21 +483,13 @@ 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...", - }, - ), - }, + var request *operations.TrackLeadRequestBody = &operations.TrackLeadRequestBody{ + ClickID: "", + EventName: "Sign up", + CustomerID: "", } ctx := context.Background() - res, err := s.Links.UpdateMany(ctx, request) + res, err := s.Track.Lead(ctx, request) if err != nil { log.Fatal(err) } @@ -501,17 +497,16 @@ actions: // handle response } } - - target: $["paths"]["/tags/{id}"]["patch"] + - target: $["paths"]["/links/{linkId}"]["delete"] update: "x-codeSamples": - "lang": "go" - "label": "updateTag" + "label": "deleteLink" "source": |- package main import( dubgo "github.com/dubinc/dub-go" - "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -520,11 +515,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var id string = "" - - var requestBody *operations.UpdateTagRequestBody = &operations.UpdateTagRequestBody{} + var linkID string = "" ctx := context.Background() - res, err := s.Tags.Update(ctx, id, requestBody) + res, err := s.Links.Delete(ctx, linkID) if err != nil { log.Fatal(err) } @@ -532,11 +525,11 @@ actions: // handle response } } - - target: $["paths"]["/track/lead"]["post"] + - target: $["paths"]["/qr"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "trackLead" + "label": "getQRCode" "source": |- package main @@ -551,13 +544,11 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var request *operations.TrackLeadRequestBody = &operations.TrackLeadRequestBody{ - ClickID: "", - EventName: "Sign up", - CustomerID: "", + request := operations.GetQRCodeRequest{ + URL: "https://brief-micronutrient.org", } ctx := context.Background() - res, err := s.Track.Lead(ctx, request) + res, err := s.QRCodes.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -565,11 +556,11 @@ actions: // handle response } } - - target: $["paths"]["/track/sale"]["post"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "trackSale" + "label": "getWorkspace" "source": |- package main @@ -584,14 +575,11 @@ 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"), + request := operations.GetWorkspaceRequest{ + IDOrSlug: "", } ctx := context.Background() - res, err := s.Track.Sale(ctx, request) + res, err := s.Workspaces.Get(ctx, request) if err != nil { log.Fatal(err) } @@ -599,11 +587,11 @@ actions: // handle response } } - - target: $["paths"]["/links/count"]["get"] + - target: $["paths"]["/track/sale"]["post"] update: "x-codeSamples": - "lang": "go" - "label": "getLinksCount" + "label": "trackSale" "source": |- package main @@ -618,9 +606,14 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetLinksCountRequest{} + var request *operations.TrackSaleRequestBody = &operations.TrackSaleRequestBody{ + CustomerID: "", + Amount: 996500, + PaymentProcessor: operations.PaymentProcessorShopify, + EventName: dubgo.String("Purchase"), + } ctx := context.Background() - res, err := s.Links.Count(ctx, request) + res, err := s.Track.Sale(ctx, request) if err != nil { log.Fatal(err) } @@ -628,17 +621,16 @@ actions: // handle response } } - - target: $["paths"]["/links/{linkId}"]["patch"] + - target: $["paths"]["/tags"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "updateLink" + "label": "getTags" "source": |- package main import( dubgo "github.com/dubinc/dub-go" - "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -647,19 +639,9 @@ 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...", - }, - ), - } ctx := context.Background() - res, err := s.Links.Update(ctx, linkID, requestBody) + res, err := s.Tags.List(ctx) if err != nil { log.Fatal(err) } @@ -667,11 +649,11 @@ actions: // handle response } } - - target: $["paths"]["/domains/{slug}"]["delete"] + - target: $["paths"]["/domains"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "deleteDomain" + "label": "listDomains" "source": |- package main @@ -685,9 +667,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - var slug string = "acme.com" + ctx := context.Background() - res, err := s.Domains.Delete(ctx, slug) + res, err := s.Domains.List(ctx) if err != nil { log.Fatal(err) } @@ -695,11 +677,11 @@ actions: // handle response } } - - target: $["paths"]["/metatags"]["get"] + - target: $["paths"]["/links/count"]["get"] update: "x-codeSamples": - "lang": "go" - "label": "getMetatags" + "label": "getLinksCount" "source": |- package main @@ -714,11 +696,9 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetMetatagsRequest{ - URL: "https://dub.co", - } + request := operations.GetLinksCountRequest{} ctx := context.Background() - res, err := s.Metatags.Get(ctx, request) + res, err := s.Links.Count(ctx, request) if err != nil { log.Fatal(err) } @@ -726,11 +706,11 @@ actions: // handle response } } - - target: $["paths"]["/links/info"]["get"] + - target: $["paths"]["/links/{linkId}"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "getLinkInfo" + "label": "updateLink" "source": |- package main @@ -745,12 +725,19 @@ actions: s := dubgo.New( dubgo.WithSecurity("DUB_API_KEY"), ) - request := operations.GetLinkInfoRequest{ - LinkID: dubgo.String("clux0rgak00011..."), - ExternalID: dubgo.String("ext_123456"), + 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.Links.Get(ctx, request) + res, err := s.Links.Update(ctx, linkID, requestBody) if err != nil { log.Fatal(err) } @@ -758,16 +745,17 @@ actions: // handle response } } - - target: $["paths"]["/domains"]["get"] + - target: $["paths"]["/links/bulk"]["patch"] update: "x-codeSamples": - "lang": "go" - "label": "listDomains" + "label": "bulkUpdateLinks" "source": |- package main import( dubgo "github.com/dubinc/dub-go" + "github.com/dubinc/dub-go/models/operations" "context" "log" ) @@ -776,9 +764,21 @@ 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...", + }, + ), + }, + } ctx := context.Background() - res, err := s.Domains.List(ctx) + res, err := s.Links.UpdateMany(ctx, request) if err != nil { log.Fatal(err) } diff --git a/dub.go b/dub.go index ab48af6..ea95aa1 100644 --- a/dub.go +++ b/dub.go @@ -145,9 +145,9 @@ func New(opts ...SDKOption) *Dub { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.1", - SDKVersion: "0.2.0", + SDKVersion: "0.3.0", GenVersion: "2.361.10", - UserAgent: "speakeasy-sdk/go 0.2.0 2.361.10 0.0.1 github.com/dubinc/dub-go", + UserAgent: "speakeasy-sdk/go 0.3.0 2.361.10 0.0.1 github.com/dubinc/dub-go", Hooks: hooks.New(), }, }