-
Notifications
You must be signed in to change notification settings - Fork 12
/
codeSamples.yaml
191 lines (191 loc) · 12.2 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 typescript target
version: 0.0.0
actions:
- target: $["paths"]["/analytics"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "retrieveAnalytics"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.analytics.retrieve();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/customers"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getCustomers"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.customers.list();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/customers"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "createCustomer"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.customers.create();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/customers/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "deleteCustomer"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.customers.delete(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/customers/{id}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getCustomer"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.customers.get({\n id: \"<id>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/customers/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updateCustomer"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.customers.update(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/domains"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "listDomains"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.domains.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/domains"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "createDomain"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.domains.create();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/domains/{slug}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "deleteDomain"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.domains.delete(\"acme.com\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/domains/{slug}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updateDomain"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.domains.update(\"acme.com\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/events"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "listEvents"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.events.list();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getLinks"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.list();\n\n for await (const page of result) {\n // Handle the page\n console.log(page);\n }\n}\n\nrun();"
- target: $["paths"]["/links"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "createLink"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.create();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/bulk"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "bulkDeleteLinks"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.deleteMany({\n linkIds: [\n \"clux0rgak00011...\",\n \"clux0rgak00022...\",\n ],\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/bulk"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "bulkUpdateLinks"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.updateMany();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/bulk"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "bulkCreateLinks"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.createMany();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/count"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getLinksCount"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.count();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/info"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getLinkInfo"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.get();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/upsert"]["put"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "upsertLink"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.upsert();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/{linkId}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "deleteLink"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.delete(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/links/{linkId}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updateLink"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.links.update(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/metatags"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getMetatags"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.metatags.get({\n url: \"https://dub.co\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/qr"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getQRCode"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.qrCodes.get({\n url: \"https://normal-making.name\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/tags"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getTags"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.tags.list();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/tags"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "createTag"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.tags.create();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/tags/{id}"]["delete"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "deleteTag"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.tags.delete(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/tags/{id}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updateTag"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.tags.update(\"<id>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/track/lead"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "trackLead"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.track.lead();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/track/sale"]["post"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "trackSale"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.track.sale();\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/workspaces/{idOrSlug}"]["get"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "getWorkspace"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.workspaces.get({\n idOrSlug: \"<value>\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();"
- target: $["paths"]["/workspaces/{idOrSlug}"]["patch"]
update:
"x-codeSamples":
- "lang": "typescript"
"label": "updateWorkspace"
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n});\n\nasync function run() {\n const result = await dub.workspaces.update(\"<value>\");\n\n // Handle the result\n console.log(result);\n}\n\nrun();"