# Interface GuardrailOrBuilder (0.9.0)

0.9.0 (latest) 0.7.0 0.4.0 0.3.0 0.1.0

    public interface GuardrailOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getAction()

    public abstract TriggerAction getAction()

Optional. Action to take when the guardrail is triggered.

`.google.cloud.ces.v1.TriggerAction action = 5 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.TriggerAction` | The action. |

### getActionOrBuilder()

    public abstract TriggerActionOrBuilder getActionOrBuilder()

Optional. Action to take when the guardrail is triggered.

`.google.cloud.ces.v1.TriggerAction action = 5 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.TriggerActionOrBuilder` |   |

### getCodeCallback()

    public abstract Guardrail.CodeCallback getCodeCallback()

Optional. Guardrail that potentially blocks the conversation based on the
result of the callback execution.

`
.google.cloud.ces.v1.Guardrail.CodeCallback code_callback = 14 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.CodeCallback` | The codeCallback. |

### getCodeCallbackOrBuilder()

    public abstract Guardrail.CodeCallbackOrBuilder getCodeCallbackOrBuilder()

Optional. Guardrail that potentially blocks the conversation based on the
result of the callback execution.

`
.google.cloud.ces.v1.Guardrail.CodeCallback code_callback = 14 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.CodeCallbackOrBuilder` |   |

### getContentFilter()

    public abstract Guardrail.ContentFilter getContentFilter()

Optional. Guardrail that bans certain content from being used in the
conversation.

`
.google.cloud.ces.v1.Guardrail.ContentFilter content_filter = 8 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.ContentFilter` | The contentFilter. |

### getContentFilterOrBuilder()

    public abstract Guardrail.ContentFilterOrBuilder getContentFilterOrBuilder()

Optional. Guardrail that bans certain content from being used in the
conversation.

`
.google.cloud.ces.v1.Guardrail.ContentFilter content_filter = 8 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.ContentFilterOrBuilder` |   |

### getCreateTime()

    public abstract Timestamp getCreateTime()

Output only. Timestamp when the guardrail was created.

`.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The createTime. |

### getCreateTimeOrBuilder()

    public abstract TimestampOrBuilder getCreateTimeOrBuilder()

Output only. Timestamp when the guardrail was created.

`.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### getDescription()

    public abstract String getDescription()

Optional. Description of the guardrail.

`string description = 3 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The description. |

### getDescriptionBytes()

    public abstract ByteString getDescriptionBytes()

Optional. Description of the guardrail.

`string description = 3 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for description. |

### getDisplayName()

    public abstract String getDisplayName()

Required. Display name of the guardrail.

`string display_name = 2 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The displayName. |

### getDisplayNameBytes()

    public abstract ByteString getDisplayNameBytes()

Required. Display name of the guardrail.

`string display_name = 2 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for displayName. |

### getEnabled()

    public abstract boolean getEnabled()

Optional. Whether the guardrail is enabled.

`bool enabled = 4 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enabled. |

### getEtag()

    public abstract String getEtag()

Etag used to ensure the object hasn't changed during a read-modify-write
operation. If the etag is empty, the update will overwrite any concurrent
changes.

`string etag = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The etag. |

### getEtagBytes()

    public abstract ByteString getEtagBytes()

Etag used to ensure the object hasn't changed during a read-modify-write
operation. If the etag is empty, the update will overwrite any concurrent
changes.

`string etag = 11;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for etag. |

### getGuardrailTypeCase()

    public abstract Guardrail.GuardrailTypeCase getGuardrailTypeCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.GuardrailTypeCase` |   |

### getLlmPolicy()

    public abstract Guardrail.LlmPolicy getLlmPolicy()

Optional. Guardrail that blocks the conversation if the LLM response is
considered violating the policy based on the LLM classification.

`
.google.cloud.ces.v1.Guardrail.LlmPolicy llm_policy = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.LlmPolicy` | The llmPolicy. |

### getLlmPolicyOrBuilder()

    public abstract Guardrail.LlmPolicyOrBuilder getLlmPolicyOrBuilder()

Optional. Guardrail that blocks the conversation if the LLM response is
considered violating the policy based on the LLM classification.

`
.google.cloud.ces.v1.Guardrail.LlmPolicy llm_policy = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.LlmPolicyOrBuilder` |   |

