-
Notifications
You must be signed in to change notification settings - Fork 2
/
codeSamples.yaml
191 lines (191 loc) · 22 KB
/
codeSamples.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
overlay: 1.0.0
info:
title: CodeSamples overlay for go target
version: 0.0.0
actions:
- target: $["paths"]["/analytics"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "retrieveAnalytics"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Analytics.Retrieve(ctx, operations.RetrieveAnalyticsRequest{\n Timezone: dubgo.String(\"America/New_York\"),\n City: dubgo.String(\"New York\"),\n Device: dubgo.String(\"Desktop\"),\n Browser: dubgo.String(\"Chrome\"),\n Os: dubgo.String(\"Windows\"),\n Referer: dubgo.String(\"google.com\"),\n RefererURL: dubgo.String(\"https://dub.co/blog\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/customers"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getCustomers"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Customers.List(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/customers"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "createCustomer"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Customers.Create(ctx, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/customers/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "go"
"label": "deleteCustomer"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Customers.Delete(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/customers/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getCustomer"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Customers.Get(ctx, operations.GetCustomerRequest{\n ID: \"<id>\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/customers/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "go"
"label": "updateCustomer"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Customers.Update(ctx, \"<id>\", nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/domains"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "listDomains"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Domains.List(ctx, operations.ListDomainsRequest{\n Page: dubgo.Float64(1),\n PageSize: dubgo.Float64(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n for {\n // handle items\n \n res, err = res.Next()\n \n if err != nil {\n // handle error\n }\n \n if res == nil {\n break\n }\n }\n \n }\n}"
- target: $["paths"]["/domains"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "createDomain"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Domains.Create(ctx, &operations.CreateDomainRequestBody{\n Slug: \"acme.com\",\n ExpiredURL: dubgo.String(\"https://acme.com/expired\"),\n NotFoundURL: dubgo.String(\"https://acme.com/not-found\"),\n Archived: dubgo.Bool(false),\n Placeholder: dubgo.String(\"https://dub.co/help/article/what-is-dub\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/domains/{slug}"]["delete"]
update:
"x-codeSamples":
- "lang": "go"
"label": "deleteDomain"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Domains.Delete(ctx, \"acme.com\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/domains/{slug}"]["patch"]
update:
"x-codeSamples":
- "lang": "go"
"label": "updateDomain"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Domains.Update(ctx, \"acme.com\", &operations.UpdateDomainRequestBody{\n Slug: dubgo.String(\"acme.com\"),\n ExpiredURL: dubgo.String(\"https://acme.com/expired\"),\n NotFoundURL: dubgo.String(\"https://acme.com/not-found\"),\n Archived: dubgo.Bool(false),\n Placeholder: dubgo.String(\"https://dub.co/help/article/what-is-dub\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/events"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "listEvents"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Events.List(ctx, operations.ListEventsRequest{\n Timezone: dubgo.String(\"America/New_York\"),\n City: dubgo.String(\"New York\"),\n Device: dubgo.String(\"Desktop\"),\n Browser: dubgo.String(\"Chrome\"),\n Os: dubgo.String(\"Windows\"),\n Referer: dubgo.String(\"google.com\"),\n RefererURL: dubgo.String(\"https://dub.co/blog\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getLinks"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.List(ctx, operations.GetLinksRequest{\n Page: dubgo.Float64(1),\n PageSize: dubgo.Float64(50),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n for {\n // handle items\n \n res, err = res.Next()\n \n if err != nil {\n // handle error\n }\n \n if res == nil {\n break\n }\n }\n \n }\n}"
- target: $["paths"]["/links"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "createLink"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Create(ctx, &operations.CreateLinkRequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/bulk"]["delete"]
update:
"x-codeSamples":
- "lang": "go"
"label": "bulkDeleteLinks"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.DeleteMany(ctx, operations.BulkDeleteLinksRequest{\n LinkIds: []string{\n \"clux0rgak00011...\",\n \"clux0rgak00022...\",\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/bulk"]["patch"]
update:
"x-codeSamples":
- "lang": "go"
"label": "bulkUpdateLinks"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.UpdateMany(ctx, &operations.BulkUpdateLinksRequestBody{\n Data: operations.Data{\n URL: dubgo.String(\"https://google.com\"),\n TagIds: dubgo.Pointer(operations.CreateBulkUpdateLinksTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/bulk"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "bulkCreateLinks"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.CreateMany(ctx, []operations.RequestBody{\n operations.RequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateBulkCreateLinksTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n },\n operations.RequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateBulkCreateLinksTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/count"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getLinksCount"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Count(ctx, operations.GetLinksCountRequest{})\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/info"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getLinkInfo"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Get(ctx, operations.GetLinkInfoRequest{\n LinkID: dubgo.String(\"clux0rgak00011...\"),\n ExternalID: dubgo.String(\"123456\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/upsert"]["put"]
update:
"x-codeSamples":
- "lang": "go"
"label": "upsertLink"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Upsert(ctx, &operations.UpsertLinkRequestBody{\n URL: \"https://google.com\",\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateUpsertLinkTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/{linkId}"]["delete"]
update:
"x-codeSamples":
- "lang": "go"
"label": "deleteLink"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Delete(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/links/{linkId}"]["patch"]
update:
"x-codeSamples":
- "lang": "go"
"label": "updateLink"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Links.Update(ctx, \"<id>\", &operations.UpdateLinkRequestBody{\n URL: dubgo.String(\"https://google.com\"),\n ExternalID: dubgo.String(\"123456\"),\n TagIds: dubgo.Pointer(operations.CreateUpdateLinkTagIdsArrayOfStr(\n []string{\n \"clux0rgak00011...\",\n },\n )),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/metatags"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getMetatags"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Metatags.Get(ctx, operations.GetMetatagsRequest{\n URL: \"https://dub.co\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/qr"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getQRCode"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.QRCodes.Get(ctx, operations.GetQRCodeRequest{\n URL: \"https://normal-making.name\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/tags"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getTags"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Tags.List(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/tags"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "createTag"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Tags.Create(ctx, nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/tags/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "go"
"label": "deleteTag"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Tags.Delete(ctx, \"<id>\")\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/tags/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "go"
"label": "updateTag"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Tags.Update(ctx, \"<id>\", nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/track/lead"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "trackLead"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Track.Lead(ctx, &operations.TrackLeadRequestBody{\n ClickID: \"<id>\",\n EventName: \"Sign up\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/track/sale"]["post"]
update:
"x-codeSamples":
- "lang": "go"
"label": "trackSale"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Track.Sale(ctx, &operations.TrackSaleRequestBody{\n Amount: 996500,\n PaymentProcessor: operations.PaymentProcessorPaddle,\n EventName: dubgo.String(\"Purchase\"),\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/workspaces/{idOrSlug}"]["get"]
update:
"x-codeSamples":
- "lang": "go"
"label": "getWorkspace"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"github.com/dubinc/dub-go/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Workspaces.Get(ctx, operations.GetWorkspaceRequest{\n IDOrSlug: \"<value>\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"
- target: $["paths"]["/workspaces/{idOrSlug}"]["patch"]
update:
"x-codeSamples":
- "lang": "go"
"label": "updateWorkspace"
"source": "package main\n\nimport(\n\tdubgo \"github.com/dubinc/dub-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := dubgo.New(\n dubgo.WithSecurity(\"DUB_API_KEY\"),\n )\n\n ctx := context.Background()\n res, err := s.Workspaces.Update(ctx, \"<value>\", nil)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}"