Class Context.Builder (2.10.0)

Stay organized with collections Save and categorize content based on your preferences.
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 \u201cx-goog-ext-<extension_id>-bin\u201d and \u201cx-goog-ext-<extension_id>-jspb\u201d 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

Implements

ContextOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

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
NameDescription
valuesIterable<? extends com.google.api.ContextRule>
Returns
TypeDescription
Context.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Context.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Context.Builder
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;

Parameter
NameDescription
valueContextRule
Returns
TypeDescription
Context.Builder

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;

Parameter
NameDescription
builderForValueContextRule.Builder
Returns
TypeDescription
Context.Builder

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;

Parameters
NameDescription
indexint
valueContextRule
Returns
TypeDescription
Context.Builder

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;

Parameters
NameDescription
indexint
builderForValueContextRule.Builder
Returns
TypeDescription
Context.Builder

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;

Returns
TypeDescription
ContextRule.Builder

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
NameDescription
indexint
Returns
TypeDescription
ContextRule.Builder

build()

public Context build()
Returns
TypeDescription
Context

buildPartial()

public Context buildPartial()
Returns
TypeDescription
Context

clear()

public Context.Builder clear()
Returns
TypeDescription
Context.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Context.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Context.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public Context.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Context.Builder
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;

Returns
TypeDescription
Context.Builder

clone()

public Context.Builder clone()
Returns
TypeDescription
Context.Builder
Overrides

getDefaultInstanceForType()

public Context getDefaultInstanceForType()
Returns
TypeDescription
Context

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
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
NameDescription
indexint
Returns
TypeDescription
ContextRule

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
NameDescription
indexint
Returns
TypeDescription
ContextRule.Builder

getRulesBuilderList()

public List<ContextRule.Builder> getRulesBuilderList()

A list of RPC context rules that apply to individual API methods. NOTE: All service configuration rules