### getLlmPromptSecurity()

    public abstract Guardrail.LlmPromptSecurity getLlmPromptSecurity()

Optional. Guardrail that blocks the conversation if the prompt is
considered unsafe based on the LLM classification.

`
.google.cloud.ces.v1.Guardrail.LlmPromptSecurity llm_prompt_security = 9 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.LlmPromptSecurity` | The llmPromptSecurity. |

### getLlmPromptSecurityOrBuilder()

    public abstract Guardrail.LlmPromptSecurityOrBuilder getLlmPromptSecurityOrBuilder()

Optional. Guardrail that blocks the conversation if the prompt is
considered unsafe based on the LLM classification.

`
.google.cloud.ces.v1.Guardrail.LlmPromptSecurity llm_prompt_security = 9 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.LlmPromptSecurityOrBuilder` |   |

### getModelSafety()

    public abstract Guardrail.ModelSafety getModelSafety()

Optional. Guardrail that blocks the conversation if the LLM response is
considered unsafe based on the model safety settings.

`
.google.cloud.ces.v1.Guardrail.ModelSafety model_safety = 13 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.ModelSafety` | The modelSafety. |

### getModelSafetyOrBuilder()

    public abstract Guardrail.ModelSafetyOrBuilder getModelSafetyOrBuilder()

Optional. Guardrail that blocks the conversation if the LLM response is
considered unsafe based on the model safety settings.

`
.google.cloud.ces.v1.Guardrail.ModelSafety model_safety = 13 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-ces/latest/com.google.cloud.ces.v1.Guardrail.ModelSafetyOrBuilder` |   |

### getName()

    public abstract String getName()

Identifier. The unique identifier of the guardrail.
Format:
`projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`

`string name = 1 [(.google.api.field_behavior) = IDENTIFIER];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The name. |

### getNameBytes()

    public abstract ByteString getNameBytes()

Identifier. The unique identifier of the guardrail.
Format:
`projects/{project}/locations/{location}/apps/{app}/guardrails/{guardrail}`

`string name = 1 [(.google.api.field_behavior) = IDENTIFIER];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for name. |

### getUpdateTime()

    public abstract Timestamp getUpdateTime()

Output only. Timestamp when the guardrail was last updated.

`.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Timestamp.html` | The updateTime. |

### getUpdateTimeOrBuilder()

    public abstract TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. Timestamp when the guardrail was last updated.

`.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.TimestampOrBuilder.html` |   |

### hasAction()

    public abstract boolean hasAction()

Optional. Action to take when the guardrail is triggered.

`.google.cloud.ces.v1.TriggerAction action = 5 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the action field is set. |

### hasCodeCallback()

    public abstract boolean hasCodeCallback()

Optional. Guardrail that potentially blocks the conversation based on the
result of the callback execution.

`
.google.cloud.ces.v1.Guardrail.CodeCallback code_callback = 14 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the codeCallback field is set. |

### hasContentFilter()

    public abstract boolean hasContentFilter()

Optional. Guardrail that bans certain content from being used in the
conversation.

`
.google.cloud.ces.v1.Guardrail.ContentFilter content_filter = 8 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the contentFilter field is set. |

### hasCreateTime()

    public abstract boolean hasCreateTime()

Output only. Timestamp when the guardrail was created.

`.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the createTime field is set. |

### hasLlmPolicy()

    public abstract boolean hasLlmPolicy()

Optional. Guardrail that blocks the conversation if the LLM response is
considered violating the policy based on the LLM classification.

`
.google.cloud.ces.v1.Guardrail.LlmPolicy llm_policy = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the llmPolicy field is set. |

### hasLlmPromptSecurity()

    public abstract boolean hasLlmPromptSecurity()

Optional. Guardrail that blocks the conversation if the prompt is
considered unsafe based on the LLM classification.

`
.google.cloud.ces.v1.Guardrail.LlmPromptSecurity llm_prompt_security = 9 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the llmPromptSecurity field is set. |

### hasModelSafety()

    public abstract boolean hasModelSafety()

Optional. Guardrail that blocks the conversation if the LLM response is
considered unsafe based on the model safety settings.

`
.google.cloud.ces.v1.Guardrail.ModelSafety model_safety = 13 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the modelSafety field is set. |

### hasUpdateTime()

    public abstract boolean hasUpdateTime()

Output only. Timestamp when the guardrail was last updated.

`.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the updateTime field is set. |