@@ -40,7 +40,7 @@ For more information about the API: [The Speakeasy Platform Documentation](/docs
40
40
41
41
To add the SDK as a dependency to your project:
42
42
``` bash
43
- go get github.com/speakeasy-api/speakeasy-client-sdk-go
43
+ go get github.com/speakeasy-api/speakeasy-client-sdk-go/v3
44
44
```
45
45
<!-- End SDK Installation [installation] -->
46
46
@@ -54,17 +54,17 @@ package main
54
54
55
55
import (
56
56
" context"
57
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
57
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
58
58
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
59
59
" log"
60
60
)
61
61
62
62
func main () {
63
63
ctx := context.Background ()
64
64
65
- s := speakeasyclientsdkgo .New (
66
- speakeasyclientsdkgo .WithSecurity (shared.Security {
67
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
65
+ s := v3 .New (
66
+ v3 .WithSecurity (shared.Security {
67
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
68
68
}),
69
69
)
70
70
@@ -236,7 +236,7 @@ package main
236
236
import (
237
237
" context"
238
238
" errors"
239
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
239
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
240
240
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/sdkerrors"
241
241
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
242
242
" log"
@@ -245,9 +245,9 @@ import (
245
245
func main () {
246
246
ctx := context.Background ()
247
247
248
- s := speakeasyclientsdkgo .New (
249
- speakeasyclientsdkgo .WithSecurity (shared.Security {
250
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
248
+ s := v3 .New (
249
+ v3 .WithSecurity (shared.Security {
250
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
251
251
}),
252
252
)
253
253
@@ -291,18 +291,18 @@ package main
291
291
292
292
import (
293
293
" context"
294
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
294
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
295
295
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
296
296
" log"
297
297
)
298
298
299
299
func main () {
300
300
ctx := context.Background ()
301
301
302
- s := speakeasyclientsdkgo .New (
303
- speakeasyclientsdkgo .WithServer (" prod" ),
304
- speakeasyclientsdkgo .WithSecurity (shared.Security {
305
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
302
+ s := v3 .New (
303
+ v3 .WithServer (" prod" ),
304
+ v3 .WithSecurity (shared.Security {
305
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
306
306
}),
307
307
)
308
308
@@ -325,18 +325,18 @@ package main
325
325
326
326
import (
327
327
" context"
328
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
328
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
329
329
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
330
330
" log"
331
331
)
332
332
333
333
func main () {
334
334
ctx := context.Background ()
335
335
336
- s := speakeasyclientsdkgo .New (
337
- speakeasyclientsdkgo .WithServerURL (" https://api.prod.speakeasy.com" ),
338
- speakeasyclientsdkgo .WithSecurity (shared.Security {
339
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
336
+ s := v3 .New (
337
+ v3 .WithServerURL (" https://api.prod.speakeasy.com" ),
338
+ v3 .WithSecurity (shared.Security {
339
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
340
340
}),
341
341
)
342
342
@@ -371,12 +371,13 @@ The built-in `net/http` client satisfies this interface and a default client bas
371
371
import (
372
372
" net/http"
373
373
" time"
374
- " github.com/myorg/your-go-sdk"
374
+
375
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
375
376
)
376
377
377
378
var (
378
379
httpClient = &http.Client {Timeout: 30 * time.Second }
379
- sdkClient = sdk .New (sdk .WithClient (httpClient))
380
+ sdkClient = v3 .New (v3 .WithClient (httpClient))
380
381
)
381
382
```
382
383
@@ -404,17 +405,17 @@ package main
404
405
405
406
import (
406
407
" context"
407
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
408
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
408
409
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
409
410
" log"
410
411
)
411
412
412
413
func main () {
413
414
ctx := context.Background ()
414
415
415
- s := speakeasyclientsdkgo .New (
416
- speakeasyclientsdkgo .WithSecurity (shared.Security {
417
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
416
+ s := v3 .New (
417
+ v3 .WithSecurity (shared.Security {
418
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
418
419
}),
419
420
)
420
421
@@ -453,15 +454,17 @@ package main
453
454
454
455
import (
455
456
" context"
456
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
457
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
457
458
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
458
459
" log"
459
460
)
460
461
461
462
func main () {
462
463
ctx := context.Background ()
463
464
464
- s := speakeasyclientsdkgo.New ()
465
+ s := v3.New (
466
+ v3.WithWorkspaceID (" <id>" ),
467
+ )
465
468
466
469
res , err := s.Auth .GetAccessToken (ctx, operations.GetAccessTokenRequest {
467
470
WorkspaceID: " <id>" ,
@@ -488,7 +491,7 @@ package main
488
491
489
492
import (
490
493
" context"
491
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
494
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
492
495
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
493
496
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/retry"
494
497
" log"
@@ -498,9 +501,9 @@ import (
498
501
func main () {
499
502
ctx := context.Background ()
500
503
501
- s := speakeasyclientsdkgo .New (
502
- speakeasyclientsdkgo .WithSecurity (shared.Security {
503
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
504
+ s := v3 .New (
505
+ v3 .WithSecurity (shared.Security {
506
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
504
507
}),
505
508
)
506
509
@@ -531,7 +534,7 @@ package main
531
534
532
535
import (
533
536
" context"
534
- speakeasyclientsdkgo " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
537
+ " github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
535
538
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
536
539
" github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/retry"
537
540
" log"
@@ -540,8 +543,8 @@ import (
540
543
func main () {
541
544
ctx := context.Background ()
542
545
543
- s := speakeasyclientsdkgo .New (
544
- speakeasyclientsdkgo .WithRetryConfig (
546
+ s := v3 .New (
547
+ v3 .WithRetryConfig (
545
548
retry.Config {
546
549
Strategy: " backoff" ,
547
550
Backoff: &retry.BackoffStrategy {
@@ -552,8 +555,8 @@ func main() {
552
555
},
553
556
RetryConnectionErrors: false ,
554
557
}),
555
- speakeasyclientsdkgo .WithSecurity (shared.Security {
556
- APIKey: speakeasyclientsdkgo. String (" <YOUR_API_KEY_HERE>" ),
558
+ v3 .WithSecurity (shared.Security {
559
+ APIKey: v3. Pointer (" <YOUR_API_KEY_HERE>" ),
557
560
}),
558
561
)
559
562
0 commit comments