Class Documentation (2.42.0)

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: &#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 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()
Returns
Type Description
Documentation

getDescriptor()

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

newBuilder()

public static Documentation.Builder newBuilder()
Returns
Type Description
Documentation.Builder

newBuilder(Documentation prototype)

public static Documentation.Builder newBuilder(Documentation prototype)
Parameter
Name Description
prototype Documentation
Returns
Type Description
Documentation.Builder

parseDelimitedFrom(InputStream input)

public static Documentation parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Documentation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Documentation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Documentation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Documentation parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Documentation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Documentation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Documentation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Documentation parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Documentation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Documentation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Documentation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Documentation parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Documentation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Documentation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Documentation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Documentation parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Documentation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Documentation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Documentation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Documentation parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Documentation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Documentation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Documentation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Documentation> parser()
Returns
Type Description
Parser<Documentation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Documentation getDefaultInstanceForType()
Returns
Type Description
Documentation

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

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>

getParserForType()

public Parser<Documentation> getParserForType()
Returns
Type Description
Parser<Documentation>
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
Returns
Type Description
DocumentationRule

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>

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()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Documentation.Builder newBuilderForType()
Returns
Type Description
Documentation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Documentation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Documentation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Documentation.Builder toBuilder()
Returns
Type Description
Documentation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException