Copied!

Service is the root object of Google API service configuration (service config). It describes the basic information about a logical service, such as the service name and the user-facing title, and delegates other aspects to sub-sections. Each sub-section is either a proto message or a repeated proto message that configures a specific aspect, such as auth.

For more information, see each proto message definition. Example: type: google.api.Service name: calendar.googleapis.com title: Google Calendar API apis: - name: google.calendar.v3.Calendar visibility: rules: - selector: "google.calendar.v3." restriction: PREVIEW backend: rules: - selector: "google.calendar.v3." address: calendar.example.com authentication: providers: - id: google_calendar_auth jwks_uri: https://www.googleapis.com/oauth2/v1/certs issuer: https://securetoken.google.com rules: - selector: "*" requirements: provider_id: google_calendar_auth

Generated from protobuf message google.api.Service

CloneableInstantiable
Methods
public __construct( $data = NULL)
 

Constructor.

  • param array $data { Optional. Data for populating the Message object.
    @type string $name
          The service name, which is a DNS-like logical identifier for the
          service, such as `calendar.googleapis.com`. The service name
          typically goes through DNS verification to make sure the owner
          of the service also owns the DNS name.
    @type string $title
          The product title for this service, it is the name displayed in Google
          Cloud Console.
    @type string $producer_project_id
          The Google project that owns this service.
    @type string $id
          A unique ID for a specific instance of this message, typically assigned
          by the client for tracking purpose. Must be no longer than 63 characters
          and only lower case letters, digits, '.', '_' and '-' are allowed. If
          empty, the server may choose to generate one instead.
    @type \Google\Protobuf\Api[] $apis
          A list of API interfaces exported by this service. Only the `name` field
          of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by
          the configuration author, as the remaining fields will be derived from the
          IDL during the normalization process. It is an error to specify an API
          interface here which cannot be resolved against the associated IDL files.
    @type \Google\Protobuf\Type[] $types
          A list of all proto message types included in this API service.
          Types referenced directly or indirectly by the `apis` are automatically
          included.  Messages which are not referenced but shall be included, such as
          types used by the `google.protobuf.Any` type, should be listed here by
          name by the configuration author. Example:
              types:
              - name: google.protobuf.Int32
    @type \Google\Protobuf\Enum[] $enums
          A list of all enum types included in this API service.  Enums referenced
          directly or indirectly by the `apis` are automatically included.  Enums
          which are not referenced but shall be included should be listed here by
          name by the configuration author. Example:
              enums:
              - name: google.someapi.v1.SomeEnum
    @type \Google\Api\Documentation $documentation
          Additional API documentation.
    @type \Google\Api\Backend $backend
          API backend configuration.
    @type \Google\Api\Http $http
          HTTP configuration.
    @type \Google\Api\Quota $quota
          Quota configuration.
    @type \Google\Api\Authentication $authentication
          Auth configuration.
    @type \Google\Api\Context $context
          Context configuration.
    @type \Google\Api\Usage $usage
          Configuration controlling usage of this service.
    @type \Google\Api\Endpoint[] $endpoints
          Configuration for network endpoints.  If this is empty, then an endpoint
          with the same name as the service is automatically generated to service all
          defined APIs.
    @type \Google\Api\Control $control
          Configuration for the service control plane.
    @type \Google\Api\LogDescriptor[] $logs
          Defines the logs used by this service.
    @type \Google\Api\MetricDescriptor[] $metrics
          Defines the metrics used by this service.
    @type \Google\Api\MonitoredResourceDescriptor[] $monitored_resources
          Defines the monitored resources used by this service. This is required
          by the `Service.monitoring` and `Service.logging` configurations.
    @type \Google\Api\Billing $billing
          Billing configuration.
    @type \Google\Api\Logging $logging
          Logging configuration.
    @type \Google\Api\Monitoring $monitoring
          Monitoring configuration.
    @type \Google\Api\SystemParameters $system_parameters
          System parameter configuration.
    @type \Google\Api\SourceInfo $source_info
          Output only. The source information for this configuration if available.
    @type \Google\Api\Publishing $publishing
          Settings for [Google Cloud Client
          libraries](https://cloud.google.com/apis/docs/cloud-client-libraries)
          generated from APIs defined as protocol buffers.
    @type \Google\Protobuf\UInt32Value $config_version
          Obsolete. Do not use.
          This field has no semantic meaning. The service config compiler always
          sets this field to `3`.
    
    }
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 clearAuthentication()
public clearBackend()
public clearBilling()
public clearConfigVersion()
public clearContext()
public clearControl()
public clearDocumentation()
public clearHttp()
public clearLogging()
public clearMonitoring()
public clearPublishing()
public clearQuota()
public clearSourceInfo()
public clearSystemParameters()
public clearUsage()
public Google\Protobuf\Internal\Message::discardUnknownFields()
 

Clear all unknown fields previously parsed.

  • return null
public getApis()
 

A list of API interfaces exported by this service. Only the name field of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration author, as the remaining fields will be derived from the IDL during the normalization process. It is an error to specify an API interface here which cannot be resolved against the associated IDL files.

Generated from protobuf field repeated .google.protobuf.Api apis = 3;

  • return \RepeatedField<\Google\Protobuf\Api>
public getAuthentication()
 

Auth configuration.

Generated from protobuf field .google.api.Authentication authentication = 11;

  • return \Google\Api\Authentication|null
public getBackend()
 

API backend configuration.

Generated from protobuf field .google.api.Backend backend = 8;

  • return \Google\Api\Backend|null
public getBilling()
 

Billing configuration.

Generated from protobuf field .google.api.Billing billing = 26;

  • return \Google\Api\Billing|null
public getConfigVersion()
 

Obsolete. Do not use.

This field has no semantic meaning. The service config compiler always sets this field to 3.

Generated from protobuf field .google.protobuf.UInt32Value config_version = 20;

  • return \Google\Protobuf\UInt32Value|null
public getConfigVersionUnwrapped()
 

Returns the unboxed value from getConfigVersion()

Obsolete. Do not use. This field has no semantic meaning. The service config compiler always sets this field to 3.

Generated from protobuf field .google.protobuf.UInt32Value config_version = 20;

  • return int|null
public getContext()
 

Context configuration.

Generated from protobuf field .google.api.Context context = 12;

  • return \Google\Api\Context|null
public getControl()
 

Configuration for the service control plane.

Generated from protobuf field .google.api.Control control = 21;

  • return \Google\Api\Control|null
public getDocumentation()
 

Additional API documentation.

Generated from protobuf field .google.api.Documentation documentation = 6;

  • return \Google\Api\Documentation|null
public getEndpoints()
 

Configuration for network endpoints. If this is empty, then an endpoint with the same name as the service is automatically generated to service all defined APIs.

Generated from protobuf field repeated .google.api.Endpoint endpoints = 18;

  • return \RepeatedField<\Google\Api\Endpoint>
public getEnums()
 

A list of all enum types included in this API service. Enums referenced directly or indirectly by the apis are automatically included. Enums which are not referenced but shall be included should be listed here by name by the configuration author. Example: enums: - name: google.someapi.v1.SomeEnum

Generated from protobuf field repeated .google.protobuf.Enum enums = 5;

  • return \RepeatedField<\Google\Protobuf\Enum>
public getHttp()
 

HTTP configuration.

Generated from protobuf field .google.api.Http http = 9;

  • return \Google\Api\Http|null
public getId()
 

A unique ID for a specific instance of this message, typically assigned by the client for tracking purpose. Must be no longer than 63 characters and only lower case letters, digits, '.', '_' and '-' are allowed. If empty, the server may choose to generate one instead.

Generated from protobuf field string id = 33;

  • return string
public getLogging()
 

Logging configuration.

Generated from protobuf field .google.api.Logging logging = 27;

  • return \Google\Api\Logging|null
public getLogs()
 

Defines the logs used by this service.

Generated from protobuf field repeated .google.api.LogDescriptor logs = 23;

  • return \RepeatedField<\Google\Api\LogDescriptor>
public getMetrics()
 

Defines the metrics used by this service.

Generated from protobuf field repeated .google.api.MetricDescriptor metrics = 24;

  • return \RepeatedField<\Google\Api\MetricDescriptor>
public getMonitoredResources()
 

Defines the monitored resources used by this service. This is required by the Service.monitoring and Service.logging configurations.

Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25;

  • return \RepeatedField<\Google\Api\MonitoredResourceDescriptor>
public getMonitoring()
 

Monitoring configuration.

Generated from protobuf field .google.api.Monitoring monitoring = 28;

  • return \Google\Api\Monitoring|null
public getName()
 

The service name, which is a DNS-like logical identifier for the service, such as calendar.googleapis.com. The service name typically goes through DNS verification to make sure the owner of the service also owns the DNS name.

Generated from protobuf field string name = 1;

  • return string
public getProducerProjectId()
 

The Google project that owns this service.

Generated from protobuf field string producer_project_id = 22;

  • return string
public getPublishing()
 

Settings for Google Cloud Client libraries generated from APIs defined as protocol buffers.

Generated from protobuf field .google.api.Publishing publishing = 45;

  • return \Google\Api\Publishing|null
public getQuota()
 

Quota configuration.

Generated from protobuf field .google.api.Quota quota = 10;

  • return \Google\Api\Quota|null
public getSourceInfo()
 

Output only. The source information for this configuration if available.

Generated from protobuf field .google.api.SourceInfo source_info = 37;

  • return \Google\Api\SourceInfo|null
public getSystemParameters()
 

System parameter configuration.

Generated from protobuf field .google.api.SystemParameters system_parameters = 29;

  • return \Google\Api\SystemParameters|null
public getTitle()
 

The product title for this service, it is the name displayed in Google Cloud Console.

Generated from protobuf field string title = 2;

  • return string
public getTypes()
 

A list of all proto message types included in this API service.

Types referenced directly or indirectly by the apis are automatically included. Messages which are not referenced but shall be included, such as types used by the google.protobuf.Any type, should be listed here by name by the configuration author. Example: types: - name: google.protobuf.Int32

Generated from protobuf field repeated .google.protobuf.Type types = 4;

  • return \RepeatedField<\Google\Protobuf\Type>
public getUsage()
 

Configuration controlling usage of this service.

Generated from protobuf field .google.api.Usage usage = 15;

  • return \Google\Api\Usage|null
public hasAuthentication()
public hasBackend()
public hasBilling()
public hasConfigVersion()
public hasContext()
public hasControl()
public hasDocumentation()
public hasHttp()
public hasLogging()
public hasMonitoring()
public hasPublishing()
public hasQuota()
public hasSourceInfo()
public hasSystemParameters()
public hasUsage()
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 setApis( $var)
 

A list of API interfaces exported by this service. Only the name field of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration author, as the remaining fields will be derived from the IDL during the normalization process. It is an error to specify an API interface here which cannot be resolved against the associated IDL files.

Generated from protobuf field repeated .google.protobuf.Api apis = 3;

  • param \Google\Protobuf\Api[] $var
  • return $this
public setAuthentication( $var)
 

Auth configuration.

Generated from protobuf field .google.api.Authentication authentication = 11;

  • param \Google\Api\Authentication $var
  • return $this
public setBackend( $var)
 

API backend configuration.

Generated from protobuf field .google.api.Backend backend = 8;

  • param \Google\Api\Backend $var
  • return $this
public setBilling( $var)
 

Billing configuration.

Generated from protobuf field .google.api.Billing billing = 26;

  • param \Google\Api\Billing $var
  • return $this
public setConfigVersion( $var)
 

Obsolete. Do not use.

This field has no semantic meaning. The service config compiler always sets this field to 3.

Generated from protobuf field .google.protobuf.UInt32Value config_version = 20;

  • param \Google\Protobuf\UInt32Value $var
  • return $this
public setConfigVersionUnwrapped( $var)
 

Sets the field by wrapping a primitive type in a Google\Protobuf\UInt32Value object.

Obsolete. Do not use. This field has no semantic meaning. The service config compiler always sets this field to 3.

Generated from protobuf field .google.protobuf.UInt32Value config_version = 20;

  • param int|null $var
  • return $this
public setContext( $var)
 

Context configuration.

Generated from protobuf field .google.api.Context context = 12;

  • param \Google\Api\Context $var
  • return $this
public setControl( $var)
 

Configuration for the service control plane.

Generated from protobuf field .google.api.Control control = 21;

  • param \Google\Api\Control $var
  • return $this
public setDocumentation( $var)
 

Additional API documentation.

Generated from protobuf field .google.api.Documentation documentation = 6;

  • param \Google\Api\Documentation $var
  • return $this
public setEndpoints( $var)
 

Configuration for network endpoints. If this is empty, then an endpoint with the same name as the service is automatically generated to service all defined APIs.

Generated from protobuf field repeated .google.api.Endpoint endpoints = 18;

  • param \Google\Api\Endpoint[] $var
  • return $this
public setEnums( $var)
 

A list of all enum types included in this API service. Enums referenced directly or indirectly by the apis are automatically included. Enums which are not referenced but shall be included should be listed here by name by the configuration author. Example: enums: - name: google.someapi.v1.SomeEnum

Generated from protobuf field repeated .google.protobuf.Enum enums = 5;

  • param \Google\Protobuf\Enum[] $var
  • return $this
public setHttp( $var)
 

HTTP configuration.

Generated from protobuf field .google.api.Http http = 9;

  • param \Google\Api\Http $var
  • return $this
public setId( $var)
 

A unique ID for a specific instance of this message, typically assigned by the client for tracking purpose. Must be no longer than 63 characters and only lower case letters, digits, '.', '_' and '-' are allowed. If empty, the server may choose to generate one instead.

Generated from protobuf field string id = 33;

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

Logging configuration.

Generated from protobuf field .google.api.Logging logging = 27;

  • param \Google\Api\Logging $var
  • return $this
public setLogs( $var)
 

Defines the logs used by this service.

Generated from protobuf field repeated .google.api.LogDescriptor logs = 23;

  • param \Google\Api\LogDescriptor[] $var
  • return $this
public setMetrics( $var)
 

Defines the metrics used by this service.

Generated from protobuf field repeated .google.api.MetricDescriptor metrics = 24;

  • param \Google\Api\MetricDescriptor[] $var
  • return $this
public setMonitoredResources( $var)
 

Defines the monitored resources used by this service. This is required by the Service.monitoring and Service.logging configurations.

Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25;

  • param \Google\Api\MonitoredResourceDescriptor[] $var
  • return $this
public setMonitoring( $var)
 

Monitoring configuration.

Generated from protobuf field .google.api.Monitoring monitoring = 28;

  • param \Google\Api\Monitoring $var
  • return $this
public setName( $var)
 

The service name, which is a DNS-like logical identifier for the service, such as calendar.googleapis.com. The service name typically goes through DNS verification to make sure the owner of the service also owns the DNS name.

Generated from protobuf field string name = 1;

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

The Google project that owns this service.

Generated from protobuf field string producer_project_id = 22;

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

Settings for Google Cloud Client libraries generated from APIs defined as protocol buffers.

Generated from protobuf field .google.api.Publishing publishing = 45;

  • param \Google\Api\Publishing $var
  • return $this
public setQuota( $var)
 

Quota configuration.

Generated from protobuf field .google.api.Quota quota = 10;

  • param \Google\Api\Quota $var
  • return $this
public setSourceInfo( $var)
 

Output only. The source information for this configuration if available.

Generated from protobuf field .google.api.SourceInfo source_info = 37;

  • param \Google\Api\SourceInfo $var
  • return $this
public setSystemParameters( $var)
 

System parameter configuration.

Generated from protobuf field .google.api.SystemParameters system_parameters = 29;

  • param \Google\Api\SystemParameters $var
  • return $this
public setTitle( $var)
 

The product title for this service, it is the name displayed in Google Cloud Console.

Generated from protobuf field string title = 2;

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

A list of all proto message types included in this API service.

Types referenced directly or indirectly by the apis are automatically included. Messages which are not referenced but shall be included, such as types used by the google.protobuf.Any type, should be listed here by name by the configuration author. Example: types: - name: google.protobuf.Int32

Generated from protobuf field repeated .google.protobuf.Type types = 4;

  • param \Google\Protobuf\Type[] $var
  • return $this
public setUsage( $var)
 

Configuration controlling usage of this service.

Generated from protobuf field .google.api.Usage usage = 15;

  • param \Google\Api\Usage $var
  • return $this
Properties
protected $authentication = NULL
 

Auth configuration.

Generated from protobuf field .google.api.Authentication authentication = 11;

protected $backend = NULL
 

API backend configuration.

Generated from protobuf field .google.api.Backend backend = 8;

protected $billing = NULL
 

Billing configuration.

Generated from protobuf field .google.api.Billing billing = 26;

protected $config_version = NULL
 

Obsolete. Do not use.

This field has no semantic meaning. The service config compiler always sets this field to 3.

Generated from protobuf field .google.protobuf.UInt32Value config_version = 20;

protected $context = NULL
 

Context configuration.

Generated from protobuf field .google.api.Context context = 12;

protected $control = NULL
 

Configuration for the service control plane.

Generated from protobuf field .google.api.Control control = 21;

protected $documentation = NULL
 

Additional API documentation.

Generated from protobuf field .google.api.Documentation documentation = 6;

protected $http = NULL
 

HTTP configuration.

Generated from protobuf field .google.api.Http http = 9;

protected $id = ''
 

A unique ID for a specific instance of this message, typically assigned by the client for tracking purpose. Must be no longer than 63 characters and only lower case letters, digits, '.', '_' and '-' are allowed. If empty, the server may choose to generate one instead.

Generated from protobuf field string id = 33;

protected $logging = NULL
 

Logging configuration.

Generated from protobuf field .google.api.Logging logging = 27;

protected $monitoring = NULL
 

Monitoring configuration.

Generated from protobuf field .google.api.Monitoring monitoring = 28;

protected $name = ''
 

The service name, which is a DNS-like logical identifier for the service, such as calendar.googleapis.com. The service name typically goes through DNS verification to make sure the owner of the service also owns the DNS name.

Generated from protobuf field string name = 1;

protected $producer_project_id = ''
 

The Google project that owns this service.

Generated from protobuf field string producer_project_id = 22;

protected $publishing = NULL
 

Settings for Google Cloud Client libraries generated from APIs defined as protocol buffers.

Generated from protobuf field .google.api.Publishing publishing = 45;

protected $quota = NULL
 

Quota configuration.

Generated from protobuf field .google.api.Quota quota = 10;

protected $source_info = NULL
 

Output only. The source information for this configuration if available.

Generated from protobuf field .google.api.SourceInfo source_info = 37;

protected $system_parameters = NULL
 

System parameter configuration.

Generated from protobuf field .google.api.SystemParameters system_parameters = 29;

protected $title = ''
 

The product title for this service, it is the name displayed in Google Cloud Console.

Generated from protobuf field string title = 2;

protected $usage = NULL
 

Configuration controlling usage of this service.

Generated from protobuf field .google.api.Usage usage = 15;

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 $apis = NULL
 

A list of API interfaces exported by this service. Only the name field of the [google.protobuf.Api][google.protobuf.Api] needs to be provided by the configuration author, as the remaining fields will be derived from the IDL during the normalization process. It is an error to specify an API interface here which cannot be resolved against the associated IDL files.

Generated from protobuf field repeated .google.protobuf.Api apis = 3;

private $endpoints = NULL
 

Configuration for network endpoints. If this is empty, then an endpoint with the same name as the service is automatically generated to service all defined APIs.

Generated from protobuf field repeated .google.api.Endpoint endpoints = 18;

private $enums = NULL
 

A list of all enum types included in this API service. Enums referenced directly or indirectly by the apis are automatically included. Enums which are not referenced but shall be included should be listed here by name by the configuration author. Example: enums: - name: google.someapi.v1.SomeEnum

Generated from protobuf field repeated .google.protobuf.Enum enums = 5;

private $logs = NULL
 

Defines the logs used by this service.

Generated from protobuf field repeated .google.api.LogDescriptor logs = 23;

private $metrics = NULL
 

Defines the metrics used by this service.

Generated from protobuf field repeated .google.api.MetricDescriptor metrics = 24;

private $monitored_resources = NULL
 

Defines the monitored resources used by this service. This is required by the Service.monitoring and Service.logging configurations.

Generated from protobuf field repeated .google.api.MonitoredResourceDescriptor monitored_resources = 25;

private $types = NULL
 

A list of all proto message types included in this API service.

Types referenced directly or indirectly by the apis are automatically included. Messages which are not referenced but shall be included, such as types used by the google.protobuf.Any type, should be listed here by name by the configuration author. Example: types: - name: google.protobuf.Int32

Generated from protobuf field repeated .google.protobuf.Type types = 4;

© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration