@@ -165,15 +165,15 @@ func main() {
165165
166166* [ List] ( docs/sdks/customers/README.md#list ) - Retrieve a list of customers
167167* [ Get] ( docs/sdks/customers/README.md#get ) - Retrieve a customer
168- * [ Update] ( docs/sdks/customers/README.md#update ) - Update a customer
169168* [ Delete] ( docs/sdks/customers/README.md#delete ) - Delete a customer
169+ * [ Update] ( docs/sdks/customers/README.md#update ) - Update a customer
170170
171171### [ Domains] ( docs/sdks/domains/README.md )
172172
173- * [ Create] ( docs/sdks/domains/README.md#create ) - Create a domain
174173* [ List] ( docs/sdks/domains/README.md#list ) - Retrieve a list of domains
175- * [ Update ] ( docs/sdks/domains/README.md#update ) - Update a domain
174+ * [ Create ] ( docs/sdks/domains/README.md#create ) - Create a domain
176175* [ Delete] ( docs/sdks/domains/README.md#delete ) - Delete a domain
176+ * [ Update] ( docs/sdks/domains/README.md#update ) - Update a domain
177177* [ Register] ( docs/sdks/domains/README.md#register ) - Register a domain
178178* [ CheckStatus] ( docs/sdks/domains/README.md#checkstatus ) - Check the availability of one or more domains
179179
@@ -187,30 +187,30 @@ func main() {
187187
188188### [ Folders] ( docs/sdks/folders/README.md )
189189
190- * [ Create] ( docs/sdks/folders/README.md#create ) - Create a folder
191190* [ List] ( docs/sdks/folders/README.md#list ) - Retrieve a list of folders
192- * [ Update ] ( docs/sdks/folders/README.md#update ) - Update a folder
191+ * [ Create ] ( docs/sdks/folders/README.md#create ) - Create a folder
193192* [ Delete] ( docs/sdks/folders/README.md#delete ) - Delete a folder
193+ * [ Update] ( docs/sdks/folders/README.md#update ) - Update a folder
194194
195195### [ Links] ( docs/sdks/links/README.md )
196196
197- * [ Create] ( docs/sdks/links/README.md#create ) - Create a link
198197* [ List] ( docs/sdks/links/README.md#list ) - Retrieve a list of links
198+ * [ Create] ( docs/sdks/links/README.md#create ) - Create a link
199199* [ Count] ( docs/sdks/links/README.md#count ) - Retrieve links count
200200* [ Get] ( docs/sdks/links/README.md#get ) - Retrieve a link
201- * [ Update] ( docs/sdks/links/README.md#update ) - Update a link
202201* [ Delete] ( docs/sdks/links/README.md#delete ) - Delete a link
202+ * [ Update] ( docs/sdks/links/README.md#update ) - Update a link
203203* [ CreateMany] ( docs/sdks/links/README.md#createmany ) - Bulk create links
204- * [ UpdateMany] ( docs/sdks/links/README.md#updatemany ) - Bulk update links
205204* [ DeleteMany] ( docs/sdks/links/README.md#deletemany ) - Bulk delete links
205+ * [ UpdateMany] ( docs/sdks/links/README.md#updatemany ) - Bulk update links
206206* [ Upsert] ( docs/sdks/links/README.md#upsert ) - Upsert a link
207207
208208### [ Partners] ( docs/sdks/partners/README.md )
209209
210- * [ Create] ( docs/sdks/partners/README.md#create ) - Create or update a partner
211210* [ List] ( docs/sdks/partners/README.md#list ) - List all partners
212- * [ CreateLink ] ( docs/sdks/partners/README.md#createlink ) - Create a link for a partner
211+ * [ Create ] ( docs/sdks/partners/README.md#create ) - Create or update a partner
213212* [ RetrieveLinks] ( docs/sdks/partners/README.md#retrievelinks ) - Retrieve a partner's links.
213+ * [ CreateLink] ( docs/sdks/partners/README.md#createlink ) - Create a link for a partner
214214* [ UpsertLink] ( docs/sdks/partners/README.md#upsertlink ) - Upsert a link for a partner
215215* [ Analytics] ( docs/sdks/partners/README.md#analytics ) - Retrieve analytics for a partner
216216* [ Ban] ( docs/sdks/partners/README.md#ban ) - Ban a partner
@@ -226,10 +226,10 @@ func main() {
226226
227227### [ Tags] ( docs/sdks/tags/README.md )
228228
229- * [ Create] ( docs/sdks/tags/README.md#create ) - Create a tag
230229* [ List] ( docs/sdks/tags/README.md#list ) - Retrieve a list of tags
231- * [ Update ] ( docs/sdks/tags/README.md#update ) - Update a tag
230+ * [ Create ] ( docs/sdks/tags/README.md#create ) - Create a tag
232231* [ Delete] ( docs/sdks/tags/README.md#delete ) - Delete a tag
232+ * [ Update] ( docs/sdks/tags/README.md#update ) - Update a tag
233233
234234### [ Track] ( docs/sdks/track/README.md )
235235
@@ -246,7 +246,7 @@ Handling errors in this SDK should largely match your expectations. All operatio
246246
247247By Default, an API error will return ` sdkerrors.SDKError ` . When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective * Errors* tables in SDK docs for more details on possible error types for each operation.
248248
249- For example, the ` Create ` function may return the following errors:
249+ For example, the ` List ` function may return the following errors:
250250
251251| Error Type | Status Code | Content Type |
252252| ----------------------------- | ----------- | ---------------- |
@@ -282,24 +282,8 @@ func main() {
282282 dubgo.WithSecurity (" DUB_API_KEY" ),
283283 )
284284
285- res , err := s.Links .Create (ctx, &operations.CreateLinkRequestBody {
286- URL: " https://google.com" ,
287- ExternalID: dubgo.Pointer (" 123456" ),
288- TagIds: dubgo.Pointer (operations.CreateTagIdsArrayOfStr (
289- []string {
290- " clux0rgak00011..." ,
291- },
292- )),
293- TestVariants: []operations.TestVariants {
294- operations.TestVariants {
295- URL: " https://example.com/variant-1" ,
296- Percentage: 50 ,
297- },
298- operations.TestVariants {
299- URL: " https://example.com/variant-2" ,
300- Percentage: 50 ,
301- },
302- },
285+ res , err := s.Links .List (ctx, operations.GetLinksRequest {
286+ PageSize: dubgo.Pointer [float64 ](50 ),
303287 })
304288 if err != nil {
305289
@@ -392,30 +376,26 @@ func main() {
392376 dubgo.WithSecurity (" DUB_API_KEY" ),
393377 )
394378
395- res , err := s.Links .Create (ctx, &operations.CreateLinkRequestBody {
396- URL: " https://google.com" ,
397- ExternalID: dubgo.Pointer (" 123456" ),
398- TagIds: dubgo.Pointer (operations.CreateTagIdsArrayOfStr (
399- []string {
400- " clux0rgak00011..." ,
401- },
402- )),
403- TestVariants: []operations.TestVariants {
404- operations.TestVariants {
405- URL: " https://example.com/variant-1" ,
406- Percentage: 50 ,
407- },
408- operations.TestVariants {
409- URL: " https://example.com/variant-2" ,
410- Percentage: 50 ,
411- },
412- },
379+ res , err := s.Links .List (ctx, operations.GetLinksRequest {
380+ PageSize: dubgo.Pointer [float64 ](50 ),
413381 })
414382 if err != nil {
415383 log.Fatal (err)
416384 }
417385 if res != nil {
418- // handle response
386+ for {
387+ // handle items
388+
389+ res, err = res.Next ()
390+
391+ if err != nil {
392+ // handle error
393+ }
394+
395+ if res == nil {
396+ break
397+ }
398+ }
419399 }
420400}
421401
@@ -481,30 +461,26 @@ func main() {
481461 dubgo.WithSecurity (" DUB_API_KEY" ),
482462 )
483463
484- res , err := s.Links .Create (ctx, &operations.CreateLinkRequestBody {
485- URL: " https://google.com" ,
486- ExternalID: dubgo.Pointer (" 123456" ),
487- TagIds: dubgo.Pointer (operations.CreateTagIdsArrayOfStr (
488- []string {
489- " clux0rgak00011..." ,
490- },
491- )),
492- TestVariants: []operations.TestVariants {
493- operations.TestVariants {
494- URL: " https://example.com/variant-1" ,
495- Percentage: 50 ,
496- },
497- operations.TestVariants {
498- URL: " https://example.com/variant-2" ,
499- Percentage: 50 ,
500- },
501- },
464+ res , err := s.Links .List (ctx, operations.GetLinksRequest {
465+ PageSize: dubgo.Pointer [float64 ](50 ),
502466 })
503467 if err != nil {
504468 log.Fatal (err)
505469 }
506470 if res != nil {
507- // handle response
471+ for {
472+ // handle items
473+
474+ res, err = res.Next ()
475+
476+ if err != nil {
477+ // handle error
478+ }
479+
480+ if res == nil {
481+ break
482+ }
483+ }
508484 }
509485}
510486
@@ -536,24 +512,8 @@ func main() {
536512 dubgo.WithSecurity (" DUB_API_KEY" ),
537513 )
538514
539- res , err := s.Links .Create (ctx, &operations.CreateLinkRequestBody {
540- URL: " https://google.com" ,
541- ExternalID: dubgo.Pointer (" 123456" ),
542- TagIds: dubgo.Pointer (operations.CreateTagIdsArrayOfStr (
543- []string {
544- " clux0rgak00011..." ,
545- },
546- )),
547- TestVariants: []operations.TestVariants {
548- operations.TestVariants {
549- URL: " https://example.com/variant-1" ,
550- Percentage: 50 ,
551- },
552- operations.TestVariants {
553- URL: " https://example.com/variant-2" ,
554- Percentage: 50 ,
555- },
556- },
515+ res , err := s.Links .List (ctx, operations.GetLinksRequest {
516+ PageSize: dubgo.Pointer [float64 ](50 ),
557517 }, operations.WithRetries (
558518 retry.Config {
559519 Strategy: " backoff" ,
@@ -569,7 +529,19 @@ func main() {
569529 log.Fatal (err)
570530 }
571531 if res != nil {
572- // handle response
532+ for {
533+ // handle items
534+
535+ res, err = res.Next ()
536+
537+ if err != nil {
538+ // handle error
539+ }
540+
541+ if res == nil {
542+ break
543+ }
544+ }
573545 }
574546}
575547
@@ -605,30 +577,26 @@ func main() {
605577 dubgo.WithSecurity (" DUB_API_KEY" ),
606578 )
607579
608- res , err := s.Links .Create (ctx, &operations.CreateLinkRequestBody {
609- URL: " https://google.com" ,
610- ExternalID: dubgo.Pointer (" 123456" ),
611- TagIds: dubgo.Pointer (operations.CreateTagIdsArrayOfStr (
612- []string {
613- " clux0rgak00011..." ,
614- },
615- )),
616- TestVariants: []operations.TestVariants {
617- operations.TestVariants {
618- URL: " https://example.com/variant-1" ,
619- Percentage: 50 ,
620- },
621- operations.TestVariants {
622- URL: " https://example.com/variant-2" ,
623- Percentage: 50 ,
624- },
625- },
580+ res , err := s.Links .List (ctx, operations.GetLinksRequest {
581+ PageSize: dubgo.Pointer [float64 ](50 ),
626582 })
627583 if err != nil {
628584 log.Fatal (err)
629585 }
630586 if res != nil {
631- // handle response
587+ for {
588+ // handle items
589+
590+ res, err = res.Next ()
591+
592+ if err != nil {
593+ // handle error
594+ }
595+
596+ if res == nil {
597+ break
598+ }
599+ }
632600 }
633601}
634602
0 commit comments