# Interface BuildOptionsOrBuilder (0.16.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [0.16.0 (latest)](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.BuildOptionsOrBuilder)
- [0.15.0](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.15.0/com.google.events.cloud.cloudbuild.v1.BuildOptionsOrBuilder)
- [0.14.1](https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/0.14.1/com.google.events.cloud.cloudbuild.v1.BuildOptionsOrBuilder)

    public interface BuildOptionsOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getDiskSizeGb()

    public abstract long getDiskSizeGb()

Requested disk size for the VM that runs the build. Note that this is *NOT*
"disk free"; some of the space will be used by the operating system and
build utilities. Also note that this is the minimum disk size that will be
allocated for the build -- the build may run with a larger disk than
requested. At present, the maximum disk size is 1000GB; builds that request
more than the maximum are rejected with an error.

`int64 disk_size_gb = 6;`

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

### getEnv(int index)

    public abstract String getEnv(int index)

A list of global environment variable definitions that will exist for all
build steps in this build. If a variable is defined in both globally and in
a build step, the variable will use the build step value.
The elements are of the form "KEY=VALUE" for the environment variable "KEY"
being given the value "VALUE".

`repeated string env = 12;`

| **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 env at the given index. |

### getEnvBytes(int index)

    public abstract ByteString getEnvBytes(int index)

A list of global environment variable definitions that will exist for all
build steps in this build. If a variable is defined in both globally and in
a build step, the variable will use the build step value.
The elements are of the form "KEY=VALUE" for the environment variable "KEY"
being given the value "VALUE".

`repeated string env = 12;`

| **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 env at the given index. |

### getEnvCount()

    public abstract int getEnvCount()

A list of global environment variable definitions that will exist for all
build steps in this build. If a variable is defined in both globally and in
a build step, the variable will use the build step value.
The elements are of the form "KEY=VALUE" for the environment variable "KEY"
being given the value "VALUE".

`repeated string env = 12;`

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

### getEnvList()

    public abstract List<String> getEnvList()

A list of global environment variable definitions that will exist for all
build steps in this build. If a variable is defined in both globally and in
a build step, the variable will use the build step value.
The elements are of the form "KEY=VALUE" for the environment variable "KEY"
being given the value "VALUE".

`repeated string env = 12;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the env. |

### getLogStreamingOption()

    public abstract BuildOptions.LogStreamingOption getLogStreamingOption()

Option to define build log streaming behavior to Google Cloud
Storage.

`
.google.events.cloud.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.BuildOptions.LogStreamingOption` | The logStreamingOption. |

### getLogStreamingOptionValue()

    public abstract int getLogStreamingOptionValue()

Option to define build log streaming behavior to Google Cloud
Storage.

`
.google.events.cloud.cloudbuild.v1.BuildOptions.LogStreamingOption log_streaming_option = 5;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for logStreamingOption. |

### getLogging()

    public abstract BuildOptions.LoggingMode getLogging()

Option to specify the logging mode, which determines where the logs are
stored.

`.google.events.cloud.cloudbuild.v1.BuildOptions.LoggingMode logging = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.BuildOptions.LoggingMode` | The logging. |

### getLoggingValue()

    public abstract int getLoggingValue()

Option to specify the logging mode, which determines where the logs are
stored.

`.google.events.cloud.cloudbuild.v1.BuildOptions.LoggingMode logging = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for logging. |

### getMachineType()

    public abstract BuildOptions.MachineType getMachineType()

Compute Engine machine type on which to run the build.

`.google.events.cloud.cloudbuild.v1.BuildOptions.MachineType machine_type = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.BuildOptions.MachineType` | The machineType. |

### getMachineTypeValue()

    public abstract int getMachineTypeValue()

Compute Engine machine type on which to run the build.

`.google.events.cloud.cloudbuild.v1.BuildOptions.MachineType machine_type = 3;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for machineType. |

### getRequestedVerifyOption()

    public abstract BuildOptions.VerifyOption getRequestedVerifyOption()

Requested verifiability options.

`.google.events.cloud.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.BuildOptions.VerifyOption` | The requestedVerifyOption. |

### getRequestedVerifyOptionValue()

    public abstract int getRequestedVerifyOptionValue()

Requested verifiability options.

`.google.events.cloud.cloudbuild.v1.BuildOptions.VerifyOption requested_verify_option = 2;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for requestedVerifyOption. |

### getSecretEnv(int index)

    public abstract String getSecretEnv(int index)

A list of global environment variables, which are encrypted using a Cloud
Key Management Service crypto key. These values must be specified in the
build's `Secret`. These variables will be available to all build steps
in this build.

`repeated string secret_env = 13;`

| **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 secretEnv at the given index. |

### getSecretEnvBytes(int index)

    public abstract ByteString getSecretEnvBytes(int index)

A list of global environment variables, which are encrypted using a Cloud
Key Management Service crypto key. These values must be specified in the
build's `Secret`. These variables will be available to all build steps
in this build.

`repeated string secret_env = 13;`

| **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 secretEnv at the given index. |

### getSecretEnvCount()

    public abstract int getSecretEnvCount()

A list of global environment variables, which are encrypted using a Cloud
Key Management Service crypto key. These values must be specified in the
build's `Secret`. These variables will be available to all build steps
in this build.

`repeated string secret_env = 13;`

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

### getSecretEnvList()

    public abstract List<String> getSecretEnvList()

A list of global environment variables, which are encrypted using a Cloud
Key Management Service crypto key. These values must be specified in the
build's `Secret`. These variables will be available to all build steps
in this build.

`repeated string secret_env = 13;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the secretEnv. |

### getSourceProvenanceHash(int index)

    public abstract Hash.HashType getSourceProvenanceHash(int index)

Requested hash for SourceProvenance.

`repeated .google.events.cloud.cloudbuild.v1.Hash.HashType source_provenance_hash = 1;
`

| **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.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.Hash.HashType` | The sourceProvenanceHash at the given index. |

### getSourceProvenanceHashCount()

    public abstract int getSourceProvenanceHashCount()

Requested hash for SourceProvenance.

`repeated .google.events.cloud.cloudbuild.v1.Hash.HashType source_provenance_hash = 1;
`

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

### getSourceProvenanceHashList()

    public abstract List<Hash.HashType> getSourceProvenanceHashList()

Requested hash for SourceProvenance.

`repeated .google.events.cloud.cloudbuild.v1.Hash.HashType source_provenance_hash = 1;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.Hash.HashType>` | A list containing the sourceProvenanceHash. |

### getSourceProvenanceHashValue(int index)

    public abstract int getSourceProvenanceHashValue(int index)

Requested hash for SourceProvenance.

`repeated .google.events.cloud.cloudbuild.v1.Hash.HashType source_provenance_hash = 1;
`

| **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://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire of sourceProvenanceHash at the given index. |

### getSourceProvenanceHashValueList()

    public abstract List<Integer> getSourceProvenanceHashValueList()

Requested hash for SourceProvenance.

`repeated .google.events.cloud.cloudbuild.v1.Hash.HashType source_provenance_hash = 1;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html>` | A list containing the enum numeric values on the wire for sourceProvenanceHash. |

### getSubstitutionOption()

    public abstract BuildOptions.SubstitutionOption getSubstitutionOption()

Option to specify behavior when there is an error in the substitution
checks.

`
.google.events.cloud.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.BuildOptions.SubstitutionOption` | The substitutionOption. |

### getSubstitutionOptionValue()

    public abstract int getSubstitutionOptionValue()

Option to specify behavior when there is an error in the substitution
checks.

`
.google.events.cloud.cloudbuild.v1.BuildOptions.SubstitutionOption substitution_option = 4;
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for substitutionOption. |

### getVolumes(int index)

    public abstract Volume getVolumes(int index)

Global list of volumes to mount for ALL build steps
Each volume is created as an empty volume prior to starting the build
process. Upon completion of the build, volumes and their contents are
discarded. Global volume names and paths cannot conflict with the volumes
defined a build step.
Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.

`repeated .google.events.cloud.cloudbuild.v1.Volume volumes = 14;`

| **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-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.Volume` |   |

### getVolumesCount()

    public abstract int getVolumesCount()

Global list of volumes to mount for ALL build steps
Each volume is created as an empty volume prior to starting the build
process. Upon completion of the build, volumes and their contents are
discarded. Global volume names and paths cannot conflict with the volumes
defined a build step.
Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.

`repeated .google.events.cloud.cloudbuild.v1.Volume volumes = 14;`

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

### getVolumesList()

    public abstract List<Volume> getVolumesList()

Global list of volumes to mount for ALL build steps
Each volume is created as an empty volume prior to starting the build
process. Upon completion of the build, volumes and their contents are
discarded. Global volume names and paths cannot conflict with the volumes
defined a build step.
Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.

`repeated .google.events.cloud.cloudbuild.v1.Volume volumes = 14;`

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

### getVolumesOrBuilder(int index)

    public abstract VolumeOrBuilder getVolumesOrBuilder(int index)

Global list of volumes to mount for ALL build steps
Each volume is created as an empty volume prior to starting the build
process. Upon completion of the build, volumes and their contents are
discarded. Global volume names and paths cannot conflict with the volumes
defined a build step.
Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.

`repeated .google.events.cloud.cloudbuild.v1.Volume volumes = 14;`

| **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-cloudevent-types/latest/com.google.events.cloud.cloudbuild.v1.VolumeOrBuilder` |   |

### getVolumesOrBuilderList()

    public abstract List<? extends VolumeOrBuilder> getVolumesOrBuilderList()

Global list of volumes to mount for ALL build steps
Each volume is created as an empty volume prior to starting the build
process. Upon completion of the build, volumes and their contents are
discarded. Global volume names and paths cannot conflict with the volumes
defined a build step.
Using a global volume in a build with only one step is not valid as
it is indicative of a build request with an incorrect configuration.

`repeated .google.events.cloud.cloudbuild.v1.Volume volumes = 14;`

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

### getWorkerPool()

    public abstract String getWorkerPool()

Option to specify a `WorkerPool` for the build.
Format: projects/{project}/locations/{location}/workerPools/{workerPool}

`string worker_pool = 7;`

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

### getWorkerPoolBytes()

    public abstract ByteString getWorkerPoolBytes()

Option to specify a `WorkerPool` for the build.
Format: projects/{project}/locations/{location}/workerPools/{workerPool}

`string worker_pool = 7;`

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