# Google Cloud Service Usage V1 Client - Class Service (2.2.0)

2.2.0 (latest) 2.1.2 2.0.4 1.3.4 1.2.3 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud Service Usage V1 Client class Service.

A service that is available for use by the consumer.

Generated from protobuf message `google.api.serviceusage.v1.Service`

## Namespace

Google \\ Cloud \\ ServiceUsage \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` The resource name of the consumer and service. A valid name would be: - projects/123/services/serviceusage.googleapis.com |
| `↳ parent` | `string` The resource name of the consumer. A valid name would be: - projects/123 |
| `↳ config` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-usage/latest/V1.ServiceConfig` The service configuration of the available service. Some fields may be filtered out of the configuration in responses to the `ListServices` method. These fields are present only in responses to the `GetService` method. |
| `↳ state` | `int` Whether or not the service has been enabled for use by the consumer. |

### getName

The resource name of the consumer and service.

A valid name would be:

- projects/123/services/serviceusage.googleapis.com

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

### setName

The resource name of the consumer and service.

A valid name would be:

- projects/123/services/serviceusage.googleapis.com

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

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

### getParent

The resource name of the consumer.

A valid name would be:

- projects/123

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

### setParent

The resource name of the consumer.

A valid name would be:

- projects/123

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

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

### getConfig

The service configuration of the available service.

Some fields may be filtered out of the configuration in responses to
the `ListServices` method. These fields are present only in responses to
the `GetService` method.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-service-usage/latest/V1.ServiceConfig|null` |   |

### hasConfig

### clearConfig

### setConfig

The service configuration of the available service.

Some fields may be filtered out of the configuration in responses to
the `ListServices` method. These fields are present only in responses to
the `GetService` method.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-service-usage/latest/V1.ServiceConfig` |

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

### getState

Whether or not the service has been enabled for use by the consumer.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-service-usage/latest/V1.State). |

### setState

Whether or not the service has been enabled for use by the consumer.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-service-usage/latest/V1.State). |

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