# Class MappingRule (1.16.0)

1.16.0 (latest) 1.15.0 1.14.0 1.13.0 1.12.4 1.11.0 1.10.1 1.9.5 1.8.0 1.7.1 1.6.2 1.5.0 1.4.3 1.3.2 1.2.1 1.1.0 1.0.2 0.2.4 0.1.0

    MappingRule(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Definition of a transformation that is to be applied to a
group of entities in the source schema. Several such
transformations can be applied to an entity sequentially to
define the corresponding entity in the target schema.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: <https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields>

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `name` | `str` Full name of the mapping rule resource, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{set}/mappingRule/{rule}. |
| `display_name` | `str` Optional. A human readable name |
| `state` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.MappingRule.State` Optional. The mapping rule state |
| `rule_scope` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.DatabaseEntityType` Required. The rule scope |
| `filter` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.MappingRuleFilter` Required. The rule filter |
| `rule_order` | `int` Required. The order in which the rule is applied. Lower order rules are applied before higher value rules so they may end up being overridden. |
| `revision_id` | `str` Output only. The revision ID of the mapping rule. A new revision is committed whenever the mapping rule is changed in any way. The format is an 8-character hexadecimal string. |
| `revision_create_time` | `google.protobuf.timestamp_pb2.Timestamp` Output only. The timestamp that the revision was created. |
| `single_entity_rename` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.SingleEntityRename` Optional. Rule to specify how a single entity should be renamed. This field is a member of `oneof`_ `details`. |
| `multi_entity_rename` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.MultiEntityRename` Optional. Rule to specify how multiple entities should be renamed. This field is a member of `oneof`_ `details`. |
| `entity_move` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.EntityMove` Optional. Rule to specify how multiple entities should be relocated into a different schema. This field is a member of `oneof`_ `details`. |
| `single_column_change` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.SingleColumnChange` Optional. Rule to specify how a single column is converted. This field is a member of `oneof`_ `details`. |
| `multi_column_data_type_change` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.MultiColumnDatatypeChange` Optional. Rule to specify how multiple columns should be converted to a different data type. This field is a member of `oneof`_ `details`. |
| `conditional_column_set_value` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.ConditionalColumnSetValue` Optional. Rule to specify how the data contained in a column should be transformed (such as trimmed, rounded, etc) provided that the data meets certain criteria. This field is a member of `oneof`_ `details`. |
| `convert_rowid_column` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.ConvertRowIdToColumn` Optional. Rule to specify how multiple tables should be converted with an additional rowid column. This field is a member of `oneof`_ `details`. |
| `set_table_primary_key` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.SetTablePrimaryKey` Optional. Rule to specify the primary key for a table This field is a member of `oneof`_ `details`. |
| `single_package_change` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.SinglePackageChange` Optional. Rule to specify how a single package is converted. This field is a member of `oneof`_ `details`. |
| `source_sql_change` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.SourceSqlChange` Optional. Rule to change the sql code for an entity, for example, function, procedure. This field is a member of `oneof`_ `details`. |
| `filter_table_columns` | `https://docs.cloud.google.com/python/docs/reference/datamigration/latest/google.cloud.clouddms_v1.types.FilterTableColumns` Optional. Rule to specify the list of columns to include or exclude from a table. This field is a member of `oneof`_ `details`. |

## Classes

### State

    State(value)

The current mapping rule state such as enabled, disabled or
deleted.