Class Documentation.Builder (2.39.0)

public static final class Documentation.Builder extends GeneratedMessageV3.Builder<Documentation.Builder> implements DocumentationOrBuilder

Documentation provides the information for describing a service.

Example: <pre><code>documentation: summary: > The Google Calendar API gives access to most calendar features. pages:

  • name: Overview content: &#40;== include google/foo/overview.md ==&#41;
  • name: Tutorial content: &#40;== include google/foo/tutorial.md ==&#41; subpages:
    • name: Java content: &#40;== include google/foo/tutorial_java.md ==&#41; rules:
  • selector: google.calendar.Calendar.Get description: > ...
  • selector: google.calendar.Calendar.Put description: > ... </code></pre> Documentation is provided in markdown syntax. In addition to standard markdown features, definition lists, tables and fenced code blocks are supported. Section headers can be provided and are interpreted relative to the section nesting of the context where a documentation fragment is embedded.

    Documentation from the IDL is merged with documentation defined via the config at normalization time, where documentation provided by config rules overrides IDL provided.

    A number of constructs specific to the API platform are supported in documentation text.

    In order to reference a proto element, the following notation can be used: <pre><code>&#91;fully.qualified.proto.name]&#91;]</code></pre> To override the display text used for the link, this can be used: <pre><code>&#91;display text]&#91;fully.qualified.proto.name]</code></pre> Text can be excluded from doc using the following notation: <pre><code>&#40;-- internal comment --&#41;</code></pre>

    A few directives are available in documentation. Note that directives must appear on a single line to be properly identified. The include directive includes a markdown file from an external source: <pre><code>&#40;== include path/to/file ==&#41;</code></pre> The resource_for directive marks a message to be the resource of a collection in REST view. If it is not specified, tools attempt to infer the resource from the operations in a collection: <pre><code>&#40;== resource_for v1.shelves.books ==&#41;</code></pre> The directive suppress_warning does not directly affect documentation and is documented together with service config validation.

Protobuf type google.api.Documentation

Static Methods

getDescriptor()

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

Methods

addAllPages(Iterable<? extends Page> values)

public Documentation.Builder addAllPages(Iterable<? extends Page> values)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
values Iterable<? extends com.google.api.Page>
Returns
Type Description
Documentation.Builder

addAllRules(Iterable<? extends DocumentationRule> values)

public Documentation.Builder addAllRules(Iterable<? extends DocumentationRule> values)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
values Iterable<? extends com.google.api.DocumentationRule>
Returns
Type Description
Documentation.Builder

addPages(Page value)

public Documentation.Builder addPages(Page value)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
value Page
Returns
Type Description
Documentation.Builder

addPages(Page.Builder builderForValue)

public Documentation.Builder addPages(Page.Builder builderForValue)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
builderForValue Page.Builder
Returns
Type Description
Documentation.Builder

addPages(int index, Page value)

public Documentation.Builder addPages(int index, Page value)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameters
Name Description
index int
value Page
Returns
Type Description
Documentation.Builder

addPages(int index, Page.Builder builderForValue)

public Documentation.Builder addPages(int index, Page.Builder builderForValue)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameters
Name Description
index int
builderForValue Page.Builder
Returns
Type Description
Documentation.Builder

addPagesBuilder()

public Page.Builder addPagesBuilder()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
Type Description
Page.Builder

addPagesBuilder(int index)

public Page.Builder addPagesBuilder(int index)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
index int
Returns
Type Description
Page.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addRules(DocumentationRule value)

public Documentation.Builder addRules(DocumentationRule value)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
value DocumentationRule
Returns
Type Description
Documentation.Builder

addRules(DocumentationRule.Builder builderForValue)

public Documentation.Builder addRules(DocumentationRule.Builder builderForValue)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
builderForValue DocumentationRule.Builder
Returns
Type Description
Documentation.Builder

addRules(int index, DocumentationRule value)

public Documentation.Builder addRules(int index, DocumentationRule value)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameters
Name Description
index int
value DocumentationRule
Returns
Type Description
Documentation.Builder

addRules(int index, DocumentationRule.Builder builderForValue)

public Documentation.Builder addRules(int index, DocumentationRule.Builder builderForValue)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameters
Name Description
index int
builderForValue DocumentationRule.Builder
Returns
Type Description
Documentation.Builder

addRulesBuilder()

public DocumentationRule.Builder addRulesBuilder()

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

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

repeated .google.api.DocumentationRule rules = 3;

Returns
Type Description
DocumentationRule.Builder

addRulesBuilder(int index)

public DocumentationRule.Builder addRulesBuilder(int index)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
index int
Returns
Type Description
DocumentationRule.Builder

build()

public Documentation build()
Returns
Type Description
Documentation

buildPartial()

public Documentation buildPartial()
Returns
Type Description
Documentation

clear()

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

clearDocumentationRootUrl()

public Documentation.Builder clearDocumentationRootUrl()

The URL to the root of documentation.

string documentation_root_url = 4;

Returns
Type Description
Documentation.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearOverview()

