(Collection)
- CreateCommerceCollection - Create a collection
- GetCommerceCollection - Retrieve a collection
- ListCommerceCollections - List all collections
- PatchCommerceCollection - Update a collection
- RemoveCommerceCollection - Remove a collection
- UpdateCommerceCollection - Update a collection
Create a collection
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"context"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"log"
)
func main() {
s := unifiedgosdk.New()
ctx := context.Background()
res, err := s.Collection.CreateCommerceCollection(ctx, operations.CreateCommerceCollectionRequest{
ConnectionID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.CommerceCollection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CreateCommerceCollectionRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreateCommerceCollectionResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieve a collection
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"context"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"log"
)
func main() {
s := unifiedgosdk.New()
ctx := context.Background()
res, err := s.Collection.GetCommerceCollection(ctx, operations.GetCommerceCollectionRequest{
ConnectionID: "<value>",
ID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res.CommerceCollection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetCommerceCollectionRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetCommerceCollectionResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
List all collections
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"context"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"log"
)
func main() {
s := unifiedgosdk.New()
ctx := context.Background()
res, err := s.Collection.ListCommerceCollections(ctx, operations.ListCommerceCollectionsRequest{
ConnectionID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.CommerceCollections != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListCommerceCollectionsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListCommerceCollectionsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Update a collection
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"context"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"log"
)
func main() {
s := unifiedgosdk.New()
ctx := context.Background()
res, err := s.Collection.PatchCommerceCollection(ctx, operations.PatchCommerceCollectionRequest{
ConnectionID: "<value>",
ID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res.CommerceCollection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.PatchCommerceCollectionRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PatchCommerceCollectionResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Remove a collection
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"context"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"log"
)
func main() {
s := unifiedgosdk.New()
ctx := context.Background()
res, err := s.Collection.RemoveCommerceCollection(ctx, operations.RemoveCommerceCollectionRequest{
ConnectionID: "<value>",
ID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.RemoveCommerceCollectionRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RemoveCommerceCollectionResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |
Update a collection
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"context"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"log"
)
func main() {
s := unifiedgosdk.New()
ctx := context.Background()
res, err := s.Collection.UpdateCommerceCollection(ctx, operations.UpdateCommerceCollectionRequest{
ConnectionID: "<value>",
ID: "<id>",
})
if err != nil {
log.Fatal(err)
}
if res.CommerceCollection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.UpdateCommerceCollectionRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.UpdateCommerceCollectionResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4XX, 5XX | */* |