Package com.google.api
Class FieldPolicy.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
com.google.api.FieldPolicy.Builder
- All Implemented Interfaces:
FieldPolicyOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- FieldPolicy
public static final class FieldPolicy.Builder
extends com.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
implements FieldPolicyOrBuilder
Google API Policy Annotation This message defines a simple API policy annotation that can be used to annotate API request and response message fields with applicable policies. One field may have multiple applicable policies that must all be satisfied before a request can be processed. This policy annotation is used to generate the overall policy that will be used for automatic runtime policy enforcement and documentation generation.Protobuf type
google.api.FieldPolicy-
Method Summary
Modifier and TypeMethodDescriptionaddRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()clearField(com.google.protobuf.Descriptors.FieldDescriptor field) clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) Specifies the required permission(s) for the resource referred to by the field.Specifies the resource type for the resource referred to by the field.Selects one or more request or response message fields to apply this `FieldPolicy`.clone()static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorSpecifies the required permission(s) for the resource referred to by the field.com.google.protobuf.ByteStringSpecifies the required permission(s) for the resource referred to by the field.Specifies the resource type for the resource referred to by the field.com.google.protobuf.ByteStringSpecifies the resource type for the resource referred to by the field.Selects one or more request or response message fields to apply this `FieldPolicy`.com.google.protobuf.ByteStringSelects one or more request or response message fields to apply this `FieldPolicy`.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanmergeFrom(FieldPolicy other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) final FieldPolicy.BuildermergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) setResourcePermission(String value) Specifies the required permission(s) for the resource referred to by the field.setResourcePermissionBytes(com.google.protobuf.ByteString value) Specifies the required permission(s) for the resource referred to by the field.setResourceType(String value) Specifies the resource type for the resource referred to by the field.setResourceTypeBytes(com.google.protobuf.ByteString value) Specifies the resource type for the resource referred to by the field.setSelector(String value) Selects one or more request or response message fields to apply this `FieldPolicy`.setSelectorBytes(com.google.protobuf.ByteString value) Selects one or more request or response message fields to apply this `FieldPolicy`.final FieldPolicy.BuildersetUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clonein interfacecom.google.protobuf.Message.Builder- Specified by:
clonein interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clonein classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
setField
public FieldPolicy.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
clearField
- Specified by:
clearFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
clearFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
clearOneof
- Specified by:
clearOneofin interfacecom.google.protobuf.Message.Builder- Overrides:
clearOneofin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
setRepeatedField
public FieldPolicy.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
setRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
addRepeatedField
public FieldPolicy.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedFieldin interfacecom.google.protobuf.Message.Builder- Overrides:
addRepeatedFieldin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<FieldPolicy.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
mergeFrom
public FieldPolicy.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<FieldPolicy.Builder>- Throws:
IOException
-
getSelector
Selects one or more request or response message fields to apply this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the selector must be left as empty. The service config generator will automatically fill the correct value. When a `FieldPolicy` is used in service config, the selector must be a comma-separated string with valid request or response field paths, such as "foo.bar" or "foo.bar,foo.baz".
string selector = 1;- Specified by:
getSelectorin interfaceFieldPolicyOrBuilder- Returns:
- The selector.
-
getSelectorBytes
public com.google.protobuf.ByteString getSelectorBytes()Selects one or more request or response message fields to apply this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the selector must be left as empty. The service config generator will automatically fill the correct value. When a `FieldPolicy` is used in service config, the selector must be a comma-separated string with valid request or response field paths, such as "foo.bar" or "foo.bar,foo.baz".
string selector = 1;- Specified by:
getSelectorBytesin interfaceFieldPolicyOrBuilder- Returns:
- The bytes for selector.
-
setSelector
Selects one or more request or response message fields to apply this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the selector must be left as empty. The service config generator will automatically fill the correct value. When a `FieldPolicy` is used in service config, the selector must be a comma-separated string with valid request or response field paths, such as "foo.bar" or "foo.bar,foo.baz".
string selector = 1;- Parameters:
value- The selector to set.- Returns:
- This builder for chaining.
-
clearSelector
Selects one or more request or response message fields to apply this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the selector must be left as empty. The service config generator will automatically fill the correct value. When a `FieldPolicy` is used in service config, the selector must be a comma-separated string with valid request or response field paths, such as "foo.bar" or "foo.bar,foo.baz".
string selector = 1;- Returns:
- This builder for chaining.
-
setSelectorBytes
Selects one or more request or response message fields to apply this `FieldPolicy`. When a `FieldPolicy` is used in proto annotation, the selector must be left as empty. The service config generator will automatically fill the correct value. When a `FieldPolicy` is used in service config, the selector must be a comma-separated string with valid request or response field paths, such as "foo.bar" or "foo.bar,foo.baz".
string selector = 1;- Parameters:
value- The bytes for selector to set.- Returns:
- This builder for chaining.
-
getResourcePermission
Specifies the required permission(s) for the resource referred to by the field. It requires the field contains a valid resource reference, and the request must pass the permission checks to proceed. For example, "resourcemanager.projects.get".
string resource_permission = 2;- Specified by:
getResourcePermissionin interfaceFieldPolicyOrBuilder- Returns:
- The resourcePermission.
-
getResourcePermissionBytes
public com.google.protobuf.ByteString getResourcePermissionBytes()Specifies the required permission(s) for the resource referred to by the field. It requires the field contains a valid resource reference, and the request must pass the permission checks to proceed. For example, "resourcemanager.projects.get".
string resource_permission = 2;- Specified by:
getResourcePermissionBytesin interfaceFieldPolicyOrBuilder- Returns:
- The bytes for resourcePermission.
-
setResourcePermission
Specifies the required permission(s) for the resource referred to by the field. It requires the field contains a valid resource reference, and the request must pass the permission checks to proceed. For example, "resourcemanager.projects.get".
string resource_permission = 2;- Parameters:
value- The resourcePermission to set.- Returns:
- This builder for chaining.
-
clearResourcePermission
Specifies the required permission(s) for the resource referred to by the field. It requires the field contains a valid resource reference, and the request must pass the permission checks to proceed. For example, "resourcemanager.projects.get".
string resource_permission = 2;- Returns:
- This builder for chaining.
-
setResourcePermissionBytes
Specifies the required permission(s) for the resource referred to by the field. It requires the field contains a valid resource reference, and the request must pass the permission checks to proceed. For example, "resourcemanager.projects.get".
string resource_permission = 2;- Parameters:
value- The bytes for resourcePermission to set.- Returns:
- This builder for chaining.
-
getResourceType
Specifies the resource type for the resource referred to by the field.
string resource_type = 3;- Specified by:
getResourceTypein interfaceFieldPolicyOrBuilder- Returns:
- The resourceType.
-
getResourceTypeBytes
public com.google.protobuf.ByteString getResourceTypeBytes()Specifies the resource type for the resource referred to by the field.
string resource_type = 3;- Specified by:
getResourceTypeBytesin interfaceFieldPolicyOrBuilder- Returns:
- The bytes for resourceType.
-
setResourceType
Specifies the resource type for the resource referred to by the field.
string resource_type = 3;- Parameters:
value- The resourceType to set.- Returns:
- This builder for chaining.
-
clearResourceType
Specifies the resource type for the resource referred to by the field.
string resource_type = 3;- Returns:
- This builder for chaining.
-
setResourceTypeBytes
Specifies the resource type for the resource referred to by the field.
string resource_type = 3;- Parameters:
value- The bytes for resourceType to set.- Returns:
- This builder for chaining.
-
setUnknownFields
public final FieldPolicy.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
setUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
setUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-
mergeUnknownFields
public final FieldPolicy.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - Specified by:
mergeUnknownFieldsin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3.Builder<FieldPolicy.Builder>
-