Class Restrictions.Builder (0.22.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.api.apikeys.v2.ApiTarget>
Returns
TypeDescription
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
NameDescription
valueApiTarget
Returns
TypeDescription
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
NameDescription
builderForValueApiTarget.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueApiTarget
Returns
TypeDescription
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
NameDescription
indexint
builderForValueApiTarget.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
ApiTarget.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Restrictions.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Restrictions.Builder
Overrides

build()

public Restrictions build()
Returns
TypeDescription
Restrictions

buildPartial()

public Restrictions buildPartial()
Returns
TypeDescription
Restrictions

clear()

public Restrictions.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
Restrictions.Builder

clearClientRestrictions()

public Restrictions.Builder clearClientRestrictions()
Returns
TypeDescription
Restrictions.Builder

clearField(Descriptors.FieldDescriptor field)

public Restrictions.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
Restrictions.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public Restrictions.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
BrowserKeyRestrictionsOrBuilder

getClientRestrictionsCase()

public Restrictions.ClientRestrictionsCase getClientRestrictionsCase()
Returns
TypeDescription
Restrictions.ClientRestrictionsCase

getDefaultInstanceForType()

public Restrictions getDefaultInstanceForType()
Returns
TypeDescription
Restrictions

getDescriptorForType()

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

Whether the serverKeyRestrictions field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
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
NameDescription
valueAndroidKeyRestrictions
Returns
TypeDescription
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
NameDescription
valueBrowserKeyRestrictions
Returns
TypeDescription
Restrictions.Builder

mergeFrom(Restrictions other)

public Restrictions.Builder mergeFrom(Restrictions other)
Parameter
NameDescription
otherRestrictions
Returns
TypeDescription
Restrictions.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Restrictions.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Restrictions.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Restrictions.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
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
NameDescription
valueIosKeyRestrictions
Returns
TypeDescription
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
NameDescription
valueServerKeyRestrictions
Returns
TypeDescription
Restrictions.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Restrictions.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
valueAndroidKeyRestrictions
Returns
TypeDescription
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
NameDescription
builderForValueAndroidKeyRestrictions.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueApiTarget
Returns
TypeDescription
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
NameDescription
indexint
builderForValueApiTarget.Builder
Returns
TypeDescription
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
NameDescription
valueBrowserKeyRestrictions
Returns
TypeDescription
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
NameDescription
builderForValueBrowserKeyRestrictions.Builder
Returns
TypeDescription
Restrictions.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Restrictions.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueIosKeyRestrictions
Returns
TypeDescription
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
NameDescription
builderForValueIosKeyRestrictions.Builder
Returns
TypeDescription
Restrictions.Builder

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

public Restrictions.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueServerKeyRestrictions
Returns
TypeDescription
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
NameDescription
builderForValueServerKeyRestrictions.Builder
Returns
TypeDescription
Restrictions.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final Restrictions.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Restrictions.Builder
Overrides