# Google Cloud Maintenance Api V1beta Client - Class ResourceMaintenance (0.4.0)

0.4.0 (latest) 0.3.2 0.2.1 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 Maintenance Api V1beta Client class ResourceMaintenance.

ResourceMaintenance is a resource that represents a maintenance operation
on a resource.

Generated from protobuf message `google.cloud.maintenance.api.v1beta.ResourceMaintenance`

## Namespace

Google \\ Cloud \\ Maintenance \\ Api \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. The name of the resource_maintenance resource. Format: `"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"` |
| `↳ resource` | `https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.Resource` Output only. The resource spec of the resource maintenance. |
| `↳ maintenance` | `https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.Maintenance` Output only. The details of the maintenance. |
| `↳ state` | `int` Output only. The state of the resource maintenance. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The create time of the resource maintenance. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The update time of the resource maintenance. |
| `↳ maintenance_start_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the resource maintenance has started. |
| `↳ maintenance_end_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the resource maintenance has completed. |
| `↳ maintenance_cancel_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the resource maintenance was cancelled. |
| `↳ maintenance_scheduled_start_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the maintenance on the resource was scheduled to start. |
| `↳ maintenance_scheduled_end_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time when the maintenance on the resource was scheduled to end. |
| `↳ user_controllable` | `bool` Output only. Indicates whether the user has some control over that maintenance, either proactively before maintenance was scheduled with maintenance policy or with reactive controls after it was scheduled (see controls field) |
| `↳ controls` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.MaintenanceControl>` Output only. The controls of the maintenance. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. The labels on the resource, which can be used for categorization. similar to Kubernetes resource labels. |
| `↳ annotations` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Annotations is an unstructured key-value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: <https://kubernetes.io/docs/user-guide/annotations> |
| `↳ uid` | `string` Output only. The unique identifier of the resource. UID is unique in the time and space for this resource within the scope of the service. It is typically generated by the server on successful creation of a resource and must not be changed. UID is used to uniquely identify resources with resource name reuses. This should be a UUID4. |
| `↳ etag` | `string` Output only. An opaque value that uniquely identifies a version or generation of a resource. It can be used to confirm that the client and server agree on the ordering of a resource being written. |

### getName

Identifier. The name of the resource_maintenance resource.

Format:
`"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`

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

### setName

Identifier. The name of the resource_maintenance resource.

Format:
`"projects/{project}/locations/{location}/resourceMaintenance/{resource-maintenance-id}"`

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

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

### getResource

Output only. The resource spec of the resource maintenance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.Resource|null` |   |

### hasResource

### clearResource

### setResource

Output only. The resource spec of the resource maintenance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.Resource` |

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

### getMaintenance

Output only. The details of the maintenance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.Maintenance|null` |   |

### hasMaintenance

### clearMaintenance

### setMaintenance

Output only. The details of the maintenance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.Maintenance` |

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

### getState

Output only. The state of the resource maintenance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.State). |

### setState

Output only. The state of the resource maintenance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.ResourceMaintenance.State). |

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

### getCreateTime

Output only. The create time of the resource maintenance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The create time of the resource maintenance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getUpdateTime

Output only. The update time of the resource maintenance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The update time of the resource maintenance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getMaintenanceStartTime

Output only. The time when the resource maintenance has started.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasMaintenanceStartTime

### clearMaintenanceStartTime

### setMaintenanceStartTime

Output only. The time when the resource maintenance has started.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getMaintenanceEndTime

Output only. The time when the resource maintenance has completed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasMaintenanceEndTime

### clearMaintenanceEndTime

### setMaintenanceEndTime

Output only. The time when the resource maintenance has completed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getMaintenanceCancelTime

Output only. The time when the resource maintenance was cancelled.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasMaintenanceCancelTime

### clearMaintenanceCancelTime

### setMaintenanceCancelTime

Output only. The time when the resource maintenance was cancelled.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getMaintenanceScheduledStartTime

Output only. The time when the maintenance on the resource was scheduled to
start.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasMaintenanceScheduledStartTime

### clearMaintenanceScheduledStartTime

### setMaintenanceScheduledStartTime

Output only. The time when the maintenance on the resource was scheduled to
start.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getMaintenanceScheduledEndTime

Output only. The time when the maintenance on the resource was scheduled to
end.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasMaintenanceScheduledEndTime

### clearMaintenanceScheduledEndTime

### setMaintenanceScheduledEndTime

Output only. The time when the maintenance on the resource was scheduled to
end.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getUserControllable

Output only. Indicates whether the user has some control over that
maintenance, either
proactively before maintenance was scheduled with maintenance policy or
with reactive controls after it was scheduled (see controls field)

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

### setUserControllable

Output only. Indicates whether the user has some control over that
maintenance, either
proactively before maintenance was scheduled with maintenance policy or
with reactive controls after it was scheduled (see controls field)

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

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

### getControls

Output only. The controls of the maintenance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.MaintenanceControl>` |   |

### setControls

Output only. The controls of the maintenance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-maintenance/latest/V1beta.MaintenanceControl>` |

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

### getLabels

Optional. The labels on the resource, which can be used for categorization.

similar to Kubernetes resource labels.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Optional. The labels on the resource, which can be used for categorization.

similar to Kubernetes resource labels.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getAnnotations

Optional. Annotations is an unstructured key-value map stored with a
resource that may be set by external tools to store and retrieve arbitrary
metadata. They are not queryable and should be preserved when modifying
objects.

More info: <https://kubernetes.io/docs/user-guide/annotations>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setAnnotations

Optional. Annotations is an unstructured key-value map stored with a
resource that may be set by external tools to store and retrieve arbitrary
metadata. They are not queryable and should be preserved when modifying
objects.

More info: <https://kubernetes.io/docs/user-guide/annotations>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getUid

Output only. The unique identifier of the resource. UID is unique in the
time and space for this resource within the scope of the service. It is
typically generated by the server on successful creation of a resource
and must not be changed. UID is used to uniquely identify resources
with resource name reuses. This should be a UUID4.

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

### setUid

Output only. The unique identifier of the resource. UID is unique in the
time and space for this resource within the scope of the service. It is
typically generated by the server on successful creation of a resource
and must not be changed. UID is used to uniquely identify resources
with resource name reuses. This should be a UUID4.

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

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

### getEtag

Output only. An opaque value that uniquely identifies a version or
generation of a resource. It can be used to confirm that the client
and server agree on the ordering of a resource being written.

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

### setEtag

Output only. An opaque value that uniquely identifies a version or
generation of a resource. It can be used to confirm that the client
and server agree on the ordering of a resource being written.

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

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