Class Restrictions.Builder (0.52.0)

public static final class Restrictions.Builder extends GeneratedMessageV3.Builder<Restrictions.Builder> implements RestrictionsOrBuilder

Describes the restrictions on the key.

Protobuf type google.api.apikeys.v2.Restrictions

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllApiTargets(Iterable<? extends ApiTarget> values)

public Restrictions.Builder addAllApiTargets(Iterable<? extends ApiTarget> values)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
values Iterable<? extends com.google.api.apikeys.v2.ApiTarget>
Returns
Type Description
Restrictions.Builder

addApiTargets(ApiTarget value)

public Restrictions.Builder addApiTargets(ApiTarget value)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
value ApiTarget
Returns
Type Description
Restrictions.Builder

addApiTargets(ApiTarget.Builder builderForValue)

public Restrictions.Builder addApiTargets(ApiTarget.Builder builderForValue)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
builderForValue ApiTarget.Builder
Returns
Type Description
Restrictions.Builder

addApiTargets(int index, ApiTarget value)

public Restrictions.Builder addApiTargets(int index, ApiTarget value)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameters
Name Description
index int
value ApiTarget
Returns
Type Description
Restrictions.Builder

addApiTargets(int index, ApiTarget.Builder builderForValue)

public Restrictions.Builder addApiTargets(int index, ApiTarget.Builder builderForValue)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameters
Name Description
index int
builderForValue ApiTarget.Builder
Returns
Type Description
Restrictions.Builder

addApiTargetsBuilder()

public ApiTarget.Builder addApiTargetsBuilder()

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Returns
Type Description
ApiTarget.Builder

addApiTargetsBuilder(int index)

public ApiTarget.Builder addApiTargetsBuilder(int index)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
index int
Returns
Type Description
ApiTarget.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Restrictions.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Restrictions.Builder
Overrides

build()

public Restrictions build()
Returns
Type Description
Restrictions

buildPartial()

public Restrictions buildPartial()
Returns
Type Description
Restrictions

clear()

public Restrictions.Builder clear()
Returns
Type Description
Restrictions.Builder
Overrides

clearAndroidKeyRestrictions()

public Restrictions.Builder clearAndroidKeyRestrictions()

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Returns
Type Description
Restrictions.Builder

clearApiTargets()

public Restrictions.Builder clearApiTargets()

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Returns
Type Description
Restrictions.Builder

clearBrowserKeyRestrictions()

public Restrictions.Builder clearBrowserKeyRestrictions()

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Returns
Type Description
Restrictions.Builder

clearClientRestrictions()

public Restrictions.Builder clearClientRestrictions()
Returns
Type Description
Restrictions.Builder

clearField(Descriptors.FieldDescriptor field)

public Restrictions.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Restrictions.Builder
Overrides

clearIosKeyRestrictions()

public Restrictions.Builder clearIosKeyRestrictions()

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Returns
Type Description
Restrictions.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Restrictions.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Restrictions.Builder
Overrides

clearServerKeyRestrictions()

public Restrictions.Builder clearServerKeyRestrictions()

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Returns
Type Description
Restrictions.Builder

clone()

public Restrictions.Builder clone()
Returns
Type Description
Restrictions.Builder
Overrides

getAndroidKeyRestrictions()

public AndroidKeyRestrictions getAndroidKeyRestrictions()

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Returns
Type Description
AndroidKeyRestrictions

The androidKeyRestrictions.

getAndroidKeyRestrictionsBuilder()

public AndroidKeyRestrictions.Builder getAndroidKeyRestrictionsBuilder()

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Returns
Type Description
AndroidKeyRestrictions.Builder

getAndroidKeyRestrictionsOrBuilder()

public AndroidKeyRestrictionsOrBuilder getAndroidKeyRestrictionsOrBuilder()

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Returns
Type Description
AndroidKeyRestrictionsOrBuilder

getApiTargets(int index)

public ApiTarget getApiTargets(int index)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
index int
Returns
Type Description
ApiTarget

getApiTargetsBuilder(int index)

public ApiTarget.Builder getApiTargetsBuilder(int index)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
index int
Returns
Type Description
ApiTarget.Builder

getApiTargetsBuilderList()

public List<ApiTarget.Builder> getApiTargetsBuilderList()

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Returns
Type Description
List<Builder>

getApiTargetsCount()

public int getApiTargetsCount()

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Returns
Type Description
int

getApiTargetsList()

public List<ApiTarget> getApiTargetsList()

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Returns
Type Description
List<ApiTarget>

getApiTargetsOrBuilder(int index)

public ApiTargetOrBuilder getApiTargetsOrBuilder(int index)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
index int
Returns
Type Description
ApiTargetOrBuilder

getApiTargetsOrBuilderList()

public List<? extends ApiTargetOrBuilder> getApiTargetsOrBuilderList()

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Returns
Type Description
List<? extends com.google.api.apikeys.v2.ApiTargetOrBuilder>

getBrowserKeyRestrictions()

public BrowserKeyRestrictions getBrowserKeyRestrictions()

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Returns
Type Description
BrowserKeyRestrictions

The browserKeyRestrictions.

getBrowserKeyRestrictionsBuilder()

public BrowserKeyRestrictions.Builder getBrowserKeyRestrictionsBuilder()

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Returns
Type Description
BrowserKeyRestrictions.Builder

getBrowserKeyRestrictionsOrBuilder()

public BrowserKeyRestrictionsOrBuilder getBrowserKeyRestrictionsOrBuilder()

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Returns
Type Description
BrowserKeyRestrictionsOrBuilder

getClientRestrictionsCase()

public Restrictions.ClientRestrictionsCase getClientRestrictionsCase()
Returns
Type Description
Restrictions.ClientRestrictionsCase

getDefaultInstanceForType()

public Restrictions getDefaultInstanceForType()
Returns
Type Description
Restrictions

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getIosKeyRestrictions()

public IosKeyRestrictions getIosKeyRestrictions()

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Returns
Type Description
IosKeyRestrictions

The iosKeyRestrictions.

getIosKeyRestrictionsBuilder()

public IosKeyRestrictions.Builder getIosKeyRestrictionsBuilder()

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Returns
Type Description
IosKeyRestrictions.Builder

getIosKeyRestrictionsOrBuilder()

public IosKeyRestrictionsOrBuilder getIosKeyRestrictionsOrBuilder()

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Returns
Type Description
IosKeyRestrictionsOrBuilder

getServerKeyRestrictions()

public ServerKeyRestrictions getServerKeyRestrictions()

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Returns
Type Description
ServerKeyRestrictions

The serverKeyRestrictions.

getServerKeyRestrictionsBuilder()

public ServerKeyRestrictions.Builder getServerKeyRestrictionsBuilder()

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Returns
Type Description
ServerKeyRestrictions.Builder

getServerKeyRestrictionsOrBuilder()

public ServerKeyRestrictionsOrBuilder getServerKeyRestrictionsOrBuilder()

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Returns
Type Description
ServerKeyRestrictionsOrBuilder

hasAndroidKeyRestrictions()

public boolean hasAndroidKeyRestrictions()

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Returns
Type Description
boolean

Whether the androidKeyRestrictions field is set.

hasBrowserKeyRestrictions()

public boolean hasBrowserKeyRestrictions()

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Returns
Type Description
boolean

Whether the browserKeyRestrictions field is set.

hasIosKeyRestrictions()

public boolean hasIosKeyRestrictions()

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Returns
Type Description
boolean

Whether the iosKeyRestrictions field is set.

hasServerKeyRestrictions()

public boolean hasServerKeyRestrictions()

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Returns
Type Description
boolean

Whether the serverKeyRestrictions field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeAndroidKeyRestrictions(AndroidKeyRestrictions value)

public Restrictions.Builder mergeAndroidKeyRestrictions(AndroidKeyRestrictions value)

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Parameter
Name Description
value AndroidKeyRestrictions
Returns
Type Description
Restrictions.Builder

mergeBrowserKeyRestrictions(BrowserKeyRestrictions value)

public Restrictions.Builder mergeBrowserKeyRestrictions(BrowserKeyRestrictions value)

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Parameter
Name Description
value BrowserKeyRestrictions
Returns
Type Description
Restrictions.Builder

mergeFrom(Restrictions other)

public Restrictions.Builder mergeFrom(Restrictions other)
Parameter
Name Description
other Restrictions
Returns
Type Description
Restrictions.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Restrictions.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Restrictions.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Restrictions.Builder
Overrides

mergeIosKeyRestrictions(IosKeyRestrictions value)

public Restrictions.Builder mergeIosKeyRestrictions(IosKeyRestrictions value)

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Parameter
Name Description
value IosKeyRestrictions
Returns
Type Description
Restrictions.Builder

mergeServerKeyRestrictions(ServerKeyRestrictions value)

public Restrictions.Builder mergeServerKeyRestrictions(ServerKeyRestrictions value)

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Parameter
Name Description
value ServerKeyRestrictions
Returns
Type Description
Restrictions.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Restrictions.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Restrictions.Builder
Overrides

removeApiTargets(int index)

public Restrictions.Builder removeApiTargets(int index)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameter
Name Description
index int
Returns
Type Description
Restrictions.Builder

setAndroidKeyRestrictions(AndroidKeyRestrictions value)

public Restrictions.Builder setAndroidKeyRestrictions(AndroidKeyRestrictions value)

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Parameter
Name Description
value AndroidKeyRestrictions
Returns
Type Description
Restrictions.Builder

setAndroidKeyRestrictions(AndroidKeyRestrictions.Builder builderForValue)

public Restrictions.Builder setAndroidKeyRestrictions(AndroidKeyRestrictions.Builder builderForValue)

The Android apps that are allowed to use the key.

.google.api.apikeys.v2.AndroidKeyRestrictions android_key_restrictions = 3;

Parameter
Name Description
builderForValue AndroidKeyRestrictions.Builder
Returns
Type Description
Restrictions.Builder

setApiTargets(int index, ApiTarget value)

public Restrictions.Builder setApiTargets(int index, ApiTarget value)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameters
Name Description
index int
value ApiTarget
Returns
Type Description
Restrictions.Builder

setApiTargets(int index, ApiTarget.Builder builderForValue)

public Restrictions.Builder setApiTargets(int index, ApiTarget.Builder builderForValue)

A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.

repeated .google.api.apikeys.v2.ApiTarget api_targets = 5;

Parameters
Name Description
index int
builderForValue ApiTarget.Builder
Returns
Type Description
Restrictions.Builder

setBrowserKeyRestrictions(BrowserKeyRestrictions value)

public Restrictions.Builder setBrowserKeyRestrictions(BrowserKeyRestrictions value)

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Parameter
Name Description
value BrowserKeyRestrictions
Returns
Type Description
Restrictions.Builder

setBrowserKeyRestrictions(BrowserKeyRestrictions.Builder builderForValue)

public Restrictions.Builder setBrowserKeyRestrictions(BrowserKeyRestrictions.Builder builderForValue)

The HTTP referrers (websites) that are allowed to use the key.

.google.api.apikeys.v2.BrowserKeyRestrictions browser_key_restrictions = 1;

Parameter
Name Description
builderForValue BrowserKeyRestrictions.Builder
Returns
Type Description
Restrictions.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Restrictions.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Restrictions.Builder
Overrides

setIosKeyRestrictions(IosKeyRestrictions value)

public Restrictions.Builder setIosKeyRestrictions(IosKeyRestrictions value)

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Parameter
Name Description
value IosKeyRestrictions
Returns
Type Description
Restrictions.Builder

setIosKeyRestrictions(IosKeyRestrictions.Builder builderForValue)

public Restrictions.Builder setIosKeyRestrictions(IosKeyRestrictions.Builder builderForValue)

The iOS apps that are allowed to use the key.

.google.api.apikeys.v2.IosKeyRestrictions ios_key_restrictions = 4;

Parameter
Name Description
builderForValue IosKeyRestrictions.Builder
Returns
Type Description
Restrictions.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Restrictions.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Restrictions.Builder
Overrides

setServerKeyRestrictions(ServerKeyRestrictions value)

public Restrictions.Builder setServerKeyRestrictions(ServerKeyRestrictions value)

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Parameter
Name Description
value ServerKeyRestrictions
Returns
Type Description
Restrictions.Builder

setServerKeyRestrictions(ServerKeyRestrictions.Builder builderForValue)

public Restrictions.Builder setServerKeyRestrictions(ServerKeyRestrictions.Builder builderForValue)

The IP addresses of callers that are allowed to use the key.

.google.api.apikeys.v2.ServerKeyRestrictions server_key_restrictions = 2;

Parameter
Name Description
builderForValue ServerKeyRestrictions.Builder
Returns
Type Description
Restrictions.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final Restrictions.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Restrictions.Builder
Overrides