Copied!

Documentation provides the information for describing a service.

Example:

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:

To override the display text used for the link, this can be used:

Text can be excluded from doc using the following notation:

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:

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:

The directive suppress_warning does not directly affect documentation and is documented together with service config validation.

Generated from protobuf message google.api.Documentation

CloneableInstantiable
Methods
public __construct( $data = NULL)
 

Constructor.

  • param array $data { Optional. Data for populating the Message object.
    @type string $summary
          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`.
    @type array<\Google\Api\Page>|\Google\Protobuf\Internal\RepeatedField $pages
          The top level pages for the documentation set.
    @type array<\Google\Api\DocumentationRule>|\Google\Protobuf\Internal\RepeatedField $rules
          A list of documentation rules that apply to individual API elements.
          **NOTE:** All service configuration rules follow "last one wins" order.
    @type string $documentation_root_url
          The URL to the root of documentation.
    @type string $service_root_url
          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.
    @type string $overview
          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.
    
    }
public Google\Protobuf\Internal\Message::__debugInfo()
public Google\Protobuf\Internal\Message::byteSize()
 
  • ignore
public Google\Protobuf\Internal\Message::clear()
 

Clear all containing fields.

  • return null
public Google\Protobuf\Internal\Message::discardUnknownFields()
 

Clear all unknown fields previously parsed.

  • return null
public getDocumentationRootUrl()
 

The URL to the root of documentation.

Generated from protobuf field string documentation_root_url = 4;

  • return string
public getOverview()
 

Declares a single overview page. For example:

This is a shortcut for the following declaration (using pages style):

Note: you cannot specify both overview field and pages field.

Generated from protobuf field string overview = 2;

  • return string
public getPages()
 

The top level pages for the documentation set.

Generated from protobuf field repeated .google.api.Page pages = 5;

  • return \Google\Protobuf\Internal\RepeatedField
public getRules()
 

A list of documentation rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

Generated from protobuf field repeated .google.api.DocumentationRule rules = 3;

  • return \Google\Protobuf\Internal\RepeatedField
public 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.

Generated from protobuf field string service_root_url = 6;

  • return string
public 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.

Generated from protobuf field string summary = 1;

  • return string
public Google\Protobuf\Internal\Message::jsonByteSize( $options = 0)
 
  • ignore
public Google\Protobuf\Internal\Message::mergeFrom( $msg)
 

Merges the contents of the specified message into current message.

This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repeated fields are appended. Map fields key-value pairs are overwritten. Singular/Oneof sub-messages are recursively merged. All overwritten sub-messages are deep-copied.

  • param object $msg Protobuf message to be merged from.
  • return null
public Google\Protobuf\Internal\Message::mergeFromJsonString( $data, $ignore_unknown = false)
 

Parses a json string to protobuf message.

This function takes a string in the json wire format, matching the encoding output by serializeToJsonString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.

  • param string $data Json protobuf data.
  • param bool $ignore_unknown
  • return null
  • throws \Exception Invalid data.
public Google\Protobuf\Internal\Message::mergeFromString( $data)
 

Parses a protocol buffer contained in a string.

This function takes a string in the (non-human-readable) binary wire format, matching the encoding output by serializeToString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.

  • param string $data Binary protobuf data.
  • return null
  • throws \Exception Invalid data.
public Google\Protobuf\Internal\Message::parseFromJsonStream( $input, $ignore_unknown)
 
  • ignore
public Google\Protobuf\Internal\Message::parseFromStream( $input)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToJsonStream( $output)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToJsonString( $options = 0)
 

Serialize the message to json string.

  • return string Serialized json protobuf data.
public Google\Protobuf\Internal\Message::serializeToStream( $output)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToString()
 

Serialize the message to string.

  • return string Serialized binary protobuf data.
public setDocumentationRootUrl( $var)
 

The URL to the root of documentation.

Generated from protobuf field string documentation_root_url = 4;

  • param string $var
  • return $this
public setOverview( $var)
 

Declares a single overview page. For example:

This is a shortcut for the following declaration (using pages style):

Note: you cannot specify both overview field and pages field.

Generated from protobuf field string overview = 2;

  • param string $var
  • return $this
public setPages( $var)
 

The top level pages for the documentation set.

Generated from protobuf field repeated .google.api.Page pages = 5;

  • param \Google\Api\Page[]|\Google\Protobuf\Internal\RepeatedField $var
  • return $this
public setRules( $var)
 

A list of documentation rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

Generated from protobuf field repeated .google.api.DocumentationRule rules = 3;

  • param \Google\Api\DocumentationRule[]|\Google\Protobuf\Internal\RepeatedField $var
  • return $this
public setServiceRootUrl( $var)
 

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.

Generated from protobuf field string service_root_url = 6;

  • param string $var
  • return $this
public setSummary( $var)
 

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.

Generated from protobuf field string summary = 1;

  • param string $var
  • return $this
Properties
protected $documentation_root_url = ''
 

The URL to the root of documentation.

Generated from protobuf field string documentation_root_url = 4;

protected $overview = ''
 

Declares a single overview page. For example:

This is a shortcut for the following declaration (using pages style):

Note: you cannot specify both overview field and pages field.

Generated from protobuf field string overview = 2;

protected $service_root_url = ''
 

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.

Generated from protobuf field string service_root_url = 6;

protected $summary = ''
 

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.

Generated from protobuf field string summary = 1;

Methods
protected Google\Protobuf\Internal\Message::hasOneof( $number)
protected Google\Protobuf\Internal\Message::mergeFromArray(array $array)
 

Populates the message from a user-supplied PHP array. Array keys correspond to Message properties and nested message properties.

Example:

$message->mergeFromArray([
    'name' => 'This is a message name',
    'interval' => [
         'startTime' => time() - 60,
         'endTime' => time(),
    ]
]);

This method will trigger an error if it is passed data that cannot be converted to the correct type. For example, a StringValue field must receive data that is either a string or a StringValue object.

  • param array $array An array containing message properties and values.
  • return null
protected Google\Protobuf\Internal\Message::mergeFromJsonArray( $array, $ignore_unknown)
protected Google\Protobuf\Internal\Message::readOneof( $number)
protected Google\Protobuf\Internal\Message::readWrapperValue( $member)
protected Google\Protobuf\Internal\Message::whichOneof( $oneof_name)
protected Google\Protobuf\Internal\Message::writeOneof( $number, $value)
protected Google\Protobuf\Internal\Message::writeWrapperValue( $member, $value)
Properties
private $pages = NULL
 

The top level pages for the documentation set.

Generated from protobuf field repeated .google.api.Page pages = 5;

private $rules = NULL
 

A list of documentation rules that apply to individual API elements.

NOTE: All service configuration rules follow "last one wins" order.

Generated from protobuf field repeated .google.api.DocumentationRule rules = 3;

© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration