Class Visibility (2.43.0)

public final class Visibility extends GeneratedMessageV3 implements VisibilityOrBuilder

Visibility restricts service consumer's access to service elements, such as whether an application can call a visibility-restricted method. The restriction is expressed by applying visibility labels on service elements. The visibility labels are elsewhere linked to service consumers.

A service can define multiple visibility labels, but a service consumer should be granted at most one visibility label. Multiple visibility labels for a single service consumer are not supported.

If an element and all its parents have no visibility label, its visibility is unconditionally granted.

Example:

 visibility:
   rules:
   - selector: google.calendar.Calendar.EnhancedSearch
     restriction: PREVIEW
   - selector: google.calendar.Calendar.Delegate
     restriction: INTERNAL

Here, all methods are publicly visible except for the restricted methods EnhancedSearch and Delegate.

Protobuf type google.api.Visibility

Implements

VisibilityOrBuilder

Static Fields

RULES_FIELD_NUMBER

public static final int RULES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Visibility getDefaultInstance()
Returns
Type Description
Visibility

getDescriptor()

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

newBuilder()

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

newBuilder(Visibility prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Visibility getDefaultInstanceForType()
Returns
Type Description
Visibility

getParserForType()

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

getRules(int index)

public VisibilityRule getRules(int index)

A list of visibility rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.VisibilityRule rules = 1;

Parameter
Name Description
index int
Returns
Type Description
VisibilityRule

getRulesCount()

public int getRulesCount()

A list of visibility rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.VisibilityRule rules = 1;

Returns
Type Description
int

getRulesList()

public List<VisibilityRule> getRulesList()

A list of visibility rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.VisibilityRule rules = 1;

Returns
Type Description
List<VisibilityRule>

getRulesOrBuilder(int index)

public VisibilityRuleOrBuilder getRulesOrBuilder(int index)

A list of visibility rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.VisibilityRule rules = 1;

Parameter
Name Description
index int
Returns
Type Description
VisibilityRuleOrBuilder

getRulesOrBuilderList()

public List<? extends VisibilityRuleOrBuilder> getRulesOrBuilderList()

A list of visibility rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

repeated .google.api.VisibilityRule rules = 1;

Returns
Type Description
List<? extends com.google.api.VisibilityRuleOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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 Visibility.Builder newBuilderForType()
Returns
Type Description
Visibility.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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