public final class Documentation extends GeneratedMessageV3 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: (
include google/foo/overview.md
)
- name: Tutorial
content: ()
subpages;
- name: Java
content: ()
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>[fully.qualified.proto.name][]</code></pre>
To override the display text used for the link, this can be used:
<pre><code>[display text][fully.qualified.proto.name]</code></pre>
Text can be excluded from doc using the following notation:
<pre><code>(-- internal comment --)</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>( include path/to/file
)</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>( resource_for v1.shelves.books
)</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 Fields
DOCUMENTATION_ROOT_URL_FIELD_NUMBER
public static final int DOCUMENTATION_ROOT_URL_FIELD_NUMBER
Field Value
OVERVIEW_FIELD_NUMBER
public static final int OVERVIEW_FIELD_NUMBER
Field Value
PAGES_FIELD_NUMBER
public static final int PAGES_FIELD_NUMBER
Field Value
RULES_FIELD_NUMBER
public static final int RULES_FIELD_NUMBER
Field Value
SERVICE_ROOT_URL_FIELD_NUMBER
public static final int SERVICE_ROOT_URL_FIELD_NUMBER
Field Value
SUMMARY_FIELD_NUMBER
public static final int SUMMARY_FIELD_NUMBER
Field Value
Static Methods
getDefaultInstance()
public static Documentation getDefaultInstance()
Returns
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
newBuilder()
public static Documentation.Builder newBuilder()
Returns
newBuilder(Documentation prototype)
public static Documentation.Builder newBuilder(Documentation prototype)
Parameter
Returns
public static Documentation parseDelimitedFrom(InputStream input)
Parameter
Returns
Exceptions
public static Documentation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(byte[] data)
public static Documentation parseFrom(byte[] data)
Parameter
Name | Description |
data | byte[]
|
Returns
Exceptions
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteString data)
public static Documentation parseFrom(ByteString data)
Parameter
Returns
Exceptions
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Documentation parseFrom(CodedInputStream input)
Parameter
Returns
Exceptions
public static Documentation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
public static Documentation parseFrom(InputStream input)
Parameter
Returns
Exceptions
public static Documentation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parseFrom(ByteBuffer data)
public static Documentation parseFrom(ByteBuffer data)
Parameter
Returns
Exceptions
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Exceptions
parser()
public static Parser<Documentation> parser()
Returns
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter
Returns
Overrides
getDefaultInstanceForType()
public Documentation getDefaultInstanceForType()
Returns
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: (
include overview.md
)
</code></pre>
This is a shortcut for the following declaration (using pages style):
<pre><code>documentation:
summary: ...
pages:
- name: Overview
content: (
include overview.md
)
</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: (
include overview.md
)
</code></pre>
This is a shortcut for the following declaration (using pages style):
<pre><code>documentation:
summary: ...
pages:
- name: Overview
content: (
include overview.md
)
</code></pre>
Note: you cannot specify both overview
field and pages
field.
string overview = 2;
Returns
getPages(int index)
public Page getPages(int index)
The top level pages for the documentation set.
repeated .google.api.Page pages = 5;
Parameter
Returns
getPagesCount()
public int getPagesCount()
The top level pages for the documentation set.
repeated .google.api.Page pages = 5;
Returns
getPagesList()
public List<Page> getPagesList()
The top level pages for the documentation set.
repeated .google.api.Page pages = 5;
Returns
getPagesOrBuilder(int index)
public PageOrBuilder getPagesOrBuilder(int index)
The top level pages for the documentation set.
repeated .google.api.Page pages = 5;
Parameter
Returns
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> | |
getParserForType()
public Parser<Documentation> getParserForType()
Returns
Overrides
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
Returns
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
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
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
Returns
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> | |
getSerializedSize()
public int getSerializedSize()
Returns
Overrides
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
getUnknownFields()
public final UnknownFieldSet getUnknownFields()
Returns
Overrides
hashCode()
Returns
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
newBuilderForType()
public Documentation.Builder newBuilderForType()
Returns
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Documentation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Returns
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Returns
Overrides
toBuilder()
public Documentation.Builder toBuilder()
Returns
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Parameter
Overrides
Exceptions