Class VisibilityRule.Builder (2.65.0)

public static final class VisibilityRule.Builder extends GeneratedMessage.Builder<VisibilityRule.Builder> implements VisibilityRuleOrBuilder

A visibility rule provides visibility configuration for an individual API element.

Protobuf type google.api.VisibilityRule

Static Methods

getDescriptor()

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

Methods

build()

public VisibilityRule build()
Returns
Type Description
VisibilityRule

buildPartial()

public VisibilityRule buildPartial()
Returns
Type Description
VisibilityRule

clear()

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

clearRestriction()

public VisibilityRule.Builder clearRestriction()

A comma-separated list of visibility labels that apply to the selector. Any of the listed labels can be used to grant the visibility.

If a rule has multiple labels, removing one of the labels but not all of them can break clients.

Example:

visibility: rules:

  • selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW

    Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.

string restriction = 2;

Returns
Type Description
VisibilityRule.Builder

This builder for chaining.

clearSelector()

public VisibilityRule.Builder clearSelector()

Selects methods, messages, fields, enums, etc. to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Returns
Type Description
VisibilityRule.Builder

This builder for chaining.

getDefaultInstanceForType()

public VisibilityRule getDefaultInstanceForType()
Returns
Type Description
VisibilityRule

getDescriptorForType()

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

getRestriction()

public String getRestriction()

A comma-separated list of visibility labels that apply to the selector. Any of the listed labels can be used to grant the visibility.

If a rule has multiple labels, removing one of the labels but not all of them can break clients.

Example:

visibility: rules:

  • selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW

    Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.

string restriction = 2;

Returns
Type Description
String

The restriction.

getRestrictionBytes()

public ByteString getRestrictionBytes()

A comma-separated list of visibility labels that apply to the selector. Any of the listed labels can be used to grant the visibility.

If a rule has multiple labels, removing one of the labels but not all of them can break clients.

Example:

visibility: rules:

  • selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW

    Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.

string restriction = 2;

Returns
Type Description
ByteString

The bytes for restriction.

getSelector()

public String getSelector()

Selects methods, messages, fields, enums, etc. to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Returns
Type Description
String

The selector.

getSelectorBytes()

public ByteString getSelectorBytes()

Selects methods, messages, fields, enums, etc. to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Returns
Type Description
ByteString

The bytes for selector.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(VisibilityRule other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setRestriction(String value)

public VisibilityRule.Builder setRestriction(String value)

A comma-separated list of visibility labels that apply to the selector. Any of the listed labels can be used to grant the visibility.

If a rule has multiple labels, removing one of the labels but not all of them can break clients.

Example:

visibility: rules:

  • selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW

    Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.

string restriction = 2;

Parameter
Name Description
value String

The restriction to set.

Returns
Type Description
VisibilityRule.Builder

This builder for chaining.

setRestrictionBytes(ByteString value)

public VisibilityRule.Builder setRestrictionBytes(ByteString value)

A comma-separated list of visibility labels that apply to the selector. Any of the listed labels can be used to grant the visibility.

If a rule has multiple labels, removing one of the labels but not all of them can break clients.

Example:

visibility: rules:

  • selector: google.calendar.Calendar.EnhancedSearch restriction: INTERNAL, PREVIEW

    Removing INTERNAL from this restriction will break clients that rely on this method and only had access to it through INTERNAL.

string restriction = 2;

Parameter
Name Description
value ByteString

The bytes for restriction to set.

Returns
Type Description
VisibilityRule.Builder

This builder for chaining.

setSelector(String value)

public VisibilityRule.Builder setSelector(String value)

Selects methods, messages, fields, enums, etc. to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Parameter
Name Description
value String

The selector to set.

Returns
Type Description
VisibilityRule.Builder

This builder for chaining.

setSelectorBytes(ByteString value)

public VisibilityRule.Builder setSelectorBytes(ByteString value)

Selects methods, messages, fields, enums, etc. to which this rule applies.

Refer to selector for syntax details.

string selector = 1;

Parameter
Name Description
value ByteString

The bytes for selector to set.

Returns
Type Description
VisibilityRule.Builder

This builder for chaining.