Class Spec (0.2.2)

Spec(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Represents a spec associated with an API version in the API Hub. Note that specs of various types can be uploaded, however parsing of details is supported for OpenAPI spec currently.

Attributes

Name Description
name str
Identifier. The name of the spec. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}
display_name str
Required. The display name of the spec. This can contain the file name of the spec.
spec_type google.cloud.apihub_v1.types.AttributeValues
Required. The type of spec. The value should be one of the allowed values defined for projects/{project}/locations/{location}/attributes/system-spec-type attribute. The number of values for this attribute will be based on the cardinality of the attribute. The same can be retrieved via GetAttribute API. Note, this field is mandatory if content is provided.
contents google.cloud.apihub_v1.types.SpecContents
Optional. Input only. The contents of the uploaded spec.
details google.cloud.apihub_v1.types.SpecDetails
Output only. Details parsed from the spec.
source_uri str
Optional. The URI of the spec source in case file is uploaded from an external version control system.
create_time google.protobuf.timestamp_pb2.Timestamp
Output only. The time at which the spec was created.
update_time google.protobuf.timestamp_pb2.Timestamp
Output only. The time at which the spec was last updated.
lint_response google.cloud.apihub_v1.types.LintResponse
Optional. The lint response for the spec.
attributes MutableMapping[str, google.cloud.apihub_v1.types.AttributeValues]
Optional. The list of user defined attributes associated with the spec. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute}. The value is the attribute values associated with the resource.
documentation google.cloud.apihub_v1.types.Documentation
Optional. The documentation of the spec. For OpenAPI spec, this will be populated from externalDocs in OpenAPI spec.
parsing_mode google.cloud.apihub_v1.types.Spec.ParsingMode
Optional. Input only. Enum specifying the parsing mode for OpenAPI Specification (OAS) parsing.

Classes

AttributesEntry

AttributesEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The abstract base class for a message.

Parameters
Name Description
kwargs dict

Keys and values corresponding to the fields of the message.

mapping Union[dict, .Message]

A dictionary or message to be used to determine the values for this message.

ignore_unknown_fields Optional(bool)

If True, do not raise errors for unknown fields. Only applied if mapping is a mapping type or there are keyword parameters.

ParsingMode

ParsingMode(value)

Specifies the parsing mode for API specifications during creation and update.

  • RELAXED: Parsing errors in the specification content do not fail the API call.
  • STRICT: Parsing errors in the specification content result in failure of the API call. If not specified, defaults to RELAXED.