0.6.0 (latest) 0.5.0 0.4.4 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Ces V1 Client class SafetySetting.

Safety setting.

Generated from protobuf message `google.cloud.ces.v1.Guardrail.ModelSafety.SafetySetting`

## Namespace

Google \\ Cloud \\ Ces \\ V1 \\ Guardrail \\ ModelSafety

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ category` | `int` Required. The harm category. |
| `↳ threshold` | `int` Required. The harm block threshold. |

### getCategory

Required. The harm category.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [HarmCategory](https://docs.cloud.google.com/php/docs/reference/cloud-ces/latest/V1.Guardrail.ModelSafety.HarmCategory.md.txt). |

### setCategory

Required. The harm category.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [HarmCategory](https://docs.cloud.google.com/php/docs/reference/cloud-ces/latest/V1.Guardrail.ModelSafety.HarmCategory.md.txt). |

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

### getThreshold

Required. The harm block threshold.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [HarmBlockThreshold](https://docs.cloud.google.com/php/docs/reference/cloud-ces/latest/V1.Guardrail.ModelSafety.HarmBlockThreshold.md.txt). |

### setThreshold

Required. The harm block threshold.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [HarmBlockThreshold](https://docs.cloud.google.com/php/docs/reference/cloud-ces/latest/V1.Guardrail.ModelSafety.HarmBlockThreshold.md.txt). |

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