public Documentation.Builder clearOverview()

Declares a single overview page. For example: <pre><code>documentation: summary: ... overview: &#40;== include overview.md ==&#41; </code></pre> This is a shortcut for the following declaration (using pages style): <pre><code>documentation: summary: ... pages:

  • name: Overview content: &#40;== include overview.md ==&#41; </code></pre> Note: you cannot specify both overview field and pages field.

string overview = 2;

Returns
Type Description
Documentation.Builder

This builder for chaining.

clearPages()

public Documentation.Builder clearPages()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
Type Description
Documentation.Builder

clearRules()

public Documentation.Builder clearRules()

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

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

repeated .google.api.DocumentationRule rules = 3;

Returns
Type Description
Documentation.Builder

clearServiceRootUrl()

public Documentation.Builder clearServiceRootUrl()

Specifies the service root url if the default one (the service name from the yaml file) is not suitable. This can be seen in any fully specified service urls as well as sections that show a base that other urls are relative to.

string service_root_url = 6;

Returns
Type Description
Documentation.Builder

This builder for chaining.

clearSummary()

public Documentation.Builder clearSummary()

A short description of what the service does. The summary must be plain text. It becomes the overview of the service displayed in Google Cloud Console. NOTE: This field is equivalent to the standard field description.

string summary = 1;

Returns
Type Description
Documentation.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public Documentation getDefaultInstanceForType()
Returns
Type Description
Documentation

getDescriptorForType()

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

getDocumentationRootUrl()

public String getDocumentationRootUrl()

The URL to the root of documentation.

string documentation_root_url = 4;

Returns
Type Description
String

The documentationRootUrl.

getDocumentationRootUrlBytes()

public ByteString getDocumentationRootUrlBytes()

The URL to the root of documentation.

string documentation_root_url = 4;

Returns
Type Description
ByteString

The bytes for documentationRootUrl.

getOverview()

public String getOverview()

Declares a single overview page. For example: <pre><code>documentation: summary: ... overview: &#40;== include overview.md ==&#41; </code></pre> This is a shortcut for the following declaration (using pages style): <pre><code>documentation: summary: ... pages:

  • name: Overview content: &#40;== include overview.md ==&#41; </code></pre> Note: you cannot specify both overview field and pages field.

string overview = 2;

Returns
Type Description
String

The overview.

getOverviewBytes()

public ByteString getOverviewBytes()

Declares a single overview page. For example: <pre><code>documentation: summary: ... overview: &#40;== include overview.md ==&#41; </code></pre> This is a shortcut for the following declaration (using pages style): <pre><code>documentation: summary: ... pages:

  • name: Overview content: &#40;== include overview.md ==&#41; </code></pre> Note: you cannot specify both overview field and pages field.

string overview = 2;

Returns
Type Description
ByteString

The bytes for overview.

getPages(int index)

public Page getPages(int index)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
index int
Returns
Type Description
Page

getPagesBuilder(int index)

public Page.Builder getPagesBuilder(int index)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
index int
Returns
Type Description
Page.Builder

getPagesBuilderList()

public List<Page.Builder> getPagesBuilderList()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
Type Description
List<Builder>

getPagesCount()

public int getPagesCount()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
Type Description
int

getPagesList()

public List<Page> getPagesList()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
Type Description
List<Page>

getPagesOrBuilder(int index)

public PageOrBuilder getPagesOrBuilder(int index)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
index int
Returns
Type Description
PageOrBuilder

getPagesOrBuilderList()

public List<? extends PageOrBuilder> getPagesOrBuilderList()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

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

getRules(int index)

public DocumentationRule getRules(int index)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
index int
Returns
Type Description
DocumentationRule

getRulesBuilder(int index)

public DocumentationRule.Builder getRulesBuilder(int index)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
index int
Returns
Type Description
DocumentationRule.Builder

getRulesBuilderList()

public List<DocumentationRule.Builder> getRulesBuilderList()

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

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

repeated .google.api.DocumentationRule rules = 3;

Returns
Type Description
List<Builder>

getRulesCount()

public int getRulesCount()

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

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

repeated .google.api.DocumentationRule rules = 3;

Returns
Type Description
int

getRulesList()

public List<DocumentationRule> getRulesList()

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

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

repeated .google.api.DocumentationRule rules = 3;

Returns
Type Description
List<DocumentationRule>

getRulesOrBuilder(int index)

public DocumentationRuleOrBuilder getRulesOrBuilder(int index)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
index int
Returns
Type Description
DocumentationRuleOrBuilder

getRulesOrBuilderList()

public List<? extends DocumentationRuleOrBuilder> getRulesOrBuilderList()

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

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

repeated .google.api.DocumentationRule rules = 3;

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

getServiceRootUrl()

public String getServiceRootUrl()

Specifies the service root url if the default one (the service name from the yaml file) is not suitable. This can be seen in any fully specified service urls as well as sections that show a base that other urls are relative to.

string service_root_url = 6;

Returns
Type Description
String

The serviceRootUrl.

