(Metadata)
REST APIs for managing Version Metadata entities
- DeleteVersionMetadata - Delete metadata for a particular apiID and versionID.
- GetVersionMetadata - Get all metadata for a particular apiID and versionID.
- InsertVersionMetadata - Insert metadata for a particular apiID and versionID.
Delete metadata for a particular apiID and versionID.
package main
import(
speakeasyclientsdkgo "github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
"context"
"log"
)
func main() {
s := speakeasyclientsdkgo.New(
speakeasyclientsdkgo.WithSecurity(shared.Security{
APIKey: speakeasyclientsdkgo.String("<YOUR_API_KEY_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Metadata.DeleteVersionMetadata(ctx, operations.DeleteVersionMetadataRequest{
APIID: "<value>",
MetaKey: "<value>",
MetaValue: "<value>",
VersionID: "<value>",
})
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.DeleteVersionMetadataRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DeleteVersionMetadataResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | 4XX | application/json |
sdkerrors.SDKError | 5XX | */* |
Get all metadata for a particular apiID and versionID.
package main
import(
speakeasyclientsdkgo "github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
"context"
"log"
)
func main() {
s := speakeasyclientsdkgo.New(
speakeasyclientsdkgo.WithSecurity(shared.Security{
APIKey: speakeasyclientsdkgo.String("<YOUR_API_KEY_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Metadata.GetVersionMetadata(ctx, operations.GetVersionMetadataRequest{
APIID: "<value>",
VersionID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.VersionMetadata != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetVersionMetadataRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetVersionMetadataResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | 4XX | application/json |
sdkerrors.SDKError | 5XX | */* |
Insert metadata for a particular apiID and versionID.
package main
import(
speakeasyclientsdkgo "github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
"context"
"log"
)
func main() {
s := speakeasyclientsdkgo.New(
speakeasyclientsdkgo.WithSecurity(shared.Security{
APIKey: speakeasyclientsdkgo.String("<YOUR_API_KEY_HERE>"),
}),
)
ctx := context.Background()
res, err := s.Metadata.InsertVersionMetadata(ctx, operations.InsertVersionMetadataRequest{
VersionMetadata: shared.VersionMetadataInput{
MetaKey: "<value>",
MetaValue: "<value>",
},
APIID: "<value>",
VersionID: "<value>",
})
if err != nil {
log.Fatal(err)
}
if res.VersionMetadata != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.InsertVersionMetadataRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.InsertVersionMetadataResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.Error | 4XX | application/json |
sdkerrors.SDKError | 5XX | */* |