Class ApiSpec (0.54.0)

public final class ApiSpec extends GeneratedMessageV3 implements ApiSpecOrBuilder

Describes a version of an API in a structured way. ApiSpecs provide formal descriptions that consumers can use to use a version. ApiSpec resources are intended to be fully-resolved descriptions of an ApiVersion. When specs consist of multiple files, these should be bundled together (e.g., in a zip archive) and stored as a unit. Multiple specs can exist to provide representations in different API description formats. Synchronization of these representations would be provided by tooling and background services.

Protobuf type google.cloud.apigeeregistry.v1.ApiSpec

Implements

ApiSpecOrBuilder

Static Fields

ANNOTATIONS_FIELD_NUMBER

public static final int ANNOTATIONS_FIELD_NUMBER
Field Value
Type Description
int

CONTENTS_FIELD_NUMBER

public static final int CONTENTS_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

FILENAME_FIELD_NUMBER

public static final int FILENAME_FIELD_NUMBER
Field Value
Type Description
int

HASH_FIELD_NUMBER

public static final int HASH_FIELD_NUMBER
Field Value
Type Description
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
Type Description
int

MIME_TYPE_FIELD_NUMBER

public static final int MIME_TYPE_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

REVISION_CREATE_TIME_FIELD_NUMBER

public static final int REVISION_CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

REVISION_ID_FIELD_NUMBER

public static final int REVISION_ID_FIELD_NUMBER
Field Value
Type Description
int

REVISION_UPDATE_TIME_FIELD_NUMBER

public static final int REVISION_UPDATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

SIZE_BYTES_FIELD_NUMBER

public static final int SIZE_BYTES_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_URI_FIELD_NUMBER

public static final int SOURCE_URI_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ApiSpec getDefaultInstance()
Returns
Type Description
ApiSpec

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ApiSpec.Builder newBuilder()
Returns
Type Description
ApiSpec.Builder

newBuilder(ApiSpec prototype)

public static ApiSpec.Builder newBuilder(ApiSpec prototype)
Parameter
Name Description
prototype ApiSpec
Returns
Type Description
ApiSpec.Builder

parseDelimitedFrom(InputStream input)

public static ApiSpec parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ApiSpec
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ApiSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ApiSpec
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ApiSpec parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ApiSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ApiSpec parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ApiSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ApiSpec parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ApiSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ApiSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ApiSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ApiSpec parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ApiSpec
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ApiSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ApiSpec
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ApiSpec parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ApiSpec
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ApiSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ApiSpec
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ApiSpec parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ApiSpec
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ApiSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ApiSpec
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ApiSpec> parser()
Returns
Type Description
Parser<ApiSpec>

Methods

containsAnnotations(String key)

public boolean containsAnnotations(String key)

Annotations attach non-identifying metadata to resources.

Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.

map<string, string> annotations = 15;

Parameter
Name Description
key String
Returns
Type Description
boolean

containsLabels(String key)

public boolean containsLabels(String key)

Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded).

See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed.

map<string, string> labels = 14;

Parameter
Name Description
key String
Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAnnotations() (deprecated)

public Map<String,String> getAnnotations()

Use #getAnnotationsMap() instead.

Returns
Type Description
Map<String,String>

getAnnotationsCount()

public int getAnnotationsCount()

Annotations attach non-identifying metadata to resources.

Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.

map<string, string> annotations = 15;

Returns
Type Description
int

getAnnotationsMap()

public Map<String,String> getAnnotationsMap()

Annotations attach non-identifying metadata to resources.

Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.

map<string, string> annotations = 15;

Returns
Type Description
Map<String,String>

getAnnotationsOrDefault(String key, String defaultValue)

public String getAnnotationsOrDefault(String key, String defaultValue)

Annotations attach non-identifying metadata to resources.

Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.

map<string, string> annotations = 15;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getAnnotationsOrThrow(String key)

public String getAnnotationsOrThrow(String key)

Annotations attach non-identifying metadata to resources.

Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.

map<string, string> annotations = 15;

Parameter
Name Description
key String
Returns
Type Description
String

getContents()

public ByteString getContents()

Input only. The contents of the spec. Provided by API callers when specs are created or updated. To access the contents of a spec, use GetApiSpecContents.

bytes contents = 12 [(.google.api.field_behavior) = INPUT_ONLY];

Returns
Type Description
ByteString

The contents.

getCreateTime()

public Timestamp getCreateTime()

Output only. Creation timestamp; when the spec resource was created.

.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Creation timestamp; when the spec resource was created.

.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public ApiSpec getDefaultInstanceForType()
Returns
Type Description
ApiSpec

getDescription()

public String getDescription()

A detailed description.

string description = 3;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

A detailed description.

string description = 3;

Returns
Type Description
ByteString

The bytes for description.

getFilename()

public String getFilename()

A possibly-hierarchical name used to refer to the spec from other specs.

string filename = 2;

Returns
Type Description
String

The filename.

getFilenameBytes()

public ByteString getFilenameBytes()

A possibly-hierarchical name used to refer to the spec from other specs.

string filename = 2;

Returns
Type Description
ByteString

The bytes for filename.

getHash()

public String getHash()

Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is the hash of the uncompressed spec.

string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The hash.

getHashBytes()

public ByteString getHashBytes()

Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is the hash of the uncompressed spec.

string hash = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for hash.

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded).

See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed.

map<string, string> labels = 14;

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded).

See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed.

map<string, string> labels = 14;

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded).

See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed.

map<string, string> labels = 14;

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations.

Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded).

See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed.

map<string, string> labels = 14;

Parameter
Name Description
key String
Returns
Type Description
String

getMimeType()

public String getMimeType()

A style (format) descriptor for this spec that is specified as a Media Type (https://en.wikipedia.org/wiki/Media_type). Possible values include application/vnd.apigee.proto, application/vnd.apigee.openapi, and application/vnd.apigee.graphql, with possible suffixes representing compression types. These hypothetical names are defined in the vendor tree defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. Content types can specify compression. Currently only GZip compression is supported (indicated with "+gzip").

string mime_type = 8;

Returns
Type Description
String

The mimeType.

getMimeTypeBytes()

public ByteString getMimeTypeBytes()

A style (format) descriptor for this spec that is specified as a Media Type (https://en.wikipedia.org/wiki/Media_type). Possible values include application/vnd.apigee.proto, application/vnd.apigee.openapi, and application/vnd.apigee.graphql, with possible suffixes representing compression types. These hypothetical names are defined in the vendor tree defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. Content types can specify compression. Currently only GZip compression is supported (indicated with "+gzip").

string mime_type = 8;

Returns
Type Description
ByteString

The bytes for mimeType.

getName()

public String getName()

Resource name.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Resource name.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<ApiSpec> getParserForType()
Returns
Type Description
Parser<ApiSpec>
Overrides

getRevisionCreateTime()

public Timestamp getRevisionCreateTime()

Output only. Revision creation timestamp; when the represented revision was created.

.google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The revisionCreateTime.

getRevisionCreateTimeOrBuilder()

public TimestampOrBuilder getRevisionCreateTimeOrBuilder()

Output only. Revision creation timestamp; when the represented revision was created.

.google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getRevisionId()

public String getRevisionId()

Output only. Immutable. The revision ID of the spec. A new revision is committed whenever the spec contents are changed. The format is an 8-character hexadecimal string.

string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The revisionId.

getRevisionIdBytes()

public ByteString getRevisionIdBytes()

Output only. Immutable. The revision ID of the spec. A new revision is committed whenever the spec contents are changed. The format is an 8-character hexadecimal string.

string revision_id = 4 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for revisionId.

getRevisionUpdateTime()

public Timestamp getRevisionUpdateTime()

Output only. Last update timestamp: when the represented revision was last modified.

.google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The revisionUpdateTime.

getRevisionUpdateTimeOrBuilder()

public TimestampOrBuilder getRevisionUpdateTimeOrBuilder()

Output only. Last update timestamp: when the represented revision was last modified.

.google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSizeBytes()

public int getSizeBytes()

Output only. The size of the spec file in bytes. If the spec is gzipped, this is the size of the uncompressed spec.

int32 size_bytes = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The sizeBytes.

getSourceUri()

public String getSourceUri()

The original source URI of the spec (if one exists). This is an external location that can be used for reference purposes but which may not be authoritative since this external resource may change after the spec is retrieved.

string source_uri = 11;

Returns
Type Description
String

The sourceUri.

getSourceUriBytes()

public ByteString getSourceUriBytes()

The original source URI of the spec (if one exists). This is an external location that can be used for reference purposes but which may not be authoritative since this external resource may change after the spec is retrieved.

string source_uri = 11;

Returns
Type Description
ByteString

The bytes for sourceUri.

hasCreateTime()

public boolean hasCreateTime()

Output only. Creation timestamp; when the spec resource was created.

.google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasRevisionCreateTime()

public boolean hasRevisionCreateTime()

Output only. Revision creation timestamp; when the represented revision was created.

.google.protobuf.Timestamp revision_create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the revisionCreateTime field is set.

hasRevisionUpdateTime()

public boolean hasRevisionUpdateTime()

Output only. Last update timestamp: when the represented revision was last modified.

.google.protobuf.Timestamp revision_update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the revisionUpdateTime field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ApiSpec.Builder newBuilderForType()
Returns
Type Description
ApiSpec.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ApiSpec.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ApiSpec.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ApiSpec.Builder toBuilder()
Returns
Type Description
ApiSpec.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException