# Google Cloud Dms V1 Client - Class CreateMappingRuleRequest (2.1.3)

2.1.3 (latest) 2.1.2 2.0.6 1.5.5 1.4.2 1.3.0 1.2.1 1.1.0 1.0.5 Reference documentation and code samples for the Google Cloud Dms V1 Client class CreateMappingRuleRequest.

Request message for 'CreateMappingRule' command.

Generated from protobuf message `google.cloud.clouddms.v1.CreateMappingRuleRequest`

## Namespace

Google \\ Cloud \\ CloudDms \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent which owns this collection of mapping rules. |
| `↳ mapping_rule_id` | `string` Required. The ID of the rule to create. |
| `↳ mapping_rule` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MappingRule` Required. Represents a [mapping rule](https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules) object. |
| `↳ request_id` | `string` A unique ID used to identify the request. If the server receives two requests with the same ID, then the second request is ignored. It is recommended to always set this value to a UUID. The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters. |

### getParent

Required. The parent which owns this collection of mapping rules.

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

### setParent

Required. The parent which owns this collection of mapping rules.

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

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

### getMappingRuleId

Required. The ID of the rule to create.

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

### setMappingRuleId

Required. The ID of the rule to create.

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

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

### getMappingRule

Required. Represents a [mapping rule](https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules)
object.

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

### hasMappingRule

### clearMappingRule

### setMappingRule

Required. Represents a [mapping rule](https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules)
object.

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

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

### getRequestId

A unique ID used to identify the request. If the server receives two
requests with the same ID, then the second request is ignored.

It is recommended to always set this value to a UUID.
The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
(_), and hyphens (-). The maximum length is 40 characters.

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

### setRequestId

A unique ID used to identify the request. If the server receives two
requests with the same ID, then the second request is ignored.

It is recommended to always set this value to a UUID.
The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores
(_), and hyphens (-). The maximum length is 40 characters.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The parent which owns this collection of mapping rules. Please see DataMigrationServiceClient::conversionWorkspaceName() for help formatting this field. |
| `mappingRule` | `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.MappingRule` Required. Represents a [mapping rule](https://cloud.google.com/database-migration/reference/rest/v1/projects.locations.mappingRules) object. |
| `mappingRuleId` | `string` Required. The ID of the rule to create. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dms/latest/V1.CreateMappingRuleRequest` |   |