# Google Cloud Database Center V1beta Client - Class Tag (0.7.0)

0.7.0 (latest) 0.6.0 0.5.0 0.4.1 0.3.1 0.2.0 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Database Center V1beta Client class Tag.

Tag is a key value pair attached to a resource.

Generated from protobuf message `google.cloud.databasecenter.v1beta.Tag`

## Namespace

Google \\ Cloud \\ DatabaseCenter \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ key` | `string` |
| `↳ value` | `string` The value part of the tag. |
| `↳ source` | `string` The source of the tag. According to <https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels>, tags can be created only at the project or organization level. Tags can be inherited from different project as well not just the current project where the database resource is present. Format: "projects/{PROJECT_ID}", "projects/{PROJECT_NUMBER}", "organizations/{ORGANIZATION_ID}" |
| `↳ inherited` | `bool` Indicates the inheritance status of a tag value attached to the given resource. If the tag value is inherited from one of the resource's ancestors, inherited will be true. If false, then the tag value is directly attached to the resource. |

### getKey

Generated from protobuf field `string key = 1;`

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

### setKey

Generated from protobuf field `string key = 1;`

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

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

### getValue

The value part of the tag.

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

### setValue

The value part of the tag.

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

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

### getSource

The source of the tag. According to
<https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels>,
tags can be created only at the project or organization level. Tags can be
inherited from different project as well not just the current project where
the database resource is present.

Format:
"projects/{PROJECT_ID}",
"projects/{PROJECT_NUMBER}",
"organizations/{ORGANIZATION_ID}"

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

### setSource

The source of the tag. According to
<https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels>,
tags can be created only at the project or organization level. Tags can be
inherited from different project as well not just the current project where
the database resource is present.

Format:
"projects/{PROJECT_ID}",
"projects/{PROJECT_NUMBER}",
"organizations/{ORGANIZATION_ID}"

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

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

### getInherited

Indicates the inheritance status of a tag value
attached to the given resource. If the tag value is inherited from one of
the resource's ancestors, inherited will be true. If false, then the tag
value is directly attached to the resource.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setInherited

Indicates the inheritance status of a tag value
attached to the given resource. If the tag value is inherited from one of
the resource's ancestors, inherited will be true. If false, then the tag
value is directly attached to the resource.

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

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