# Cloud Data Loss Prevention (DLP) V2 API - Class Google::Cloud::Dlp::V2::RecordCondition::Condition (v1.17.0)

1.17.0 (latest) 1.16.1 1.15.2 1.14.0 1.13.0 1.12.1 1.11.0 1.10.0 1.9.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.0 1.3.1 1.2.0 1.1.0 1.0.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.2 0.19.0 0.18.0 0.17.0 0.16.0 0.15.0 0.14.0 0.13.1 0.12.0 0.11.0 0.10.0 0.9.0 0.8.1 Reference documentation and code samples for the Cloud Data Loss Prevention (DLP) V2 API class Google::Cloud::Dlp::V2::RecordCondition::Condition.

The field type of `value` and `field` do not need to match to be
considered equal, but not all comparisons are possible.
EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types,
but all other comparisons are invalid with incompatible types.
A `value` of type:


- `string` can be compared against all other types
- `boolean` can only be compared against other booleans
- `integer` can be compared against doubles or a string if the string value can be parsed as an integer.
- `double` can be compared against integers or a string if the string can be parsed as a double.
- `Timestamp` can be compared against strings in RFC 3339 date string format.
- `TimeOfDay` can be compared against timestamps and strings in the format of 'HH:mm:ss'.

<br />

If we fail to compare do to type mismatch, a warning will be given and
the condition will evaluate to false.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #field

    def field() -> ::Google::Cloud::Dlp::V2::FieldId

**Returns**

- ([::Google::Cloud::Dlp::V2::FieldId](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-FieldId)) --- Required. Field within the record this condition is evaluated against.

### #field=

    def field=(value) -> ::Google::Cloud::Dlp::V2::FieldId

**Parameter**

- **value** ([::Google::Cloud::Dlp::V2::FieldId](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-FieldId)) --- Required. Field within the record this condition is evaluated against.
**Returns**

- ([::Google::Cloud::Dlp::V2::FieldId](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-FieldId)) --- Required. Field within the record this condition is evaluated against.

### #operator

    def operator() -> ::Google::Cloud::Dlp::V2::RelationalOperator

**Returns**

- ([::Google::Cloud::Dlp::V2::RelationalOperator](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-RelationalOperator)) --- Required. Operator used to compare the field or infoType to the value.

### #operator=

    def operator=(value) -> ::Google::Cloud::Dlp::V2::RelationalOperator

**Parameter**

- **value** ([::Google::Cloud::Dlp::V2::RelationalOperator](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-RelationalOperator)) --- Required. Operator used to compare the field or infoType to the value.
**Returns**

- ([::Google::Cloud::Dlp::V2::RelationalOperator](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-RelationalOperator)) --- Required. Operator used to compare the field or infoType to the value.

### #value

    def value() -> ::Google::Cloud::Dlp::V2::Value

**Returns**

- ([::Google::Cloud::Dlp::V2::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-Value)) --- Value to compare against. \[Mandatory, except for `EXISTS` tests.\]

### #value=

    def value=(value) -> ::Google::Cloud::Dlp::V2::Value

**Parameter**

- **value** ([::Google::Cloud::Dlp::V2::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-Value)) --- Value to compare against. \[Mandatory, except for `EXISTS` tests.\]
**Returns**

- ([::Google::Cloud::Dlp::V2::Value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dlp-v2/latest/Google-Cloud-Dlp-V2-Value)) --- Value to compare against. \[Mandatory, except for `EXISTS` tests.\]