public static final class Context.Builder extends GeneratedMessageV3.Builder<Context.Builder> implements ContextOrBuilder
Context
defines which contexts an API requests.
Example:
context:
rules:
- selector: "*"
requested:
- google.rpc.context.ProjectContext
- google.rpc.context.OriginContext
The above specifies that all methods in the API request
google.rpc.context.ProjectContext
and
google.rpc.context.OriginContext
.
Available context types are defined in package
google.rpc.context
.
This also provides mechanism to allowlist any protobuf message extension that
can be sent in grpc metadata using “x-goog-ext-<extension_id>-bin” and
“x-goog-ext-<extension_id>-jspb” format. For example, list any service
specific protobuf types that can appear in grpc metadata as follows in your
yaml file:
Example:
context:
rules:
- selector: "google.example.library.v1.LibraryService.CreateBook"
allowed_request_extensions:
- google.foo.v1.NewExtension
allowed_response_extensions:
- google.foo.v1.NewExtension
You can also specify extension ID instead of fully qualified extension name
here.
Protobuf type google.api.Context
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addAllRules(Iterable<? extends ContextRule> values)
public Context.Builder addAllRules(Iterable<? extends ContextRule> values)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Parameter |
---|
Name | Description |
values | Iterable<? extends com.google.api.ContextRule>
|
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Context.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
addRules(ContextRule value)
public Context.Builder addRules(ContextRule value)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
addRules(ContextRule.Builder builderForValue)
public Context.Builder addRules(ContextRule.Builder builderForValue)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
addRules(int index, ContextRule value)
public Context.Builder addRules(int index, ContextRule value)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
addRules(int index, ContextRule.Builder builderForValue)
public Context.Builder addRules(int index, ContextRule.Builder builderForValue)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
addRulesBuilder()
public ContextRule.Builder addRulesBuilder()
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
addRulesBuilder(int index)
public ContextRule.Builder addRulesBuilder(int index)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Parameter |
---|
Name | Description |
index | int
|
build()
buildPartial()
public Context buildPartial()
clear()
public Context.Builder clear()
Overrides
clearField(Descriptors.FieldDescriptor field)
public Context.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public Context.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clearRules()
public Context.Builder clearRules()
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
clone()
public Context.Builder clone()
Overrides
getDefaultInstanceForType()
public Context getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Overrides
getRules(int index)
public ContextRule getRules(int index)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Parameter |
---|
Name | Description |
index | int
|
getRulesBuilder(int index)
public ContextRule.Builder getRulesBuilder(int index)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Parameter |
---|
Name | Description |
index | int
|
getRulesBuilderList()
public List<ContextRule.Builder> getRulesBuilderList()
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
getRulesCount()
public int getRulesCount()
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Returns |
---|
Type | Description |
int | |
getRulesList()
public List<ContextRule> getRulesList()
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
getRulesOrBuilder(int index)
public ContextRuleOrBuilder getRulesOrBuilder(int index)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Parameter |
---|
Name | Description |
index | int
|
getRulesOrBuilderList()
public List<? extends ContextRuleOrBuilder> getRulesOrBuilderList()
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Returns |
---|
Type | Description |
List<? extends com.google.api.ContextRuleOrBuilder> | |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(Context other)
public Context.Builder mergeFrom(Context other)
Parameter |
---|
Name | Description |
other | Context
|
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Context.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public Context.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Context.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
removeRules(int index)
public Context.Builder removeRules(int index)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
Parameter |
---|
Name | Description |
index | int
|
setField(Descriptors.FieldDescriptor field, Object value)
public Context.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Context.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setRules(int index, ContextRule value)
public Context.Builder setRules(int index, ContextRule value)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
setRules(int index, ContextRule.Builder builderForValue)
public Context.Builder setRules(int index, ContextRule.Builder builderForValue)
A list of RPC context rules that apply to individual API methods.
NOTE: All service configuration rules follow "last one wins" order.
repeated .google.api.ContextRule rules = 1;
setUnknownFields(UnknownFieldSet unknownFields)
public final Context.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides