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()
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
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() (deprecated)
public AlternatePolicySpec getAlternate()
Deprecated. google.cloud.orgpolicy.v2.Policy.alternate is deprecated. See
google/cloud/orgpolicy/v2/orgpolicy.proto;l=217
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
Returns
getAlternateBuilder()
public AlternatePolicySpec.Builder getAlternateBuilder()
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
Returns
getAlternateOrBuilder()
public AlternatePolicySpecOrBuilder getAlternateOrBuilder()
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
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() (deprecated)
public boolean hasAlternate()
Deprecated. google.cloud.orgpolicy.v2.Policy.alternate is deprecated. See
google/cloud/orgpolicy/v2/orgpolicy.proto;l=217
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
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)
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
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)
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
Parameter
Returns
setAlternate(AlternatePolicySpec.Builder builderForValue)
public Policy.Builder setAlternate(AlternatePolicySpec.Builder builderForValue)
Deprecated.
.google.cloud.orgpolicy.v2.AlternatePolicySpec alternate = 3 [deprecated = true];
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