Class Restrictions (0.47.0)

public final class Restrictions extends GeneratedMessageV3 implements RestrictionsOrBuilder

Describes the restrictions on the key.

Protobuf type google.api.apikeys.v2.Restrictions

Static Fields

ANDROID_KEY_RESTRICTIONS_FIELD_NUMBER

public static final int ANDROID_KEY_RESTRICTIONS_FIELD_NUMBER
Field Value
Type Description
int

API_TARGETS_FIELD_NUMBER

public static final int API_TARGETS_FIELD_NUMBER
Field Value
Type Description
int

BROWSER_KEY_RESTRICTIONS_FIELD_NUMBER

public static final int BROWSER_KEY_RESTRICTIONS_FIELD_NUMBER
Field Value
Type Description
int

IOS_KEY_RESTRICTIONS_FIELD_NUMBER

public static final int IOS_KEY_RESTRICTIONS_FIELD_NUMBER
Field Value
Type Description
int

SERVER_KEY_RESTRICTIONS_FIELD_NUMBER

public static final int SERVER_KEY_RESTRICTIONS_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Restrictions getDefaultInstance()
Returns
Type Description
Restrictions

getDescriptor()

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

newBuilder()

public static Restrictions.Builder newBuilder()
Returns
Type Description
Restrictions.Builder

newBuilder(Restrictions prototype)

public static Restrictions.Builder newBuilder(Restrictions prototype)
Parameter
Name Description
prototype Restrictions
Returns
Type Description
Restrictions.Builder

parseDelimitedFrom(InputStream input)

public static Restrictions parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Restrictions
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Restrictions parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Restrictions parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Restrictions
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Restrictions parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Restrictions parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Restrictions
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Restrictions parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Restrictions parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Restrictions
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Restrictions parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Restrictions parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Restrictions
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Restrictions parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Restrictions parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Restrictions
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Restrictions parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Restrictions
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Restrictions> parser()
Returns
Type Description
Parser<Restrictions>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
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.

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

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.

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

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.

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

getParserForType()

public Parser<Restrictions> getParserForType()
Returns
Type Description
Parser<Restrictions>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

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

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Restrictions.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Restrictions.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

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

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException