# Google Cloud Compute V1 API - Class Google::Cloud::Compute::V1::LicenseCode (v3.7.0)

3.7.0 (latest) 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.22.0 2.21.1 2.20.0 2.19.1 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.2 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.10.0 1.9.0 1.8.0 1.7.1 1.6.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.5.0 Reference documentation and code samples for the Google Cloud Compute V1 API class Google::Cloud::Compute::V1::LicenseCode.

Represents a License Code resource.


<br />

A License Code is a unique identifier used to represent alicense
resource.
*Caution* This resource is intended for
use only by third-party partners who are creatingCloud Marketplace
images.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #allowed_replacement_licenses

    def allowed_replacement_licenses() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Specifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removable_from_disk is false.

### #allowed_replacement_licenses=

    def allowed_replacement_licenses=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Specifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removable_from_disk is false.
**Returns**

- (::Array\<::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

    def appendable_to_disk() -> ::Boolean

**Returns**

- (::Boolean) --- If true, this license can be appended to an existing disk's set of licenses.

### #appendable_to_disk=

    def appendable_to_disk=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true, this license can be appended to an existing disk's set of licenses.
**Returns**

- (::Boolean) --- If true, this license can be appended to an existing disk's set of licenses.

### #creation_timestamp

    def creation_timestamp() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Creation timestamp inRFC3339 text format.

### #creation_timestamp=

    def creation_timestamp=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Creation timestamp inRFC3339 text format.
**Returns**

- (::String) --- Output only. \[Output Only\] Creation timestamp inRFC3339 text format.

### #description

    def description() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Description of this License Code.

### #description=

    def description=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Description of this License Code.
**Returns**

- (::String) --- Output only. \[Output Only\] Description of this License Code.

### #id

    def id() -> ::Integer

**Returns**

- (::Integer) --- Output only. \[Output Only\] The unique identifier for the resource. This identifier is defined by the server.

### #id=

    def id=(value) -> ::Integer

**Parameter**

- **value** (::Integer) --- Output only. \[Output Only\] The unique identifier for the resource. This identifier is defined by the server.
**Returns**

- (::Integer) --- Output only. \[Output Only\] The unique identifier for the resource. This identifier is defined by the server.

### #incompatible_licenses

    def incompatible_licenses() -> ::Array<::String>

**Returns**

- (::Array\<::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.

### #incompatible_licenses=

    def incompatible_licenses=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::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.
**Returns**

- (::Array\<::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

    def kind() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Type of resource. Always compute#licenseCode for licenses.

### #kind=

    def kind=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Type of resource. Always compute#licenseCode for licenses.
**Returns**

- (::String) --- Output only. \[Output Only\] Type of resource. Always compute#licenseCode for licenses.

### #license_alias

    def license_alias() -> ::Array<::Google::Cloud::Compute::V1::LicenseCodeLicenseAlias>

**Returns**

- (::Array\<[::Google::Cloud::Compute::V1::LicenseCodeLicenseAlias](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-LicenseCodeLicenseAlias)\>) --- \[Output Only\] URL and description aliases of Licenses with the same License Code.

### #license_alias=

    def license_alias=(value) -> ::Array<::Google::Cloud::Compute::V1::LicenseCodeLicenseAlias>

**Parameter**

- **value** (::Array\<[::Google::Cloud::Compute::V1::LicenseCodeLicenseAlias](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-LicenseCodeLicenseAlias)\>) --- \[Output Only\] URL and description aliases of Licenses with the same License Code.
**Returns**

- (::Array\<[::Google::Cloud::Compute::V1::LicenseCodeLicenseAlias](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-V1-LicenseCodeLicenseAlias)\>) --- \[Output Only\] URL and description aliases of Licenses with the same License Code.

### #minimum_retention

    def minimum_retention() -> ::Google::Cloud::Compute::V1::Duration

**Returns**

- ([::Google::Cloud::Compute::V1::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-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.

### #minimum_retention=

    def minimum_retention=(value) -> ::Google::Cloud::Compute::V1::Duration

**Parameter**

- **value** ([::Google::Cloud::Compute::V1::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-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.
**Returns**

- ([::Google::Cloud::Compute::V1::Duration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-compute-v1/latest/Google-Cloud-Compute-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

    def multi_tenant_only() -> ::Boolean

**Returns**

- (::Boolean) --- If true, this license can only be used on VMs on multi tenant nodes.

### #multi_tenant_only=

    def multi_tenant_only=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true, this license can only be used on VMs on multi tenant nodes.
**Returns**

- (::Boolean) --- If true, this license can only be used on VMs on multi tenant nodes.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.

### #name=

    def name=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.
**Returns**

- (::String) --- Output only. \[Output Only\] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer.

### #os_license

    def os_license() -> ::Boolean

**Returns**

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

### #os_license=

    def os_license=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true, indicates this is an OS license. Only one OS license can be attached to a disk or image at a time.
**Returns**

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

### #removable_from_disk

    def removable_from_disk() -> ::Boolean

**Returns**

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

### #removable_from_disk=

    def removable_from_disk=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true, this license can be removed from a disk's set of licenses, with no replacement license needed.
**Returns**

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

### #required_coattached_licenses

    def required_coattached_licenses() -> ::Array<::String>

**Returns**

- (::Array\<::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.

### #required_coattached_licenses=

    def required_coattached_licenses=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::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.
**Returns**

- (::Array\<::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.

### #self_link

    def self_link() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Server-defined URL for the resource.

### #self_link=

    def self_link=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Server-defined URL for the resource.
**Returns**

- (::String) --- Output only. \[Output Only\] Server-defined URL for the resource.

### #sole_tenant_only

    def sole_tenant_only() -> ::Boolean

**Returns**

- (::Boolean) --- If true, this license can only be used on VMs on sole tenant nodes.

### #sole_tenant_only=

    def sole_tenant_only=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true, this license can only be used on VMs on sole tenant nodes.
**Returns**

- (::Boolean) --- If true, this license can only be used on VMs on sole tenant nodes.

### #state

    def state() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Current state of this License Code. Check the State enum for the list of possible values.

### #state=

    def state=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Current state of this License Code. Check the State enum for the list of possible values.
**Returns**

- (::String) --- Output only. \[Output Only\] Current state of this License Code. Check the State enum for the list of possible values.

### #transferable

    def transferable() -> ::Boolean

**Returns**

- (::Boolean) --- Output only. \[Output Only\] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.

### #transferable=

    def transferable=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- Output only. \[Output Only\] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.
**Returns**

- (::Boolean) --- Output only. \[Output Only\] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.

### #update_timestamp

    def update_timestamp() -> ::String

**Returns**

- (::String) --- Output only. \[Output Only\] Last update timestamp inRFC3339 text format.

### #update_timestamp=

    def update_timestamp=(value) -> ::String

**Parameter**

- **value** (::String) --- Output only. \[Output Only\] Last update timestamp inRFC3339 text format.
**Returns**

- (::String) --- Output only. \[Output Only\] Last update timestamp inRFC3339 text format.