Class Documentation.Builder (2.24.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.api.Page>
Returns
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.api.DocumentationRule>
Returns
TypeDescription
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
NameDescription
valuePage
Returns
TypeDescription
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
NameDescription
builderForValuePage.Builder
Returns
TypeDescription
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
NameDescription
indexint
valuePage
Returns
TypeDescription
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
NameDescription
indexint
builderForValuePage.Builder
Returns
TypeDescription
Documentation.Builder

addPagesBuilder()

public Page.Builder addPagesBuilder()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Page.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Documentation.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueDocumentationRule
Returns
TypeDescription
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
NameDescription
builderForValueDocumentationRule.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueDocumentationRule
Returns
TypeDescription
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
NameDescription
indexint
builderForValueDocumentationRule.Builder
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
DocumentationRule.Builder

build()

public Documentation build()
Returns
TypeDescription
Documentation

buildPartial()

public Documentation buildPartial()
Returns
TypeDescription
Documentation

clear()

public Documentation.Builder clear()
Returns
TypeDescription
Documentation.Builder
Overrides

clearDocumentationRootUrl()

public Documentation.Builder clearDocumentationRootUrl()

The URL to the root of documentation.

string documentation_root_url = 4;

Returns
TypeDescription
Documentation.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Documentation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Documentation.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

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

This builder for chaining.

clone()

public Documentation.Builder clone()
Returns
TypeDescription
Documentation.Builder
Overrides

getDefaultInstanceForType()

public Documentation getDefaultInstanceForType()
Returns
TypeDescription
Documentation

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDocumentationRootUrl()

public String getDocumentationRootUrl()

The URL to the root of documentation.

string documentation_root_url = 4;

Returns
TypeDescription
String

The documentationRootUrl.

getDocumentationRootUrlBytes()

public ByteString getDocumentationRootUrlBytes()

The URL to the root of documentation.

string documentation_root_url = 4;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Page.Builder

getPagesBuilderList()

public List<Page.Builder> getPagesBuilderList()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
TypeDescription
List<Builder>

getPagesCount()

public int getPagesCount()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
TypeDescription
int

getPagesList()

public List<Page> getPagesList()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
PageOrBuilder

getPagesOrBuilderList()

public List<? extends PageOrBuilder> getPagesOrBuilderList()

The top level pages for the documentation set.

repeated .google.api.Page pages = 5;

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for summary.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Documentation other)

public Documentation.Builder mergeFrom(Documentation other)
Parameter
NameDescription
otherDocumentation
Returns
TypeDescription
Documentation.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Documentation.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Documentation.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Documentation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Documentation.Builder

setDocumentationRootUrl(String value)

public Documentation.Builder setDocumentationRootUrl(String value)

The URL to the root of documentation.

string documentation_root_url = 4;

Parameter
NameDescription
valueString

The documentationRootUrl to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for documentationRootUrl to set.

Returns
TypeDescription
Documentation.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

The overview to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for overview to set.

Returns
TypeDescription
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
NameDescription
indexint
valuePage
Returns
TypeDescription
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
NameDescription
indexint
builderForValuePage.Builder
Returns
TypeDescription
Documentation.Builder

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

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

The serviceRootUrl to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for serviceRootUrl to set.

Returns
TypeDescription
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
NameDescription
valueString

The summary to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for summary to set.

Returns
TypeDescription
Documentation.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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