0.5.3 (latest) 0.4.4 0.3.0 0.2.1 0.1.4 Reference documentation and code samples for the Google Cloud Api Hub V1 Client class Spec.

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.

Generated from protobuf message `google.cloud.apihub.v1.Spec`

## Namespace

Google \\ Cloud \\ ApiHub \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. The name of the spec. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}` |
| `↳ display_name` | `string` Required. The display name of the spec. This can contain the file name of the spec. |
| `↳ spec_type` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.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` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SpecContents` Optional. Input only. The contents of the uploaded spec. |
| `↳ details` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SpecDetails` Output only. Details parsed from the spec. |
| `↳ source_uri` | `string` Optional. The URI of the spec source in case file is uploaded from an external version control system. |
| `↳ create_time` | `Google\Protobuf\Timestamp` Output only. The time at which the spec was created. |
| `↳ update_time` | `Google\Protobuf\Timestamp` Output only. The time at which the spec was last updated. |
| `↳ lint_response` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.LintResponse` Optional. The lint response for the spec. |
| `↳ attributes` | `array|Google\Protobuf\Internal\MapField` 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` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Documentation` Optional. The documentation of the spec. For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI spec. |
| `↳ parsing_mode` | `int` Optional. Input only. Enum specifying the parsing mode for OpenAPI Specification (OAS) parsing. |
| `↳ source_metadata` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SourceMetadata>` Output only. The list of sources and metadata from the sources of the spec. |

### getName

Identifier. The name of the spec.

Format:
`projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Identifier. The name of the spec.

Format:
`projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisplayName

Required. The display name of the spec.

This can contain the file name of the spec.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

Required. The display name of the spec.

This can contain the file name of the spec.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSpecType

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.AttributeValues|null` |   |

### hasSpecType

### clearSpecType

### setSpecType

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.AttributeValues` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getContents

Optional. Input only. The contents of the uploaded spec.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SpecContents|null` |   |

### hasContents

### clearContents

### setContents

Optional. Input only. The contents of the uploaded spec.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SpecContents` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDetails

Output only. Details parsed from the spec.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SpecDetails|null` |   |

### hasDetails

### clearDetails

### setDetails

Output only. Details parsed from the spec.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SpecDetails` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSourceUri

Optional. The URI of the spec source in case file is uploaded
from an external version control system.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setSourceUri

Optional. The URI of the spec source in case file is uploaded
from an external version control system.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. The time at which the spec was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time at which the spec was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The time at which the spec was last updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time at which the spec was last updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLintResponse

Optional. The lint response for the spec.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.LintResponse|null` |   |

### hasLintResponse

### clearLintResponse

### setLintResponse

Optional. The lint response for the spec.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.LintResponse` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAttributes

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Internal\MapField` |   |

### setAttributes

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|Google\Protobuf\Internal\MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDocumentation

Optional. The documentation of the spec.

For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
spec.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Documentation|null` |   |

### hasDocumentation

### clearDocumentation

### setDocumentation

Optional. The documentation of the spec.

For OpenAPI spec, this will be populated from `externalDocs` in OpenAPI
spec.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Documentation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getParsingMode

Optional. Input only. Enum specifying the parsing mode for OpenAPI
Specification (OAS) parsing.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ParsingMode](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Spec.ParsingMode). |

### setParsingMode

Optional. Input only. Enum specifying the parsing mode for OpenAPI
Specification (OAS) parsing.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ParsingMode](https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Spec.ParsingMode). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSourceMetadata

Output only. The list of sources and metadata from the sources of the spec.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SourceMetadata>` |   |

### setSourceMetadata

Output only. The list of sources and metadata from the sources of the spec.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.SourceMetadata>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |