# Class Commitment.Builder (1.101.0)

1.103.0 (latest) 1.101.0 1.98.0 1.97.0 1.95.0 1.93.0 1.92.0 1.91.0 1.90.0 1.88.0 1.86.0 1.85.0 1.84.0 1.83.0 1.82.0 1.80.0 1.78.0 1.77.0 1.74.0 1.73.0 1.72.0 1.70.0 1.69.0 1.68.0 1.67.0 1.66.0 1.65.0 1.64.0 1.63.0 1.62.0 1.61.0 1.59.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.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.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.1 1.11.0 1.9.1 1.8.1 1.7.2 1.6.0-beta

    public static final class Commitment.Builder extends GeneratedMessage.Builder<Commitment.Builder> implements CommitmentOrBuilder

Represents a regional resource-based commitment resource.

Creating this commitment resource means that you are purchasing a
resource-based committed use contract, with an explicit start and end time.
You can purchase resource-based commitments for both hardware and software
resources. For more information, read
Resource-based committed use discounts

Protobuf type `google.cloud.compute.v1.Commitment`

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [AbstractMessageLite.Builder\<MessageType,BuilderType\>](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html) \> [AbstractMessage.Builder\<BuilderType\>](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html) \> [GeneratedMessage.Builder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html) \> Commitment.Builder

## Implements

[CommitmentOrBuilder](https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentOrBuilder)

## Inherited Members

[AbstractMessage.Builder.findInitializationErrors()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_findInitializationErrors__) [AbstractMessage.Builder.getInitializationErrorString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_getInitializationErrorString__) [AbstractMessage.Builder.internalMergeFrom(AbstractMessageLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_internalMergeFrom_com_google_protobuf_AbstractMessageLite_) [AbstractMessage.Builder.mergeFrom(byte\[\])](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___) [AbstractMessage.Builder.mergeFrom(byte\[\],ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(byte\[\],int,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___int_int_) [AbstractMessage.Builder.mergeFrom(byte\[\],int,int,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_byte___int_int_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(ByteString)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_ByteString_) [AbstractMessage.Builder.mergeFrom(ByteString,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_ByteString_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(CodedInputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_CodedInputStream_) [AbstractMessage.Builder.mergeFrom(CodedInputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.mergeFrom(Message)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_Message_) [AbstractMessage.Builder.mergeFrom(InputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_java_io_InputStream_) [AbstractMessage.Builder.mergeFrom(InputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_java_io_InputStream_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessage.Builder.newUninitializedMessageException(Message)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_newUninitializedMessageException_com_google_protobuf_Message_) [AbstractMessage.Builder.toString()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_toString__) [AbstractMessageLite.Builder.\<T\>addAll(Iterable\<T\>,Collection\<? super T\>)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder__T_addAll_java_lang_Iterable_T__java_util_Collection___super_T__) [AbstractMessageLite.Builder.\<T\>addAll(Iterable\<T\>,List\<? super T\>)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder__T_addAll_java_lang_Iterable_T__java_util_List___super_T__) [AbstractMessageLite.Builder.internalMergeFrom(MessageType)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_internalMergeFrom_MessageType_) [AbstractMessageLite.Builder.mergeDelimitedFrom(InputStream)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_mergeDelimitedFrom_java_io_InputStream_) [AbstractMessageLite.Builder.mergeDelimitedFrom(InputStream,ExtensionRegistryLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_mergeDelimitedFrom_java_io_InputStream_com_google_protobuf_ExtensionRegistryLite_) [AbstractMessageLite.Builder.mergeFrom(MessageLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_mergeFrom_com_google_protobuf_MessageLite_) [AbstractMessageLite.Builder.newUninitializedMessageException(MessageLite)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessageLite.Builder.html#com_google_protobuf_AbstractMessageLite_Builder_newUninitializedMessageException_com_google_protobuf_MessageLite_) [GeneratedMessage.Builder.addRepeatedField(Descriptors.FieldDescriptor,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_addRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_java_lang_Object_) [GeneratedMessage.Builder.clear()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clear__) [GeneratedMessage.Builder.clearField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clearField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.clearOneof(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clearOneof_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.Builder.clone()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clone__) [GeneratedMessage.Builder.getAllFields()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getAllFields__) [GeneratedMessage.Builder.getDescriptorForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getDescriptorForType__) [GeneratedMessage.Builder.getField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.getFieldBuilder(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getFieldBuilder_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.getOneofFieldDescriptor(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getOneofFieldDescriptor_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.Builder.getParentForChildren()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getParentForChildren__) [GeneratedMessage.Builder.getRepeatedField(Descriptors.FieldDescriptor,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_int_) [GeneratedMessage.Builder.getRepeatedFieldBuilder(Descriptors.FieldDescriptor,int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getRepeatedFieldBuilder_com_google_protobuf_Descriptors_FieldDescriptor_int_) [GeneratedMessage.Builder.getRepeatedFieldCount(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getRepeatedFieldCount_com_google_protobuf_Descriptors_FieldDescriptor_) com.google.protobuf.GeneratedMessage.Builder.getUnknownFieldSetBuilder() [GeneratedMessage.Builder.getUnknownFields()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getUnknownFields__) [GeneratedMessage.Builder.hasField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_hasField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.hasOneof(Descriptors.OneofDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_hasOneof_com_google_protobuf_Descriptors_OneofDescriptor_) [GeneratedMessage.Builder.internalGetFieldAccessorTable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetFieldAccessorTable__) [GeneratedMessage.Builder.internalGetMapField(int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetMapField_int_) com.google.protobuf.GeneratedMessage.Builder.internalGetMapFieldReflection(int) [GeneratedMessage.Builder.internalGetMutableMapField(int)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetMutableMapField_int_) com.google.protobuf.GeneratedMessage.Builder.internalGetMutableMapFieldReflection(int) [GeneratedMessage.Builder.isClean()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_isClean__) [GeneratedMessage.Builder.isInitialized()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_isInitialized__) [GeneratedMessage.Builder.markClean()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_markClean__) [GeneratedMessage.Builder.mergeUnknownFields(UnknownFieldSet)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_mergeUnknownFields_com_google_protobuf_UnknownFieldSet_) com.google.protobuf.GeneratedMessage.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString) com.google.protobuf.GeneratedMessage.Builder.mergeUnknownVarintField(int,int) [GeneratedMessage.Builder.newBuilderForField(Descriptors.FieldDescriptor)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_newBuilderForField_com_google_protobuf_Descriptors_FieldDescriptor_) [GeneratedMessage.Builder.onBuilt()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_onBuilt__) [GeneratedMessage.Builder.onChanged()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_onChanged__) com.google.protobuf.GeneratedMessage.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int) [GeneratedMessage.Builder.setField(Descriptors.FieldDescriptor,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_setField_com_google_protobuf_Descriptors_FieldDescriptor_java_lang_Object_) [GeneratedMessage.Builder.setRepeatedField(Descriptors.FieldDescriptor,int,Object)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_setRepeatedField_com_google_protobuf_Descriptors_FieldDescriptor_int_java_lang_Object_) com.google.protobuf.GeneratedMessage.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder) [GeneratedMessage.Builder.setUnknownFields(UnknownFieldSet)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_setUnknownFields_com_google_protobuf_UnknownFieldSet_) com.google.protobuf.GeneratedMessage.Builder.setUnknownFieldsProto3(com.google.protobuf.UnknownFieldSet) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### getDescriptor()

    public static final Descriptors.Descriptor getDescriptor()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.Descriptor.html` |   |

## Methods

### addAllExistingReservations(Iterable\<String\> values)

    public Commitment.Builder addAllExistingReservations(Iterable<String> values)

`repeated string existing_reservations = 493028443;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` The existingReservations to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### addAllMergeSourceCommitments(Iterable\<String\> values)

    public Commitment.Builder addAllMergeSourceCommitments(Iterable<String> values)

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` The mergeSourceCommitments to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### addAllReservations(Iterable\<? extends Reservation\> values)

    public Commitment.Builder addAllReservations(Iterable<? extends Reservation> values)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html<? extends com.google.cloud.compute.v1.Reservation>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addAllResources(Iterable\<? extends ResourceCommitment\> values)

    public Commitment.Builder addAllResources(Iterable<? extends ResourceCommitment> values)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `values` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html<? extends com.google.cloud.compute.v1.ResourceCommitment>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addExistingReservations(String value)

    public Commitment.Builder addExistingReservations(String value)

`repeated string existing_reservations = 493028443;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The existingReservations to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### addExistingReservationsBytes(ByteString value)

    public Commitment.Builder addExistingReservationsBytes(ByteString value)

`repeated string existing_reservations = 493028443;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes of the existingReservations to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### addMergeSourceCommitments(String value)

    public Commitment.Builder addMergeSourceCommitments(String value)

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The mergeSourceCommitments to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### addMergeSourceCommitmentsBytes(ByteString value)

    public Commitment.Builder addMergeSourceCommitmentsBytes(ByteString value)

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes of the mergeSourceCommitments to add. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### addReservations(Reservation value)

    public Commitment.Builder addReservations(Reservation value)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addReservations(Reservation.Builder builderForValue)

    public Commitment.Builder addReservations(Reservation.Builder builderForValue)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addReservations(int index, Reservation value)

    public Commitment.Builder addReservations(int index, Reservation value)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addReservations(int index, Reservation.Builder builderForValue)

    public Commitment.Builder addReservations(int index, Reservation.Builder builderForValue)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addReservationsBuilder()

    public Reservation.Builder addReservationsBuilder()

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder` |   |

### addReservationsBuilder(int index)

    public Reservation.Builder addReservationsBuilder(int index)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder` |   |

### addResources(ResourceCommitment value)

    public Commitment.Builder addResources(ResourceCommitment value)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addResources(ResourceCommitment.Builder builderForValue)

    public Commitment.Builder addResources(ResourceCommitment.Builder builderForValue)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addResources(int index, ResourceCommitment value)

    public Commitment.Builder addResources(int index, ResourceCommitment value)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addResources(int index, ResourceCommitment.Builder builderForValue)

    public Commitment.Builder addResources(int index, ResourceCommitment.Builder builderForValue)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### addResourcesBuilder()

    public ResourceCommitment.Builder addResourcesBuilder()

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder` |   |

### addResourcesBuilder(int index)

    public ResourceCommitment.Builder addResourcesBuilder(int index)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder` |   |

### build()

    public Commitment build()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment` |   |

### buildPartial()

    public Commitment buildPartial()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment` |   |

### clear()

    public Commitment.Builder clear()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.clear()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_clear__)

### clearAutoRenew()

    public Commitment.Builder clearAutoRenew()

Specifies whether to automatically renew the commitment at the end of its
current term. The default value is false. If you set the field
to true, each time your commitment reaches the end of its
term, Compute Engine automatically renews it for another term. You can
update this field anytime before the commitment expires. For example, if
the commitment is set to expire at 12 AM UTC-8 on January 3, 2027, you can
update this field until 11:59 PM UTC-8 on January 2, 2027.

`optional bool auto_renew = 495520765;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearCategory()

    public Commitment.Builder clearCategory()

The category of the commitment; specifies whether the commitment is for
hardware or software resources. Category MACHINE specifies
that you are committing to hardware machine resources such asVCPU or MEMORY, listed in resources.
Category LICENSE specifies that you are committing to software
licenses, listed in licenseResources.
Note that if you specify MACHINE commitments, then you must
also specify a type to indicate the machine series of the
hardware resource that you are committing to.
Check the Category enum for the list of possible values.

`optional string category = 50511102;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearCreationTimestamp()

    public Commitment.Builder clearCreationTimestamp()

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

`optional string creation_timestamp = 30525366;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearCustomEndTimestamp()

    public Commitment.Builder clearCustomEndTimestamp()

\[Input Only\] Optional, specifies the requested commitment end time inRFC3339 text format. Use this option when the desired
commitment's end date is later than the start date + term duration.

`optional string custom_end_timestamp = 181770852;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearDescription()

    public Commitment.Builder clearDescription()

An optional description of the commitment. You can provide this property
when you create the resource.

`optional string description = 422937596;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearEndTimestamp()

    public Commitment.Builder clearEndTimestamp()

Output only. \[Output Only\] Commitment end time inRFC3339
text format.

`optional string end_timestamp = 468096690;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearExistingReservations()

    public Commitment.Builder clearExistingReservations()

`repeated string existing_reservations = 493028443;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearId()

    public Commitment.Builder clearId()

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

`optional uint64 id = 3355;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearKind()

    public Commitment.Builder clearKind()

Output only. \[Output Only\] Type of the resource. Always compute#commitment
for commitments.

`optional string kind = 3292052;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearLicenseResource()

    public Commitment.Builder clearLicenseResource()

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### clearMergeSourceCommitments()

    public Commitment.Builder clearMergeSourceCommitments()

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearName()

    public Commitment.Builder clearName()

Name of the commitment. You must specify a name when you purchase the
commitment. The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/[-a-z0-9]*[a-z0-9]?` which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.

`optional string name = 3373707;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearPlan()

    public Commitment.Builder clearPlan()

The minimum time duration that you commit to purchasing resources.
The plan that you choose determines the preset term length of the
commitment (which is 1 year or 3 years) and affects the discount rate that
you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this
field are TWELVE_MONTH (1 year), andTHIRTY_SIX_MONTH (3 years).
Check the Plan enum for the list of possible values.

`optional string plan = 3443497;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearRegion()

    public Commitment.Builder clearRegion()

Output only. \[Output Only\] URL of the region where the commitment and committed
resources are located.

`optional string region = 138946292;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearReservations()

    public Commitment.Builder clearReservations()

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### clearResourceStatus()

    public Commitment.Builder clearResourceStatus()

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### clearResources()

    public Commitment.Builder clearResources()

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### clearSelfLink()

    public Commitment.Builder clearSelfLink()

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

`optional string self_link = 456214797;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearSplitSourceCommitment()

    public Commitment.Builder clearSplitSourceCommitment()

The source commitment from which you are transferring resources to create
the new split commitment. For more information, see
Split commitments.

`optional string split_source_commitment = 402611156;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearStartTimestamp()

    public Commitment.Builder clearStartTimestamp()

Output only. \[Output Only\] Commitment start time inRFC3339
text format.

`optional string start_timestamp = 83645817;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearStatus()

    public Commitment.Builder clearStatus()

Output only. \[Output Only\] Status of the commitment with regards to eventual expiration
(each commitment has an end date defined). Status can be one of the
following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
Check the Status enum for the list of possible values.

`optional string status = 181260274;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearStatusMessage()

    public Commitment.Builder clearStatusMessage()

Output only. \[Output Only\] An optional, human-readable explanation of the status.

`optional string status_message = 297428154;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### clearType()

    public Commitment.Builder clearType()

The type of commitment; specifies the
machine series for which you want to commit to purchasing resources.
The choice of machine series affects the discount rate and the eligible
resource types.

The type must be one of the following:ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For
example, type MEMORY_OPTIMIZED specifies a commitment that
applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that
applies only to eligible resources of general purpose N1 machine series.
Check the Type enum for the list of possible values.

`optional string type = 3575610;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### getAutoRenew()

    public boolean getAutoRenew()

Specifies whether to automatically renew the commitment at the end of its
current term. The default value is false. If you set the field
to true, each time your commitment reaches the end of its
term, Compute Engine automatically renews it for another term. You can
update this field anytime before the commitment expires. For example, if
the commitment is set to expire at 12 AM UTC-8 on January 3, 2027, you can
update this field until 11:59 PM UTC-8 on January 2, 2027.

`optional bool auto_renew = 495520765;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The autoRenew. |

### getCategory()

    public String getCategory()

The category of the commitment; specifies whether the commitment is for
hardware or software resources. Category MACHINE specifies
that you are committing to hardware machine resources such asVCPU or MEMORY, listed in resources.
Category LICENSE specifies that you are committing to software
licenses, listed in licenseResources.
Note that if you specify MACHINE commitments, then you must
also specify a type to indicate the machine series of the
hardware resource that you are committing to.
Check the Category enum for the list of possible values.

`optional string category = 50511102;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The category. |

### getCategoryBytes()

    public ByteString getCategoryBytes()

The category of the commitment; specifies whether the commitment is for
hardware or software resources. Category MACHINE specifies
that you are committing to hardware machine resources such asVCPU or MEMORY, listed in resources.
Category LICENSE specifies that you are committing to software
licenses, listed in licenseResources.
Note that if you specify MACHINE commitments, then you must
also specify a type to indicate the machine series of the
hardware resource that you are committing to.
Check the Category enum for the list of possible values.

`optional string category = 50511102;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for category. |

### getCreationTimestamp()

    public String getCreationTimestamp()

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

`optional string creation_timestamp = 30525366;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The creationTimestamp. |

### getCreationTimestampBytes()

    public ByteString getCreationTimestampBytes()

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

`optional string creation_timestamp = 30525366;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for creationTimestamp. |

### getCustomEndTimestamp()

    public String getCustomEndTimestamp()

\[Input Only\] Optional, specifies the requested commitment end time inRFC3339 text format. Use this option when the desired
commitment's end date is later than the start date + term duration.

`optional string custom_end_timestamp = 181770852;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The customEndTimestamp. |

### getCustomEndTimestampBytes()

    public ByteString getCustomEndTimestampBytes()

\[Input Only\] Optional, specifies the requested commitment end time inRFC3339 text format. Use this option when the desired
commitment's end date is later than the start date + term duration.

`optional string custom_end_timestamp = 181770852;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for customEndTimestamp. |

### getDefaultInstanceForType()

    public Commitment getDefaultInstanceForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment` |   |

### getDescription()

    public String getDescription()

An optional description of the commitment. You can provide this property
when you create the resource.

`optional string description = 422937596;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The description. |

### getDescriptionBytes()

    public ByteString getDescriptionBytes()

An optional description of the commitment. You can provide this property
when you create the resource.

`optional string description = 422937596;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for description. |

### getDescriptorForType()

    public Descriptors.Descriptor getDescriptorForType()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Descriptors.Descriptor.html` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.getDescriptorForType()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_getDescriptorForType__)

### getEndTimestamp()

    public String getEndTimestamp()

Output only. \[Output Only\] Commitment end time inRFC3339
text format.

`optional string end_timestamp = 468096690;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The endTimestamp. |

### getEndTimestampBytes()

    public ByteString getEndTimestampBytes()

Output only. \[Output Only\] Commitment end time inRFC3339
text format.

`optional string end_timestamp = 468096690;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for endTimestamp. |

### getExistingReservations(int index)

    public String getExistingReservations(int index)

`repeated string existing_reservations = 493028443;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The existingReservations at the given index. |

### getExistingReservationsBytes(int index)

    public ByteString getExistingReservationsBytes(int index)

`repeated string existing_reservations = 493028443;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the existingReservations at the given index. |

### getExistingReservationsCount()

    public int getExistingReservationsCount()

`repeated string existing_reservations = 493028443;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of existingReservations. |

### getExistingReservationsList()

    public ProtocolStringList getExistingReservationsList()

`repeated string existing_reservations = 493028443;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ProtocolStringList.html` | A list containing the existingReservations. |

### getId()

    public long getId()

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

`optional uint64 id = 3355;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The id. |

### getKind()

    public String getKind()

Output only. \[Output Only\] Type of the resource. Always compute#commitment
for commitments.

`optional string kind = 3292052;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The kind. |

### getKindBytes()

    public ByteString getKindBytes()

Output only. \[Output Only\] Type of the resource. Always compute#commitment
for commitments.

`optional string kind = 3292052;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for kind. |

### getLicenseResource()

    public LicenseResourceCommitment getLicenseResource()

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.LicenseResourceCommitment` | The licenseResource. |

### getLicenseResourceBuilder()

    public LicenseResourceCommitment.Builder getLicenseResourceBuilder()

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.LicenseResourceCommitment.Builder` |   |

### getLicenseResourceOrBuilder()

    public LicenseResourceCommitmentOrBuilder getLicenseResourceOrBuilder()

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.LicenseResourceCommitmentOrBuilder` |   |

### getMergeSourceCommitments(int index)

    public String getMergeSourceCommitments(int index)

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The mergeSourceCommitments at the given index. |

### getMergeSourceCommitmentsBytes(int index)

    public ByteString getMergeSourceCommitmentsBytes(int index)

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the mergeSourceCommitments at the given index. |

### getMergeSourceCommitmentsCount()

    public int getMergeSourceCommitmentsCount()

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of mergeSourceCommitments. |

### getMergeSourceCommitmentsList()

    public ProtocolStringList getMergeSourceCommitmentsList()

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ProtocolStringList.html` | A list containing the mergeSourceCommitments. |

### getName()

    public String getName()

Name of the commitment. You must specify a name when you purchase the
commitment. The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/[-a-z0-9]*[a-z0-9]?` which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.

`optional string name = 3373707;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public ByteString getNameBytes()

Name of the commitment. You must specify a name when you purchase the
commitment. The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/[-a-z0-9]*[a-z0-9]?` which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.

`optional string name = 3373707;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getPlan()

    public String getPlan()

The minimum time duration that you commit to purchasing resources.
The plan that you choose determines the preset term length of the
commitment (which is 1 year or 3 years) and affects the discount rate that
you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this
field are TWELVE_MONTH (1 year), andTHIRTY_SIX_MONTH (3 years).
Check the Plan enum for the list of possible values.

`optional string plan = 3443497;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The plan. |

### getPlanBytes()

    public ByteString getPlanBytes()

The minimum time duration that you commit to purchasing resources.
The plan that you choose determines the preset term length of the
commitment (which is 1 year or 3 years) and affects the discount rate that
you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this
field are TWELVE_MONTH (1 year), andTHIRTY_SIX_MONTH (3 years).
Check the Plan enum for the list of possible values.

`optional string plan = 3443497;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for plan. |

### getRegion()

    public String getRegion()

Output only. \[Output Only\] URL of the region where the commitment and committed
resources are located.

`optional string region = 138946292;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The region. |

### getRegionBytes()

    public ByteString getRegionBytes()

Output only. \[Output Only\] URL of the region where the commitment and committed
resources are located.

`optional string region = 138946292;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for region. |

### getReservations(int index)

    public Reservation getReservations(int index)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation` |   |

### getReservationsBuilder(int index)

    public Reservation.Builder getReservationsBuilder(int index)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder` |   |

### getReservationsBuilderList()

    public List<Reservation.Builder> getReservationsBuilderList()

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder>` |   |

### getReservationsCount()

    public int getReservationsCount()

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getReservationsList()

    public List<Reservation> getReservationsList()

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation>` |   |

### getReservationsOrBuilder(int index)

    public ReservationOrBuilder getReservationsOrBuilder(int index)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ReservationOrBuilder` |   |

### getReservationsOrBuilderList()

    public List<? extends ReservationOrBuilder> getReservationsOrBuilderList()

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.compute.v1.ReservationOrBuilder>` |   |

### getResourceStatus()

    public CommitmentResourceStatus getResourceStatus()

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentResourceStatus` | The resourceStatus. |

### getResourceStatusBuilder()

    public CommitmentResourceStatus.Builder getResourceStatusBuilder()

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentResourceStatus.Builder` |   |

### getResourceStatusOrBuilder()

    public CommitmentResourceStatusOrBuilder getResourceStatusOrBuilder()

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentResourceStatusOrBuilder` |   |

### getResources(int index)

    public ResourceCommitment getResources(int index)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment` |   |

### getResourcesBuilder(int index)

    public ResourceCommitment.Builder getResourcesBuilder(int index)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder` |   |

### getResourcesBuilderList()

    public List<ResourceCommitment.Builder> getResourcesBuilderList()

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder>` |   |

### getResourcesCount()

    public int getResourcesCount()

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getResourcesList()

    public List<ResourceCommitment> getResourcesList()

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment>` |   |

### getResourcesOrBuilder(int index)

    public ResourceCommitmentOrBuilder getResourcesOrBuilder(int index)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitmentOrBuilder` |   |

### getResourcesOrBuilderList()

    public List<? extends ResourceCommitmentOrBuilder> getResourcesOrBuilderList()

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.compute.v1.ResourceCommitmentOrBuilder>` |   |

### getSelfLink()

    public String getSelfLink()

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

`optional string self_link = 456214797;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The selfLink. |

### getSelfLinkBytes()

    public ByteString getSelfLinkBytes()

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

`optional string self_link = 456214797;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for selfLink. |

### getSplitSourceCommitment()

    public String getSplitSourceCommitment()

The source commitment from which you are transferring resources to create
the new split commitment. For more information, see
Split commitments.

`optional string split_source_commitment = 402611156;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The splitSourceCommitment. |

### getSplitSourceCommitmentBytes()

    public ByteString getSplitSourceCommitmentBytes()

The source commitment from which you are transferring resources to create
the new split commitment. For more information, see
Split commitments.

`optional string split_source_commitment = 402611156;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for splitSourceCommitment. |

### getStartTimestamp()

    public String getStartTimestamp()

Output only. \[Output Only\] Commitment start time inRFC3339
text format.

`optional string start_timestamp = 83645817;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The startTimestamp. |

### getStartTimestampBytes()

    public ByteString getStartTimestampBytes()

Output only. \[Output Only\] Commitment start time inRFC3339
text format.

`optional string start_timestamp = 83645817;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for startTimestamp. |

### getStatus()

    public String getStatus()

Output only. \[Output Only\] Status of the commitment with regards to eventual expiration
(each commitment has an end date defined). Status can be one of the
following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
Check the Status enum for the list of possible values.

`optional string status = 181260274;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The status. |

### getStatusBytes()

    public ByteString getStatusBytes()

Output only. \[Output Only\] Status of the commitment with regards to eventual expiration
(each commitment has an end date defined). Status can be one of the
following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
Check the Status enum for the list of possible values.

`optional string status = 181260274;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for status. |

### getStatusMessage()

    public String getStatusMessage()

Output only. \[Output Only\] An optional, human-readable explanation of the status.

`optional string status_message = 297428154;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The statusMessage. |

### getStatusMessageBytes()

    public ByteString getStatusMessageBytes()

Output only. \[Output Only\] An optional, human-readable explanation of the status.

`optional string status_message = 297428154;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for statusMessage. |

### getType()

    public String getType()

The type of commitment; specifies the
machine series for which you want to commit to purchasing resources.
The choice of machine series affects the discount rate and the eligible
resource types.

The type must be one of the following:ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For
example, type MEMORY_OPTIMIZED specifies a commitment that
applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that
applies only to eligible resources of general purpose N1 machine series.
Check the Type enum for the list of possible values.

`optional string type = 3575610;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The type. |

### getTypeBytes()

    public ByteString getTypeBytes()

The type of commitment; specifies the
machine series for which you want to commit to purchasing resources.
The choice of machine series affects the discount rate and the eligible
resource types.

The type must be one of the following:ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For
example, type MEMORY_OPTIMIZED specifies a commitment that
applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that
applies only to eligible resources of general purpose N1 machine series.
Check the Type enum for the list of possible values.

`optional string type = 3575610;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for type. |

### hasAutoRenew()

    public boolean hasAutoRenew()

Specifies whether to automatically renew the commitment at the end of its
current term. The default value is false. If you set the field
to true, each time your commitment reaches the end of its
term, Compute Engine automatically renews it for another term. You can
update this field anytime before the commitment expires. For example, if
the commitment is set to expire at 12 AM UTC-8 on January 3, 2027, you can
update this field until 11:59 PM UTC-8 on January 2, 2027.

`optional bool auto_renew = 495520765;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the autoRenew field is set. |

### hasCategory()

    public boolean hasCategory()

The category of the commitment; specifies whether the commitment is for
hardware or software resources. Category MACHINE specifies
that you are committing to hardware machine resources such asVCPU or MEMORY, listed in resources.
Category LICENSE specifies that you are committing to software
licenses, listed in licenseResources.
Note that if you specify MACHINE commitments, then you must
also specify a type to indicate the machine series of the
hardware resource that you are committing to.
Check the Category enum for the list of possible values.

`optional string category = 50511102;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the category field is set. |

### hasCreationTimestamp()

    public boolean hasCreationTimestamp()

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

`optional string creation_timestamp = 30525366;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the creationTimestamp field is set. |

### hasCustomEndTimestamp()

    public boolean hasCustomEndTimestamp()

\[Input Only\] Optional, specifies the requested commitment end time inRFC3339 text format. Use this option when the desired
commitment's end date is later than the start date + term duration.

`optional string custom_end_timestamp = 181770852;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the customEndTimestamp field is set. |

### hasDescription()

    public boolean hasDescription()

An optional description of the commitment. You can provide this property
when you create the resource.

`optional string description = 422937596;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the description field is set. |

### hasEndTimestamp()

    public boolean hasEndTimestamp()

Output only. \[Output Only\] Commitment end time inRFC3339
text format.

`optional string end_timestamp = 468096690;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the endTimestamp field is set. |

### hasId()

    public boolean hasId()

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

`optional uint64 id = 3355;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the id field is set. |

### hasKind()

    public boolean hasKind()

Output only. \[Output Only\] Type of the resource. Always compute#commitment
for commitments.

`optional string kind = 3292052;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the kind field is set. |

### hasLicenseResource()

    public boolean hasLicenseResource()

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the licenseResource field is set. |

### hasName()

    public boolean hasName()

Name of the commitment. You must specify a name when you purchase the
commitment. The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/[-a-z0-9]*[a-z0-9]?` which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.

`optional string name = 3373707;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the name field is set. |

### hasPlan()

    public boolean hasPlan()

The minimum time duration that you commit to purchasing resources.
The plan that you choose determines the preset term length of the
commitment (which is 1 year or 3 years) and affects the discount rate that
you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this
field are TWELVE_MONTH (1 year), andTHIRTY_SIX_MONTH (3 years).
Check the Plan enum for the list of possible values.

`optional string plan = 3443497;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the plan field is set. |

### hasRegion()

    public boolean hasRegion()

Output only. \[Output Only\] URL of the region where the commitment and committed
resources are located.

`optional string region = 138946292;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the region field is set. |

### hasResourceStatus()

    public boolean hasResourceStatus()

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the resourceStatus field is set. |

### hasSelfLink()

    public boolean hasSelfLink()

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

`optional string self_link = 456214797;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the selfLink field is set. |

### hasSplitSourceCommitment()

    public boolean hasSplitSourceCommitment()

The source commitment from which you are transferring resources to create
the new split commitment. For more information, see
Split commitments.

`optional string split_source_commitment = 402611156;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the splitSourceCommitment field is set. |

### hasStartTimestamp()

    public boolean hasStartTimestamp()

Output only. \[Output Only\] Commitment start time inRFC3339
text format.

`optional string start_timestamp = 83645817;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the startTimestamp field is set. |

### hasStatus()

    public boolean hasStatus()

Output only. \[Output Only\] Status of the commitment with regards to eventual expiration
(each commitment has an end date defined). Status can be one of the
following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
Check the Status enum for the list of possible values.

`optional string status = 181260274;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the status field is set. |

### hasStatusMessage()

    public boolean hasStatusMessage()

Output only. \[Output Only\] An optional, human-readable explanation of the status.

`optional string status_message = 297428154;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the statusMessage field is set. |

### hasType()

    public boolean hasType()

The type of commitment; specifies the
machine series for which you want to commit to purchasing resources.
The choice of machine series affects the discount rate and the eligible
resource types.

The type must be one of the following:ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For
example, type MEMORY_OPTIMIZED specifies a commitment that
applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that
applies only to eligible resources of general purpose N1 machine series.
Check the Type enum for the list of possible values.

`optional string type = 3575610;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the type field is set. |

### internalGetFieldAccessorTable()

    protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.FieldAccessorTable.html` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.internalGetFieldAccessorTable()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_internalGetFieldAccessorTable__)

### isInitialized()

    public final boolean isInitialized()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [GeneratedMessage.Builder\<BuilderType\>.isInitialized()](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.GeneratedMessage.Builder.html#com_google_protobuf_GeneratedMessage_Builder_isInitialized__)

### mergeFrom(Commitment other)

    public Commitment.Builder mergeFrom(Commitment other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

    public Commitment.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `input` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.CodedInputStream.html` |
| `extensionRegistry` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ExtensionRegistryLite.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

**Overrides** [AbstractMessage.Builder\<BuilderType\>.mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_CodedInputStream_com_google_protobuf_ExtensionRegistryLite_)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### mergeFrom(Message other)

    public Commitment.Builder mergeFrom(Message other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Message.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

**Overrides** [AbstractMessage.Builder\<BuilderType\>.mergeFrom(Message other)](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.AbstractMessage.Builder.html#com_google_protobuf_AbstractMessage_Builder_mergeFrom_com_google_protobuf_Message_)

### mergeLicenseResource(LicenseResourceCommitment value)

    public Commitment.Builder mergeLicenseResource(LicenseResourceCommitment value)

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.LicenseResourceCommitment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### mergeResourceStatus(CommitmentResourceStatus value)

    public Commitment.Builder mergeResourceStatus(CommitmentResourceStatus value)

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentResourceStatus` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### removeReservations(int index)

    public Commitment.Builder removeReservations(int index)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### removeResources(int index)

    public Commitment.Builder removeResources(int index)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setAutoRenew(boolean value)

    public Commitment.Builder setAutoRenew(boolean value)

Specifies whether to automatically renew the commitment at the end of its
current term. The default value is false. If you set the field
to true, each time your commitment reaches the end of its
term, Compute Engine automatically renews it for another term. You can
update this field anytime before the commitment expires. For example, if
the commitment is set to expire at 12 AM UTC-8 on January 3, 2027, you can
update this field until 11:59 PM UTC-8 on January 2, 2027.

`optional bool auto_renew = 495520765;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The autoRenew to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setCategory(String value)

    public Commitment.Builder setCategory(String value)

The category of the commitment; specifies whether the commitment is for
hardware or software resources. Category MACHINE specifies
that you are committing to hardware machine resources such asVCPU or MEMORY, listed in resources.
Category LICENSE specifies that you are committing to software
licenses, listed in licenseResources.
Note that if you specify MACHINE commitments, then you must
also specify a type to indicate the machine series of the
hardware resource that you are committing to.
Check the Category enum for the list of possible values.

`optional string category = 50511102;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The category to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setCategoryBytes(ByteString value)

    public Commitment.Builder setCategoryBytes(ByteString value)

The category of the commitment; specifies whether the commitment is for
hardware or software resources. Category MACHINE specifies
that you are committing to hardware machine resources such asVCPU or MEMORY, listed in resources.
Category LICENSE specifies that you are committing to software
licenses, listed in licenseResources.
Note that if you specify MACHINE commitments, then you must
also specify a type to indicate the machine series of the
hardware resource that you are committing to.
Check the Category enum for the list of possible values.

`optional string category = 50511102;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for category to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setCreationTimestamp(String value)

    public Commitment.Builder setCreationTimestamp(String value)

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

`optional string creation_timestamp = 30525366;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The creationTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setCreationTimestampBytes(ByteString value)

    public Commitment.Builder setCreationTimestampBytes(ByteString value)

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

`optional string creation_timestamp = 30525366;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for creationTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setCustomEndTimestamp(String value)

    public Commitment.Builder setCustomEndTimestamp(String value)

\[Input Only\] Optional, specifies the requested commitment end time inRFC3339 text format. Use this option when the desired
commitment's end date is later than the start date + term duration.

`optional string custom_end_timestamp = 181770852;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The customEndTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setCustomEndTimestampBytes(ByteString value)

    public Commitment.Builder setCustomEndTimestampBytes(ByteString value)

\[Input Only\] Optional, specifies the requested commitment end time inRFC3339 text format. Use this option when the desired
commitment's end date is later than the start date + term duration.

`optional string custom_end_timestamp = 181770852;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for customEndTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setDescription(String value)

    public Commitment.Builder setDescription(String value)

An optional description of the commitment. You can provide this property
when you create the resource.

`optional string description = 422937596;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The description to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setDescriptionBytes(ByteString value)

    public Commitment.Builder setDescriptionBytes(ByteString value)

An optional description of the commitment. You can provide this property
when you create the resource.

`optional string description = 422937596;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for description to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setEndTimestamp(String value)

    public Commitment.Builder setEndTimestamp(String value)

Output only. \[Output Only\] Commitment end time inRFC3339
text format.

`optional string end_timestamp = 468096690;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The endTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setEndTimestampBytes(ByteString value)

    public Commitment.Builder setEndTimestampBytes(ByteString value)

Output only. \[Output Only\] Commitment end time inRFC3339
text format.

`optional string end_timestamp = 468096690;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for endTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setExistingReservations(int index, String value)

    public Commitment.Builder setExistingReservations(int index, String value)

`repeated string existing_reservations = 493028443;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index to set the value at. |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The existingReservations to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setId(long value)

    public Commitment.Builder setId(long value)

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

`optional uint64 id = 3355;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The id to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setKind(String value)

    public Commitment.Builder setKind(String value)

Output only. \[Output Only\] Type of the resource. Always compute#commitment
for commitments.

`optional string kind = 3292052;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The kind to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setKindBytes(ByteString value)

    public Commitment.Builder setKindBytes(ByteString value)

Output only. \[Output Only\] Type of the resource. Always compute#commitment
for commitments.

`optional string kind = 3292052;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for kind to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setLicenseResource(LicenseResourceCommitment value)

    public Commitment.Builder setLicenseResource(LicenseResourceCommitment value)

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.LicenseResourceCommitment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setLicenseResource(LicenseResourceCommitment.Builder builderForValue)

    public Commitment.Builder setLicenseResource(LicenseResourceCommitment.Builder builderForValue)

The license specification required as part of a license commitment.

`
optional .google.cloud.compute.v1.LicenseResourceCommitment license_resource = 437955148;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.LicenseResourceCommitment.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setMergeSourceCommitments(int index, String value)

    public Commitment.Builder setMergeSourceCommitments(int index, String value)

The list of source commitments that you are merging to create the new
merged commitment. For more information, see
Merging commitments.

`repeated string merge_source_commitments = 188093761;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index to set the value at. |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The mergeSourceCommitments to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setName(String value)

    public Commitment.Builder setName(String value)

Name of the commitment. You must specify a name when you purchase the
commitment. The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/[-a-z0-9]*[a-z0-9]?` which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.

`optional string name = 3373707;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The name to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setNameBytes(ByteString value)

    public Commitment.Builder setNameBytes(ByteString value)

Name of the commitment. You must specify a name when you purchase the
commitment. The name must be 1-63 characters long, and comply withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/[-a-z0-9]*[a-z0-9]?` which means the first
character must be a lowercase letter, and all following characters must
be a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.

`optional string name = 3373707;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for name to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setPlan(String value)

    public Commitment.Builder setPlan(String value)

The minimum time duration that you commit to purchasing resources.
The plan that you choose determines the preset term length of the
commitment (which is 1 year or 3 years) and affects the discount rate that
you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this
field are TWELVE_MONTH (1 year), andTHIRTY_SIX_MONTH (3 years).
Check the Plan enum for the list of possible values.

`optional string plan = 3443497;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The plan to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setPlanBytes(ByteString value)

    public Commitment.Builder setPlanBytes(ByteString value)

The minimum time duration that you commit to purchasing resources.
The plan that you choose determines the preset term length of the
commitment (which is 1 year or 3 years) and affects the discount rate that
you receive for your resources. Committing to a longer time duration
typically gives you a higher discount rate. The supported values for this
field are TWELVE_MONTH (1 year), andTHIRTY_SIX_MONTH (3 years).
Check the Plan enum for the list of possible values.

`optional string plan = 3443497;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for plan to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setRegion(String value)

    public Commitment.Builder setRegion(String value)

Output only. \[Output Only\] URL of the region where the commitment and committed
resources are located.

`optional string region = 138946292;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The region to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setRegionBytes(ByteString value)

    public Commitment.Builder setRegionBytes(ByteString value)

Output only. \[Output Only\] URL of the region where the commitment and committed
resources are located.

`optional string region = 138946292;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for region to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setReservations(int index, Reservation value)

    public Commitment.Builder setReservations(int index, Reservation value)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setReservations(int index, Reservation.Builder builderForValue)

    public Commitment.Builder setReservations(int index, Reservation.Builder builderForValue)

The list of new reservations that you want to create and attach to this
commitment.

You must attach reservations to your commitment if your commitment
specifies any GPUs or Local SSD disks. For more information, see
Attach reservations to resource-based commitments.

Specify this property only if you want to create new
reservations to attach. To attach existing reservations, specify theexistingReservations property instead.

`repeated .google.cloud.compute.v1.Reservation reservations = 399717927;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Reservation.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setResourceStatus(CommitmentResourceStatus value)

    public Commitment.Builder setResourceStatus(CommitmentResourceStatus value)

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentResourceStatus` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setResourceStatus(CommitmentResourceStatus.Builder builderForValue)

    public Commitment.Builder setResourceStatus(CommitmentResourceStatus.Builder builderForValue)

Output only. \[Output Only\] Status information for Commitment resource.

`optional .google.cloud.compute.v1.CommitmentResourceStatus resource_status = 249429315;
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.CommitmentResourceStatus.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setResources(int index, ResourceCommitment value)

    public Commitment.Builder setResources(int index, ResourceCommitment value)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `value` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setResources(int index, ResourceCommitment.Builder builderForValue)

    public Commitment.Builder setResources(int index, ResourceCommitment.Builder builderForValue)

The list of all the hardware resources, with their types and amounts, that
you want to commit to. Specify as a separate entry in the list for each
individual resource type.

`repeated .google.cloud.compute.v1.ResourceCommitment resources = 164412965;`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `builderForValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.ResourceCommitment.Builder` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` |   |

### setSelfLink(String value)

    public Commitment.Builder setSelfLink(String value)

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

`optional string self_link = 456214797;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The selfLink to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setSelfLinkBytes(ByteString value)

    public Commitment.Builder setSelfLinkBytes(ByteString value)

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

`optional string self_link = 456214797;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for selfLink to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setSplitSourceCommitment(String value)

    public Commitment.Builder setSplitSourceCommitment(String value)

The source commitment from which you are transferring resources to create
the new split commitment. For more information, see
Split commitments.

`optional string split_source_commitment = 402611156;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The splitSourceCommitment to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setSplitSourceCommitmentBytes(ByteString value)

    public Commitment.Builder setSplitSourceCommitmentBytes(ByteString value)

The source commitment from which you are transferring resources to create
the new split commitment. For more information, see
Split commitments.

`optional string split_source_commitment = 402611156;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for splitSourceCommitment to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setStartTimestamp(String value)

    public Commitment.Builder setStartTimestamp(String value)

Output only. \[Output Only\] Commitment start time inRFC3339
text format.

`optional string start_timestamp = 83645817;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The startTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setStartTimestampBytes(ByteString value)

    public Commitment.Builder setStartTimestampBytes(ByteString value)

Output only. \[Output Only\] Commitment start time inRFC3339
text format.

`optional string start_timestamp = 83645817;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for startTimestamp to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setStatus(String value)

    public Commitment.Builder setStatus(String value)

Output only. \[Output Only\] Status of the commitment with regards to eventual expiration
(each commitment has an end date defined). Status can be one of the
following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
Check the Status enum for the list of possible values.

`optional string status = 181260274;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The status to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setStatusBytes(ByteString value)

    public Commitment.Builder setStatusBytes(ByteString value)

Output only. \[Output Only\] Status of the commitment with regards to eventual expiration
(each commitment has an end date defined). Status can be one of the
following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
Check the Status enum for the list of possible values.

`optional string status = 181260274;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for status to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setStatusMessage(String value)

    public Commitment.Builder setStatusMessage(String value)

Output only. \[Output Only\] An optional, human-readable explanation of the status.

`optional string status_message = 297428154;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The statusMessage to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setStatusMessageBytes(ByteString value)

    public Commitment.Builder setStatusMessageBytes(ByteString value)

Output only. \[Output Only\] An optional, human-readable explanation of the status.

`optional string status_message = 297428154;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for statusMessage to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setType(String value)

    public Commitment.Builder setType(String value)

The type of commitment; specifies the
machine series for which you want to commit to purchasing resources.
The choice of machine series affects the discount rate and the eligible
resource types.

The type must be one of the following:ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For
example, type MEMORY_OPTIMIZED specifies a commitment that
applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that
applies only to eligible resources of general purpose N1 machine series.
Check the Type enum for the list of possible values.

`optional string type = 3575610;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The type to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |

### setTypeBytes(ByteString value)

    public Commitment.Builder setTypeBytes(ByteString value)

The type of commitment; specifies the
machine series for which you want to commit to purchasing resources.
The choice of machine series affects the discount rate and the eligible
resource types.

The type must be one of the following:ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For
example, type MEMORY_OPTIMIZED specifies a commitment that
applies only to eligible resources of memory optimized M1 and M2 machine
series. Type GENERAL_PURPOSE specifies a commitment that
applies only to eligible resources of general purpose N1 machine series.
Check the Type enum for the list of possible values.

`optional string type = 3575610;`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `value` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` The bytes for type to set. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-compute/latest/com.google.cloud.compute.v1.Commitment.Builder` | This builder for chaining. |