Skip to content

Files

Latest commit

 

History

History
188 lines (133 loc) · 8.19 KB

File metadata and controls

188 lines (133 loc) · 8.19 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 hello.world;

import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.DeleteVersionMetadataRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.DeleteVersionMetadataResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        RyanTest sdk = RyanTest.builder()
                .security(Security.builder()
                    .apiKey("<YOUR_API_KEY_HERE>")
                    .build())
            .build();

        DeleteVersionMetadataRequest req = DeleteVersionMetadataRequest.builder()
                .apiID("<id>")
                .metaKey("<value>")
                .metaValue("<value>")
                .versionID("<id>")
                .build();

        DeleteVersionMetadataResponse res = sdk.metadata().deleteVersionMetadata()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request DeleteVersionMetadataRequest ✔️ The request object to use for the request.

Response

DeleteVersionMetadataResponse

Errors

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*

getVersionMetadata

Get all metadata for a particular apiID and versionID.

Example Usage

package hello.world;

import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetVersionMetadataRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.GetVersionMetadataResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        RyanTest sdk = RyanTest.builder()
                .security(Security.builder()
                    .apiKey("<YOUR_API_KEY_HERE>")
                    .build())
            .build();

        GetVersionMetadataRequest req = GetVersionMetadataRequest.builder()
                .apiID("<id>")
                .versionID("<id>")
                .build();

        GetVersionMetadataResponse res = sdk.metadata().getVersionMetadata()
                .request(req)
                .call();

        if (res.versionMetadata().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request GetVersionMetadataRequest ✔️ The request object to use for the request.

Response

GetVersionMetadataResponse

Errors

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*

insertVersionMetadata

Insert metadata for a particular apiID and versionID.

Example Usage

package hello.world;

import dev.speakeasyapi.javaclientsdk.RyanTest;
import dev.speakeasyapi.javaclientsdk.models.operations.InsertVersionMetadataRequest;
import dev.speakeasyapi.javaclientsdk.models.operations.InsertVersionMetadataResponse;
import dev.speakeasyapi.javaclientsdk.models.shared.Security;
import dev.speakeasyapi.javaclientsdk.models.shared.VersionMetadataInput;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Exception {

        RyanTest sdk = RyanTest.builder()
                .security(Security.builder()
                    .apiKey("<YOUR_API_KEY_HERE>")
                    .build())
            .build();

        InsertVersionMetadataRequest req = InsertVersionMetadataRequest.builder()
                .versionMetadata(VersionMetadataInput.builder()
                    .metaKey("<value>")
                    .metaValue("<value>")
                    .build())
                .apiID("<id>")
                .versionID("<id>")
                .build();

        InsertVersionMetadataResponse res = sdk.metadata().insertVersionMetadata()
                .request(req)
                .call();

        if (res.versionMetadata().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request InsertVersionMetadataRequest ✔️ The request object to use for the request.

Response

InsertVersionMetadataResponse

Errors

Error Type Status Code Content Type
models/errors/SDKError 4XX, 5XX */*