# Memorystore for Memcached V1 Client - Class InstanceMessage (2.1.2)

2.1.2 (latest) 2.1.1 2.0.4 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Memorystore for Memcached V1 Client class InstanceMessage.

Generated from protobuf message `google.cloud.memcache.v1.Instance.InstanceMessage`

## Namespace

Google \\ Cloud \\ Memcache \\ V1 \\ Instance

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ code` | `int` A code that correspond to one type of user-facing message. |
| `↳ message` | `string` Message on memcached instance which will be exposed to users. |

### getCode

A code that correspond to one type of user-facing message.

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

### setCode

A code that correspond to one type of user-facing message.

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

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

### getMessage

Message on memcached instance which will be exposed to users.

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

### setMessage

Message on memcached instance which will be exposed to users.

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

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