public static final class Policy.Builder extends GeneratedMessageV3.Builder<Policy.Builder> implements PolicyOrBuilder
Defines a Cloud Organization Policy
which is used to specify Constraints
for configurations of Cloud Platform resources.
Protobuf type google.cloud.orgpolicy.v2.Policy
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Policy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
Returns
buildPartial()
public Policy buildPartial()
Returns
clear()
public Policy.Builder clear()
Returns
Overrides
clearAlternate()
public Policy.Builder clearAlternate()
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Returns
clearField(Descriptors.FieldDescriptor field)
public Policy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearName()
public Policy.Builder clearName()
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns
clearOneof(Descriptors.OneofDescriptor oneof)
public Policy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clearSpec()
public Policy.Builder clearSpec()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
clone()
public Policy.Builder clone()
Returns
Overrides
getAlternate()
public AlternatePolicySpec getAlternate()
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Returns
getAlternateBuilder()
public AlternatePolicySpec.Builder getAlternateBuilder()
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Returns
getAlternateOrBuilder()
public AlternatePolicySpecOrBuilder getAlternateOrBuilder()
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Returns
getDefaultInstanceForType()
public Policy getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getName()
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns
Type | Description |
String | The name.
|
getNameBytes()
public ByteString getNameBytes()
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Returns
getSpec()
public PolicySpec getSpec()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
getSpecBuilder()
public PolicySpec.Builder getSpecBuilder()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
getSpecOrBuilder()
public PolicySpecOrBuilder getSpecOrBuilder()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
hasAlternate()
public boolean hasAlternate()
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Returns
Type | Description |
boolean | Whether the alternate field is set.
|
hasSpec()
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Returns
Type | Description |
boolean | Whether the spec field is set.
|
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeAlternate(AlternatePolicySpec value)
public Policy.Builder mergeAlternate(AlternatePolicySpec value)
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Parameter
Returns
mergeFrom(Policy other)
public Policy.Builder mergeFrom(Policy other)
Parameter
Returns
public Policy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public Policy.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeSpec(PolicySpec value)
public Policy.Builder mergeSpec(PolicySpec value)
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Parameter
Returns
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Policy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
setAlternate(AlternatePolicySpec value)
public Policy.Builder setAlternate(AlternatePolicySpec value)
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Parameter
Returns
setAlternate(AlternatePolicySpec.Builder builderForValue)
public Policy.Builder setAlternate(AlternatePolicySpec.Builder builderForValue)
An alternate policy configuration that will be used instead of the baseline
policy configurations as determined by the launch.
Currently the only way the launch can trigger the alternate configuration
is via dry-run/darklaunch.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3;
Parameter
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public Policy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setName(String value)
public Policy.Builder setName(String value)
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Parameter
Name | Description |
value | String
The name to set.
|
Returns
setNameBytes(ByteString value)
public Policy.Builder setNameBytes(ByteString value)
Immutable. The resource name of the Policy. Must be one of the following
forms, where constraint_name is the name of the constraint which this
Policy configures:
projects/{project_number}/policies/{constraint_name}
folders/{folder_id}/policies/{constraint_name}
organizations/{organization_id}/policies/{constraint_name}
For example, "projects/123/policies/compute.disableSerialPortAccess".
Note: projects/{project_id}/policies/{constraint_name}
is also an
acceptable name for API requests, but responses will return the name using
the equivalent project number.
string name = 1 [(.google.api.field_behavior) = IMMUTABLE];
Parameter
Name | Description |
value | ByteString
The bytes for name to set.
|
Returns
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Policy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setSpec(PolicySpec value)
public Policy.Builder setSpec(PolicySpec value)
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Parameter
Returns
setSpec(PolicySpec.Builder builderForValue)
public Policy.Builder setSpec(PolicySpec.Builder builderForValue)
Basic information about the Organization Policy.
.google.cloud.orgpolicy.v2.PolicySpec spec = 2;
Parameter
Returns
setUnknownFields(UnknownFieldSet unknownFields)
public final Policy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides