# Compute V1 Client - Class License (2.10.0)

2.10.0 (latest) 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.0.0 1.36.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.24.0 1.23.0 1.22.1 1.21.0 1.20.0 1.19.0 1.18.1 1.17.0 1.16.2 1.14.0 1.13.0 1.12.1 1.11.1 1.10.1 1.9.1 1.8.3 1.7.1 1.6.1 1.5.0 Reference documentation and code samples for the Compute V1 Client class License.

Represents a License resource.

A License represents billing and aggregate usage data forpublic andmarketplace images.
*Caution* This resource is intended for
use only by third-party partners who are creatingCloud Marketplace
images.

Generated from protobuf message `google.cloud.compute.v1.License`

## Namespace

Google \\ Cloud \\ Compute \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ allowed_replacement_licenses` | `string[]` Specifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removable_from_disk is false. |
| `↳ appendable_to_disk` | `bool` If true, this license can be appended to an existing disk's set of licenses. |
| `↳ charges_use_fee` | `bool` \[Output Only\] Deprecated. This field no longer reflects whether a license charges a usage fee. |
| `↳ creation_timestamp` | `string` Output only. \[Output Only\] Creation timestamp inRFC3339 text format. |
| `↳ description` | `string` An optional textual description of the resource; provided by the client when the resource is created. |
| `↳ id` | `int|string` \[Output Only\] The unique identifier for the resource. This identifier is defined by the server. |
| `↳ incompatible_licenses` | `string[]` Specifies licenseCodes of licenses that are incompatible with this license. If a license is incompatible with this license, it cannot be attached to the same disk or image. |
| `↳ kind` | `string` Output only. \[Output Only\] Type of resource. Always compute#license for licenses. |
| `↳ license_code` | `int|string` \[Output Only\] The unique code used to attach this license to images, snapshots, and disks. |
| `↳ minimum_retention` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.Duration` If set, this license will be unable to be removed or replaced once attached to a disk until the minimum_retention period has passed. |
| `↳ multi_tenant_only` | `bool` If true, this license can only be used on VMs on multi tenant nodes. |
| `↳ name` | `string` Name of the resource. The name must be 1-63 characters long and comply withRFC1035. |
| `↳ os_license` | `bool` If true, indicates this is an OS license. Only one OS license can be attached to a disk or image at a time. |
| `↳ params` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.LicenseParams` Input only. Additional params passed with the request, but not persisted as part of resource payload. |
| `↳ removable_from_disk` | `bool` If true, this license can be removed from a disk's set of licenses, with no replacement license needed. |
| `↳ required_coattached_licenses` | `string[]` Specifies the set of permissible coattached licenseCodes of licenses that satisfy the coattachment requirement of this license. At least one license from the set must be attached to the same disk or image as this license. |
| `↳ resource_requirements` | `https://docs.cloud.google.com/php/docs/reference/cloud-compute/latest/V1.LicenseResourceRequirements` \[Input Only\] Deprecated. |
| `↳ self_link` | `string` Output only. \[Output Only\] Server-defined URL for the resource. |
| `↳ self_link_with_id` | `string` Output only. \[Output Only\] Server-defined URL for this resource with the resource id. |
| `↳ sole_tenant_only` | `bool` If true, this license can only be used on VMs on sole tenant nodes. |
| `↳ transferable` | `bool` If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. |
| `↳ update_timestamp` | `string` Output only. \[Output Only\] Last update timestamp inRFC3339 text format. |

### getAllowedReplacementLicenses

Specifies licenseCodes of licenses that can replace this license. Note:
such replacements are allowed even if removable_from_disk is false.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedReplacementLicenses

Specifies licenseCodes of licenses that can replace this license. Note:
such replacements are allowed even if removable_from_disk is false.

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

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

### getAppendableToDisk

If true, this license can be appended to an existing disk's set of
licenses.

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

### hasAppendableToDisk

### clearAppendableToDisk

### setAppendableToDisk

If true, this license can be appended to an existing disk's set of
licenses.

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

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

### getChargesUseFee

\[Output Only\] Deprecated. This field no longer reflects whether a license
charges a usage fee.

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

### hasChargesUseFee

### clearChargesUseFee

### setChargesUseFee

\[Output Only\] Deprecated. This field no longer reflects whether a license
charges a usage fee.

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

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

### getCreationTimestamp

Output only. \[Output Only\] Creation timestamp inRFC3339
text format.

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

### hasCreationTimestamp

### clearCreationTimestamp

### setCreationTimestamp

Output only. \[Output Only\] Creation timestamp inRFC3339
text format.

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

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

### getDescription

An optional textual description of the resource; provided by the client
when the resource is created.

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

### hasDescription

### clearDescription

### setDescription

An optional textual description of the resource; provided by the client
when the resource is created.

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

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

### getId

\[Output Only\] The unique identifier for the resource. This identifier is
defined by the server.

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

### hasId

### clearId

### setId

\[Output Only\] The unique identifier for the resource. This identifier is
defined by the server.

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

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

### getIncompatibleLicenses

Specifies licenseCodes of licenses that are incompatible with this license.

If a license is incompatible with this license, it cannot be attached to
the same disk or image.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setIncompatibleLicenses

Specifies licenseCodes of licenses that are incompatible with this license.

If a license is incompatible with this license, it cannot be attached to
the same disk or image.

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

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

### getKind

Output only. \[Output Only\] Type of resource. Always compute#license for
licenses.

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

### hasKind

### clearKind

### setKind

Output only. \[Output Only\] Type of resource. Always compute#license for
licenses.

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

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

### getLicenseCode

\[Output Only\] The unique code used to attach this license to images,
snapshots, and disks.

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

### hasLicenseCode

### clearLicenseCode

### setLicenseCode

\[Output Only\] The unique code used to attach this license to images,
snapshots, and disks.

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

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

### getMinimumRetention

If set, this license will be unable to be removed or replaced once attached
to a disk until the minimum_retention period has passed.

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

### hasMinimumRetention

### clearMinimumRetention

### setMinimumRetention

If set, this license will be unable to be removed or replaced once attached
to a disk until the minimum_retention period has passed.

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

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

### getMultiTenantOnly

If true, this license can only be used on VMs on multi tenant nodes.

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

### hasMultiTenantOnly

### clearMultiTenantOnly

### setMultiTenantOnly

If true, this license can only be used on VMs on multi tenant nodes.

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

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

### getName

Name of the resource. The name must be 1-63 characters long and
comply withRFC1035.

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

### hasName

### clearName

### setName

Name of the resource. The name must be 1-63 characters long and
comply withRFC1035.

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

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

### getOsLicense

If true, indicates this is an OS license. Only one OS license can be
attached to a disk or image at a time.

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

### hasOsLicense

### clearOsLicense

### setOsLicense

If true, indicates this is an OS license. Only one OS license can be
attached to a disk or image at a time.

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

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

### getParams

Input only. Additional params passed with the request, but not persisted
as part of resource payload.

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

### hasParams

### clearParams

### setParams

Input only. Additional params passed with the request, but not persisted
as part of resource payload.

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

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

### getRemovableFromDisk

If true, this license can be removed from a disk's set of licenses, with no
replacement license needed.

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

### hasRemovableFromDisk

### clearRemovableFromDisk

### setRemovableFromDisk

If true, this license can be removed from a disk's set of licenses, with no
replacement license needed.

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

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

### getRequiredCoattachedLicenses

Specifies the set of permissible coattached licenseCodes of licenses that
satisfy the coattachment requirement of this license. At least one license
from the set must be attached to the same disk or image as this license.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setRequiredCoattachedLicenses

Specifies the set of permissible coattached licenseCodes of licenses that
satisfy the coattachment requirement of this license. At least one license
from the set must be attached to the same disk or image as this license.

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

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

### getResourceRequirements

\[Input Only\] Deprecated.

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

### hasResourceRequirements

### clearResourceRequirements

### setResourceRequirements

\[Input Only\] Deprecated.

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

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

### getSelfLink

Output only. \[Output Only\] Server-defined URL for the resource.

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

### hasSelfLink

### clearSelfLink

### setSelfLink

Output only. \[Output Only\] Server-defined URL for the resource.

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

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

### getSelfLinkWithId

Output only. \[Output Only\] Server-defined URL for this resource with the resource id.

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

### hasSelfLinkWithId

### clearSelfLinkWithId

### setSelfLinkWithId

Output only. \[Output Only\] Server-defined URL for this resource with the resource id.

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

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

### getSoleTenantOnly

If true, this license can only be used on VMs on sole tenant nodes.

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

### hasSoleTenantOnly

### clearSoleTenantOnly

### setSoleTenantOnly

If true, this license can only be used on VMs on sole tenant nodes.

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

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

### getTransferable

If false, licenses will not be copied from the source resource when
creating an image from a disk, disk from snapshot, or snapshot from disk.

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

### hasTransferable

### clearTransferable

### setTransferable

If false, licenses will not be copied from the source resource when
creating an image from a disk, disk from snapshot, or snapshot from disk.

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

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

### getUpdateTimestamp

Output only. \[Output Only\] Last update timestamp inRFC3339
text format.

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

### hasUpdateTimestamp

### clearUpdateTimestamp

### setUpdateTimestamp

Output only. \[Output Only\] Last update timestamp inRFC3339
text format.

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

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