getServiceRootUrlBytes()

public ByteString getServiceRootUrlBytes()

Specifies the service root url if the default one (the service name from the yaml file) is not suitable. This can be seen in any fully specified service urls as well as sections that show a base that other urls are relative to.

string service_root_url = 6;

Returns
Type Description
ByteString

The bytes for serviceRootUrl.

getSummary()

public String getSummary()

A short description of what the service does. The summary must be plain text. It becomes the overview of the service displayed in Google Cloud Console. NOTE: This field is equivalent to the standard field description.

string summary = 1;

Returns
Type Description
String

The summary.

getSummaryBytes()

public ByteString getSummaryBytes()

A short description of what the service does. The summary must be plain text. It becomes the overview of the service displayed in Google Cloud Console. NOTE: This field is equivalent to the standard field description.

string summary = 1;

Returns
Type Description
ByteString

The bytes for summary.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Documentation other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

removePages(int index)

public Documentation.Builder removePages(int index)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameter
Name Description
index int
Returns
Type Description
Documentation.Builder

removeRules(int index)

public Documentation.Builder removeRules(int index)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameter
Name Description
index int
Returns
Type Description
Documentation.Builder

setDocumentationRootUrl(String value)

public Documentation.Builder setDocumentationRootUrl(String value)

The URL to the root of documentation.

string documentation_root_url = 4;

Parameter
Name Description
value String

The documentationRootUrl to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setDocumentationRootUrlBytes(ByteString value)

public Documentation.Builder setDocumentationRootUrlBytes(ByteString value)

The URL to the root of documentation.

string documentation_root_url = 4;

Parameter
Name Description
value ByteString

The bytes for documentationRootUrl to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setOverview(String value)

public Documentation.Builder setOverview(String value)

Declares a single overview page. For example: <pre><code>documentation: summary: ... overview: &#40;== include overview.md ==&#41; </code></pre> This is a shortcut for the following declaration (using pages style): <pre><code>documentation: summary: ... pages:

  • name: Overview content: &#40;== include overview.md ==&#41; </code></pre> Note: you cannot specify both overview field and pages field.

string overview = 2;

Parameter
Name Description
value String

The overview to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setOverviewBytes(ByteString value)

public Documentation.Builder setOverviewBytes(ByteString value)

Declares a single overview page. For example: <pre><code>documentation: summary: ... overview: &#40;== include overview.md ==&#41; </code></pre> This is a shortcut for the following declaration (using pages style): <pre><code>documentation: summary: ... pages:

  • name: Overview content: &#40;== include overview.md ==&#41; </code></pre> Note: you cannot specify both overview field and pages field.

string overview = 2;

Parameter
Name Description
value ByteString

The bytes for overview to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setPages(int index, Page value)

public Documentation.Builder setPages(int index, Page value)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameters
Name Description
index int
value Page
Returns
Type Description
Documentation.Builder

setPages(int index, Page.Builder builderForValue)

public Documentation.Builder setPages(int index, Page.Builder builderForValue)

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Parameters
Name Description
index int
builderForValue Page.Builder
Returns
Type Description
Documentation.Builder

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

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

setRules(int index, DocumentationRule value)

public Documentation.Builder setRules(int index, DocumentationRule value)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameters
Name Description
index int
value DocumentationRule
Returns
Type Description
Documentation.Builder

setRules(int index, DocumentationRule.Builder builderForValue)

public Documentation.Builder setRules(int index, DocumentationRule.Builder builderForValue)

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

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

repeated .google.api.DocumentationRule rules = 3;

Parameters
Name Description
index int
builderForValue DocumentationRule.Builder
Returns
Type Description
Documentation.Builder

setServiceRootUrl(String value)

public Documentation.Builder setServiceRootUrl(String value)

Specifies the service root url if the default one (the service name from the yaml file) is not suitable. This can be seen in any fully specified service urls as well as sections that show a base that other urls are relative to.

string service_root_url = 6;

Parameter
Name Description
value String

The serviceRootUrl to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setServiceRootUrlBytes(ByteString value)

public Documentation.Builder setServiceRootUrlBytes(ByteString value)

Specifies the service root url if the default one (the service name from the yaml file) is not suitable. This can be seen in any fully specified service urls as well as sections that show a base that other urls are relative to.

string service_root_url = 6;

Parameter
Name Description
value ByteString

The bytes for serviceRootUrl to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setSummary(String value)

public Documentation.Builder setSummary(String value)

A short description of what the service does. The summary must be plain text. It becomes the overview of the service displayed in Google Cloud Console. NOTE: This field is equivalent to the standard field description.

string summary = 1;

Parameter
Name Description
value String

The summary to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setSummaryBytes(ByteString value)

public Documentation.Builder setSummaryBytes(ByteString value)

A short description of what the service does. The summary must be plain text. It becomes the overview of the service displayed in Google Cloud Console. NOTE: This field is equivalent to the standard field description.

string summary = 1;

Parameter
Name Description
value ByteString

The bytes for summary to set.

Returns
Type Description
Documentation.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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