@@ -26,9 +26,9 @@ package main
2626
2727import (
2828 " context"
29- " github.com/codatio/client-sdk-go/previous-versions/commerce"
30- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
31- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
29+ commerce " github.com/codatio/client-sdk-go/previous-versions/commerce/v3 "
30+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/operations"
31+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/shared"
3232 " log"
3333)
3434
@@ -43,7 +43,7 @@ func main() {
4343 res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
4444 CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
4545 ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
46- CustomerID: " <value> " ,
46+ CustomerID: " 7110701885 " ,
4747 })
4848 if err != nil {
4949 log.Fatal (err)
@@ -118,12 +118,6 @@ func main() {
118118
119119
120120
121- <!-- Start Special Types [types] -->
122- ## Special Types
123-
124-
125- <!-- End Special Types [types] -->
126-
127121<!-- Start Summary [summary] -->
128122## Summary
129123
@@ -170,7 +164,6 @@ Standardize how you connect to your customers’ payment, PoS, and eCommerce sys
170164* [ Server Selection] ( #server-selection )
171165* [ Custom HTTP Client] ( #custom-http-client )
172166* [ Authentication] ( #authentication )
173- * [ Special Types] ( #special-types )
174167<!-- End Table of Contents [toc] -->
175168
176169<!-- Start Retries [retries] -->
@@ -184,10 +177,10 @@ package main
184177
185178import (
186179 " context"
187- " github.com/codatio/client-sdk-go/previous-versions/commerce"
188- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
189- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
190- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/retry"
180+ commerce " github.com/codatio/client-sdk-go/previous-versions/commerce/v3 "
181+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/operations"
182+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/shared"
183+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/retry"
191184 " log"
192185 " pkg/models/operations"
193186)
@@ -203,7 +196,7 @@ func main() {
203196 res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
204197 CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
205198 ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
206- CustomerID: " <value> " ,
199+ CustomerID: " 7110701885 " ,
207200 }, operations.WithRetries (
208201 retry.Config {
209202 Strategy: " backoff" ,
@@ -231,10 +224,10 @@ package main
231224
232225import (
233226 " context"
234- " github.com/codatio/client-sdk-go/previous-versions/commerce"
235- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
236- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
237- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/retry"
227+ commerce " github.com/codatio/client-sdk-go/previous-versions/commerce/v3 "
228+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/operations"
229+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/shared"
230+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/retry"
238231 " log"
239232)
240233
@@ -260,7 +253,7 @@ func main() {
260253 res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
261254 CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
262255 ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
263- CustomerID: " <value> " ,
256+ CustomerID: " 7110701885 " ,
264257 })
265258 if err != nil {
266259 log.Fatal (err)
@@ -276,12 +269,16 @@ func main() {
276269<!-- Start Error Handling [errors] -->
277270## Error Handling
278271
279- Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.
272+ Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.
273+
274+ By 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.
275+
276+ For example, the ` Get ` function may return the following errors:
280277
281- | Error Object | Status Code | Content Type |
282- | ------------------------------- | ------------------------------- | --------------- ---------------- |
283- | sdkerrors.ErrorMessage | 401,402,403,404,409,429,500,503 | application/json |
284- | sdkerrors.SDKError | 4xx-5xx | * / * |
278+ | Error Type | Status Code | Content Type |
279+ | ---------------------- | -------------------------------------- | ---------------- |
280+ | sdkerrors.ErrorMessage | 401, 402, 403, 404, 409, 429, 500, 503 | application/json |
281+ | sdkerrors.SDKError | 4XX, 5XX | \* / \* |
285282
286283### Example
287284
@@ -291,10 +288,10 @@ package main
291288import (
292289 " context"
293290 " errors"
294- " github.com/codatio/client-sdk-go/previous-versions/commerce"
295- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
296- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/sdkerrors"
297- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
291+ commerce " github.com/codatio/client-sdk-go/previous-versions/commerce/v3 "
292+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/operations"
293+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/sdkerrors"
294+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/shared"
298295 " log"
299296)
300297
@@ -309,7 +306,7 @@ func main() {
309306 res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
310307 CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
311308 ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
312- CustomerID: " <value> " ,
309+ CustomerID: " 7110701885 " ,
313310 })
314311 if err != nil {
315312
@@ -333,63 +330,17 @@ func main() {
333330<!-- Start Server Selection [server] -->
334331## Server Selection
335332
336- ### Select Server by Index
337-
338- You can override the default server globally using the ` WithServerIndex ` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
339-
340- | # | Server | Variables |
341- | - | ------ | --------- |
342- | 0 | ` https://api.codat.io ` | None |
343-
344- #### Example
345-
346- ``` go
347- package main
348-
349- import (
350- " context"
351- " github.com/codatio/client-sdk-go/previous-versions/commerce"
352- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
353- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
354- " log"
355- )
356-
357- func main () {
358- s := commerce.New (
359- commerce.WithServerIndex (0 ),
360- commerce.WithSecurity (shared.Security {
361- AuthHeader: " Basic BASE_64_ENCODED(API_KEY)" ,
362- }),
363- )
364-
365- ctx := context.Background ()
366- res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
367- CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
368- ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
369- CustomerID: " <value>" ,
370- })
371- if err != nil {
372- log.Fatal (err)
373- }
374- if res.Customer != nil {
375- // handle response
376- }
377- }
378-
379- ```
380-
381-
382333### Override Server URL Per-Client
383334
384- The default server can also be overridden globally using the ` WithServerURL ` option when initializing the SDK client instance. For example:
335+ The default server can also be overridden globally using the ` WithServerURL(serverURL string) ` option when initializing the SDK client instance. For example:
385336``` go
386337package main
387338
388339import (
389340 " context"
390- " github.com/codatio/client-sdk-go/previous-versions/commerce"
391- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
392- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
341+ commerce " github.com/codatio/client-sdk-go/previous-versions/commerce/v3 "
342+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/operations"
343+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/shared"
393344 " log"
394345)
395346
@@ -405,7 +356,7 @@ func main() {
405356 res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
406357 CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
407358 ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
408- CustomerID: " <value> " ,
359+ CustomerID: " 7110701885 " ,
409360 })
410361 if err != nil {
411362 log.Fatal (err)
@@ -454,19 +405,19 @@ This can be a convenient way to configure timeouts, cookies, proxies, custom hea
454405
455406This SDK supports the following security scheme globally:
456407
457- | Name | Type | Scheme |
458- | ------------ | ------------ | ----- ------- |
459- | ` AuthHeader ` | apiKey | API key |
408+ | Name | Type | Scheme |
409+ | ------------ | ------ | ------- |
410+ | ` AuthHeader ` | apiKey | API key |
460411
461412You can configure it using the ` WithSecurity ` option when initializing the SDK client instance. For example:
462413``` go
463414package main
464415
465416import (
466417 " context"
467- " github.com/codatio/client-sdk-go/previous-versions/commerce"
468- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/operations"
469- " github.com/codatio/client-sdk-go/previous-versions/commerce/pkg/models/shared"
418+ commerce " github.com/codatio/client-sdk-go/previous-versions/commerce/v3 "
419+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/operations"
420+ " github.com/codatio/client-sdk-go/previous-versions/commerce/v3/ pkg/models/shared"
470421 " log"
471422)
472423
@@ -481,7 +432,7 @@ func main() {
481432 res , err := s.Customers .Get (ctx, operations.GetCustomerRequest {
482433 CompanyID: " 8a210b68-6988-11ed-a1eb-0242ac120002" ,
483434 ConnectionID: " 2e9d2c44-f675-40ba-8049-353bfcb5e171" ,
484- CustomerID: " <value> " ,
435+ CustomerID: " 7110701885 " ,
485436 })
486437 if err != nil {
487438 log.Fatal (err)
0 commit comments