Class Documentation

  • All Implemented Interfaces:
    DocumentationOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class Documentation
    extends com.google.protobuf.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
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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;
        Specified by:
        getSummary in interface DocumentationOrBuilder
        Returns:
        The summary.
      • getSummaryBytes

        public com.google.protobuf.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;
        Specified by:
        getSummaryBytes in interface DocumentationOrBuilder
        Returns:
        The bytes for summary.
      • getPagesCount

        public int getPagesCount()
         The top level pages for the documentation set.
         
        repeated .google.api.Page pages = 5;
        Specified by:
        getPagesCount in interface DocumentationOrBuilder
      • getPages

        public Page getPages​(int index)
         The top level pages for the documentation set.
         
        repeated .google.api.Page pages = 5;
        Specified by:
        getPages in interface DocumentationOrBuilder
      • 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;
        Specified by:
        getRulesList in interface DocumentationOrBuilder
      • 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;
        Specified by:
        getRulesCount in interface DocumentationOrBuilder
      • getRules

        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;
        Specified by:
        getRules in interface DocumentationOrBuilder
      • getRulesOrBuilder

        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;
        Specified by:
        getRulesOrBuilder in interface DocumentationOrBuilder
      • getDocumentationRootUrlBytes

        public com.google.protobuf.ByteString getDocumentationRootUrlBytes()
         The URL to the root of documentation.
         
        string documentation_root_url = 4;
        Specified by:
        getDocumentationRootUrlBytes in interface DocumentationOrBuilder
        Returns:
        The bytes for documentationRootUrl.
      • 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;
        Specified by:
        getServiceRootUrl in interface DocumentationOrBuilder
        Returns:
        The serviceRootUrl.
      • getServiceRootUrlBytes

        public com.google.protobuf.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;
        Specified by:
        getServiceRootUrlBytes in interface DocumentationOrBuilder
        Returns:
        The bytes for serviceRootUrl.
      • 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;
        Specified by:
        getOverview in interface DocumentationOrBuilder
        Returns:
        The overview.
      • getOverviewBytes

        public com.google.protobuf.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;
        Specified by:
        getOverviewBytes in interface DocumentationOrBuilder
        Returns:
        The bytes for overview.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static Documentation parseFrom​(ByteBuffer data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Documentation parseFrom​(ByteBuffer data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Documentation parseFrom​(com.google.protobuf.ByteString data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Documentation parseFrom​(com.google.protobuf.ByteString data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Documentation parseFrom​(byte[] data)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Documentation parseFrom​(byte[] data,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static Documentation parseFrom​(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws IOException
        Throws:
        IOException
      • newBuilderForType

        public Documentation.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public Documentation.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected Documentation.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static Documentation getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<Documentation> parser()
      • getParserForType

        public com.google.protobuf.Parser<Documentation> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public Documentation getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder