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: (== include google/foo/tutorial.md ==)
subpages:
- name: Java
content: (== include google/foo/tutorial_java.md ==)
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
Inherited Members
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT)
com.google.protobuf.GeneratedMessageV3.<ListT>makeMutableCopy(ListT,int)
com.google.protobuf.GeneratedMessageV3.<T>emptyList(java.lang.Class<T>)
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)
Static Fields
DOCUMENTATION_ROOT_URL_FIELD_NUMBER
public static final int DOCUMENTATION_ROOT_URL_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
OVERVIEW_FIELD_NUMBER
public static final int OVERVIEW_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
PAGES_FIELD_NUMBER
public static final int PAGES_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
RULES_FIELD_NUMBER
public static final int RULES_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
SERVICE_ROOT_URL_FIELD_NUMBER
public static final int SERVICE_ROOT_URL_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
SUMMARY_FIELD_NUMBER
public static final int SUMMARY_FIELD_NUMBER
Field Value |
---|
Type | Description |
int | |
Static Methods
getDefaultInstance()
public static Documentation getDefaultInstance()
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
newBuilder()
public static Documentation.Builder newBuilder()
newBuilder(Documentation prototype)
public static Documentation.Builder newBuilder(Documentation prototype)
public static Documentation parseDelimitedFrom(InputStream input)
public static Documentation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(byte[] data)
public static Documentation parseFrom(byte[] data)
Parameter |
---|
Name | Description |
data | byte[]
|
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteString data)
public static Documentation parseFrom(ByteString data)
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(CodedInputStream input)
public static Documentation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(InputStream input)
public static Documentation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
parseFrom(ByteBuffer data)
public static Documentation parseFrom(ByteBuffer data)
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Documentation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
parser()
public static Parser<Documentation> parser()
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter |
---|
Name | Description |
obj | Object
|
Overrides
getDefaultInstanceForType()
public Documentation getDefaultInstanceForType()
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 |
---|
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 | |
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;
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
|
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()
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 |
---|
Name | Description |
index | int
|
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;
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
|
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 |
---|
Type | Description |
int | |
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 |
---|
Type | Description |
ByteString | The bytes for summary.
|
hashCode()
Returns |
---|
Type | Description |
int | |
Overrides
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
newBuilderForType()
public Documentation.Builder newBuilderForType()
newBuilderForType(GeneratedMessageV3.BuilderParent parent)
protected Documentation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Overrides
newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Overrides
toBuilder()
public Documentation.Builder toBuilder()
writeTo(CodedOutputStream output)
public void writeTo(CodedOutputStream output)
Overrides