# Google API Common Protos Client - Class Service (4.14.0)

4.14.0 (latest) 4.13.0 4.12.5 4.11.0 4.10.0 4.9.0 4.8.3 Reference documentation and code samples for the Google API Common Protos Client class Service.

`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`

## Namespace

Google \\ Api

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` 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. |
| `↳ title` | `string` The product title for this service, it is the name displayed in Google Cloud Console. |
| `↳ producer_project_id` | `string` The Google project that owns this service. |
| `↳ id` | `string` 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. |
| `↳ apis` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Api>` A list of API interfaces exported by this service. Only the `name` field of the [google.protobuf.Api](https://protobuf.dev/reference/php/api-docs/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. |
| `↳ types` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Type>` 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 |
| `↳ enums` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Enum>` 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 |
| `↳ documentation` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Documentation` Additional API documentation. |
| `↳ backend` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Backend` API backend configuration. |
| `↳ http` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Http` HTTP configuration. |
| `↳ quota` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Quota` Quota configuration. |
| `↳ authentication` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Authentication` Auth configuration. |
| `↳ context` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Context` Context configuration. |
| `↳ usage` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Usage` Configuration controlling usage of this service. |
| `↳ endpoints` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Endpoint>` 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. |
| `↳ control` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Control` Configuration for the service control plane. |
| `↳ logs` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.LogDescriptor>` Defines the logs used by this service. |
| `↳ metrics` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor>` Defines the metrics used by this service. |
| `↳ monitored_resources` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MonitoredResourceDescriptor>` Defines the monitored resources used by this service. This is required by the `Service.monitoring` and `Service.logging` configurations. |
| `↳ billing` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Billing` Billing configuration. |
| `↳ logging` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Logging` Logging configuration. |
| `↳ monitoring` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Monitoring` Monitoring configuration. |
| `↳ system_parameters` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.SystemParameters` System parameter configuration. |
| `↳ source_info` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.SourceInfo` Output only. The source information for this configuration if available. |
| `↳ publishing` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Publishing` Settings for [Google Cloud Client libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) generated from APIs defined as protocol buffers. |
| `↳ config_version` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/UInt32Value` Obsolete. Do not use. This field has no semantic meaning. The service config compiler always sets this field to `3`. |

### 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getTitle

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setTitle

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProducerProjectId

The Google project that owns this service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setProducerProjectId

The Google project that owns this service.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setId

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getApis

A list of API interfaces exported by this service. Only the `name` field
of the [google.protobuf.Api](https://protobuf.dev/reference/php/api-docs/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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Api>` |   |

### setApis

A list of API interfaces exported by this service. Only the `name` field
of the [google.protobuf.Api](https://protobuf.dev/reference/php/api-docs/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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Api>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### 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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Type>` |   |

### setTypes

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Type>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### 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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Enum>` |   |

### setEnums

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Enum>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDocumentation

Additional API documentation.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Documentation|null` |   |

### hasDocumentation

### clearDocumentation

### setDocumentation

Additional API documentation.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Documentation` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBackend

API backend configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Backend|null` |   |

### hasBackend

### clearBackend

### setBackend

API backend configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Backend` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getHttp

HTTP configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Http|null` |   |

### hasHttp

### clearHttp

### setHttp

HTTP configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Http` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getQuota

Quota configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Quota|null` |   |

### hasQuota

### clearQuota

### setQuota

Quota configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Quota` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAuthentication

Auth configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Authentication|null` |   |

### hasAuthentication

### clearAuthentication

### setAuthentication

Auth configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Authentication` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getContext

Context configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Context|null` |   |

### hasContext

### clearContext

### setContext

Context configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Context` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUsage

Configuration controlling usage of this service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Usage|null` |   |

### hasUsage

### clearUsage

### setUsage

Configuration controlling usage of this service.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Usage` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### 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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Endpoint>` |   |

### setEndpoints

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Endpoint>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getControl

Configuration for the service control plane.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Control|null` |   |

### hasControl

### clearControl

### setControl

Configuration for the service control plane.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Control` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLogs

Defines the logs used by this service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.LogDescriptor>` |   |

### setLogs

Defines the logs used by this service.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.LogDescriptor>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMetrics

Defines the metrics used by this service.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor>` |   |

### setMetrics

Defines the metrics used by this service.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MetricDescriptor>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMonitoredResources

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MonitoredResourceDescriptor>` |   |

### setMonitoredResources

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.MonitoredResourceDescriptor>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBilling

Billing configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Billing|null` |   |

### hasBilling

### clearBilling

### setBilling

Billing configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Billing` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLogging

Logging configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Logging|null` |   |

### hasLogging

### clearLogging

### setLogging

Logging configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Logging` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMonitoring

Monitoring configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Monitoring|null` |   |

### hasMonitoring

### clearMonitoring

### setMonitoring

Monitoring configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Monitoring` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSystemParameters

System parameter configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.SystemParameters|null` |   |

### hasSystemParameters

### clearSystemParameters

### setSystemParameters

System parameter configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.SystemParameters` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSourceInfo

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.SourceInfo|null` |   |

### hasSourceInfo

### clearSourceInfo

### setSourceInfo

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.SourceInfo` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPublishing

Settings for [Google Cloud Client
libraries](https://cloud.google.com/apis/docs/cloud-client-libraries)
generated from APIs defined as protocol buffers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Publishing|null` |   |

### hasPublishing

### clearPublishing

### setPublishing

Settings for [Google Cloud Client
libraries](https://cloud.google.com/apis/docs/cloud-client-libraries)
generated from APIs defined as protocol buffers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Api.Publishing` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConfigVersion

Obsolete. Do not use.

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/UInt32Value|null` |   |

### hasConfigVersion

### clearConfigVersion

### 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`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|null` |   |

### setConfigVersion

Obsolete. Do not use.

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/UInt32Value` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### setConfigVersionUnwrapped

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`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|null` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |