# Google Cloud Channel V1 Client - Class PriceByResource (2.4.1)

2.4.1 (latest) 2.4.0 2.3.1 2.2.1 2.1.4 2.0.0 1.9.5 1.8.2 1.7.0 1.6.0 1.5.0 1.4.0 1.3.0 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Channel V1 Client class PriceByResource.

Represents price by resource type.

Generated from protobuf message `google.cloud.channel.v1.PriceByResource`

## Namespace

Google \\ Cloud \\ Channel \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ resource_type` | `int` Resource Type. Example: SEAT |
| `↳ price` | `https://docs.cloud.google.com/php/docs/reference/cloud-channel/latest/V1.Price` Price of the Offer. Present if there are no price phases. |
| `↳ price_phases` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-channel/latest/V1.PricePhase>` Specifies the price by time range. |

### getResourceType

Resource Type. Example: SEAT

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

### setResourceType

Resource Type. Example: SEAT

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

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

### getPrice

Price of the Offer. Present if there are no price phases.

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

### hasPrice

### clearPrice

### setPrice

Price of the Offer. Present if there are no price phases.

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

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

### getPricePhases

Specifies the price by time range.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-channel/latest/V1.PricePhase>` |   |

### setPricePhases

Specifies the price by time range.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-channel/latest/V1.PricePhase>` |

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