(Storage)
- CreateStorageFile - Create a file
- GetStorageFile - Retrieve a file
- ListStorageFiles - List all files
- PatchStorageFile - Update a file
- RemoveStorageFile - Remove a file
- UpdateStorageFile - Update a file
Create a file
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New()
request := operations.CreateStorageFileRequest{
ConnectionID: "<value>",
}
ctx := context.Background()
res, err := s.Storage.CreateStorageFile(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.StorageFile != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CreateStorageFileRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.CreateStorageFileResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Retrieve a file
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New()
request := operations.GetStorageFileRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Storage.GetStorageFile(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.StorageFile != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetStorageFileRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetStorageFileResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
List all files
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New()
request := operations.ListStorageFilesRequest{
ConnectionID: "<value>",
}
ctx := context.Background()
res, err := s.Storage.ListStorageFiles(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.StorageFiles != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.ListStorageFilesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.ListStorageFilesResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update a file
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New()
request := operations.PatchStorageFileRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Storage.PatchStorageFile(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.StorageFile != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.PatchStorageFileRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.PatchStorageFileResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Remove a file
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New()
request := operations.RemoveStorageFileRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Storage.RemoveStorageFile(ctx, request)
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.RemoveStorageFileRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.RemoveStorageFileResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |
Update a file
package main
import(
unifiedgosdk "github.com/unified-to/unified-go-sdk"
"github.com/unified-to/unified-go-sdk/pkg/models/operations"
"context"
"log"
)
func main() {
s := unifiedgosdk.New()
request := operations.UpdateStorageFileRequest{
ConnectionID: "<value>",
ID: "<id>",
}
ctx := context.Background()
res, err := s.Storage.UpdateStorageFile(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.StorageFile != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.UpdateStorageFileRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.UpdateStorageFileResponse, error
Error Object | Status Code | Content Type |
---|---|---|
sdkerrors.SDKError | 4xx-5xx | / |