Skip to content

Latest commit

 

History

History
189 lines (146 loc) · 10.5 KB

File metadata and controls

189 lines (146 loc) · 10.5 KB

Metadata

(Metadata)

Overview

REST APIs for managing Version Metadata entities

Available Operations

DeleteVersionMetadata

Delete metadata for a particular apiID and versionID.

Example Usage

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
    }
}

Parameters

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.

Response

*operations.DeleteVersionMetadataResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 4XX application/json
sdkerrors.SDKError 5XX */*

GetVersionMetadata

Get all metadata for a particular apiID and versionID.

Example Usage

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
    }
}

Parameters

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.

Response

*operations.GetVersionMetadataResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 4XX application/json
sdkerrors.SDKError 5XX */*

InsertVersionMetadata

Insert metadata for a particular apiID and versionID.

Example Usage

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
    }
}

Parameters

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.

Response

*operations.InsertVersionMetadataResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.Error 4XX application/json
sdkerrors.SDKError 5XX */*