# Interface ConversationOrBuilder (4.99.0)

4.99.0 (latest) 4.97.0 4.94.0 4.93.0 4.91.0 4.89.0 4.88.0 4.87.0 4.86.0 4.84.0 4.82.0 4.81.0 4.80.0 4.79.0 4.78.0 4.76.0 4.74.0 4.73.0 4.70.0 4.69.0 4.68.0 4.66.0 4.65.0 4.64.0 4.63.0 4.62.0 4.61.0 4.60.0 4.59.0 4.58.0 4.57.0 4.55.0 4.54.0 4.53.0 4.52.0 4.51.0 4.50.0 4.49.0 4.48.0 4.47.0 4.46.0 4.45.0 4.43.0 4.42.0 4.41.0 4.40.0 4.39.0 4.38.0 4.37.0 4.36.0 4.35.0 4.34.0 4.33.0 4.30.0 4.29.0 4.28.0 4.27.0 4.26.0 4.25.0 4.24.0 4.23.0 4.22.0 4.21.0 4.20.0 4.19.0 4.18.0 4.17.0 4.15.0 4.14.0 4.13.0 4.12.0 4.11.0 4.10.0 4.9.1 4.8.6 4.7.5 4.6.0 4.5.11 4.4.0 4.3.1

    public interface ConversationOrBuilder extends MessageOrBuilder

## Implements

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

## Methods

### containsIngestedContextReferences(String key)

    public abstract boolean containsIngestedContextReferences(String key)

Output only. The context reference updates provided by external systems.

`
map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

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

### containsInitialGeneratorContexts(String key)

    public abstract boolean containsInitialGeneratorContexts(String key)

Output only. A map with generator name as key and generator context as
value.

`
map<string, .google.cloud.dialogflow.v2.Conversation.GeneratorContext> initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

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

### getConversationProfile()

    public abstract String getConversationProfile()

Required. The Conversation Profile to be used to configure this
Conversation. This field cannot be updated.
Format: `projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.

`
string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
`

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

### getConversationProfileBytes()

    public abstract ByteString getConversationProfileBytes()

Required. The Conversation Profile to be used to configure this
Conversation. This field cannot be updated.
Format: `projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.

`
string conversation_profile = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
`

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

### getConversationStage()

    public abstract Conversation.ConversationStage getConversationStage()

Optional. The stage of a conversation. It indicates whether the virtual
agent or a human agent is handling the conversation.

If the conversation is created with the conversation profile that has
Dialogflow config set, defaults to
ConversationStage.VIRTUAL_AGENT_STAGE;
Otherwise, defaults to
ConversationStage.HUMAN_ASSIST_STAGE.

If the conversation is created with the conversation profile that has
Dialogflow config set but explicitly sets conversation_stage to
ConversationStage.HUMAN_ASSIST_STAGE,
it skips
ConversationStage.VIRTUAL_AGENT_STAGE
stage and directly goes to
ConversationStage.HUMAN_ASSIST_STAGE.

`
.google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.ConversationStage` | The conversationStage. |

### getConversationStageValue()

    public abstract int getConversationStageValue()

Optional. The stage of a conversation. It indicates whether the virtual
agent or a human agent is handling the conversation.

If the conversation is created with the conversation profile that has
Dialogflow config set, defaults to
ConversationStage.VIRTUAL_AGENT_STAGE;
Otherwise, defaults to
ConversationStage.HUMAN_ASSIST_STAGE.

If the conversation is created with the conversation profile that has
Dialogflow config set but explicitly sets conversation_stage to
ConversationStage.HUMAN_ASSIST_STAGE,
it skips
ConversationStage.VIRTUAL_AGENT_STAGE
stage and directly goes to
ConversationStage.HUMAN_ASSIST_STAGE.

`
.google.cloud.dialogflow.v2.Conversation.ConversationStage conversation_stage = 7 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for conversationStage. |

### getEndTime()

    public abstract Timestamp getEndTime()

Output only. The time the conversation was finished.

`.google.protobuf.Timestamp end_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 endTime. |

### getEndTimeOrBuilder()

    public abstract TimestampOrBuilder getEndTimeOrBuilder()

Output only. The time the conversation was finished.

`.google.protobuf.Timestamp end_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` |   |

### getIngestedContextReferences() (deprecated)

    public abstract Map<String,Conversation.ContextReference> getIngestedContextReferences()

Use [#getIngestedContextReferencesMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.ConversationOrBuilder#com_google_cloud_dialogflow_v2_ConversationOrBuilder_getIngestedContextReferencesMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.ContextReference>` |   |

### getIngestedContextReferencesCount()

    public abstract int getIngestedContextReferencesCount()

Output only. The context reference updates provided by external systems.

`
map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### getIngestedContextReferencesMap()

    public abstract Map<String,Conversation.ContextReference> getIngestedContextReferencesMap()

Output only. The context reference updates provided by external systems.

`
map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.ContextReference>` |   |

### getIngestedContextReferencesOrDefault(String key, Conversation.ContextReference defaultValue)

    public abstract Conversation.ContextReference getIngestedContextReferencesOrDefault(String key, Conversation.ContextReference defaultValue)

Output only. The context reference updates provided by external systems.

`
map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.ContextReference` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.ContextReference` |   |

### getIngestedContextReferencesOrThrow(String key)

    public abstract Conversation.ContextReference getIngestedContextReferencesOrThrow(String key)

Output only. The context reference updates provided by external systems.

`
map<string, .google.cloud.dialogflow.v2.Conversation.ContextReference> ingested_context_references = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.ContextReference` |   |

### getInitialConversationProfile()

    public abstract ConversationProfile getInitialConversationProfile()

Optional. Output only. The initial conversation profile to be used to
configure this conversation, which is a copy of the conversation profile
config read at conversation creation time.

`
.google.cloud.dialogflow.v2.ConversationProfile initial_conversation_profile = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.ConversationProfile` | The initialConversationProfile. |

### getInitialConversationProfileOrBuilder()

    public abstract ConversationProfileOrBuilder getInitialConversationProfileOrBuilder()

Optional. Output only. The initial conversation profile to be used to
configure this conversation, which is a copy of the conversation profile
config read at conversation creation time.

`
.google.cloud.dialogflow.v2.ConversationProfile initial_conversation_profile = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.ConversationProfileOrBuilder` |   |

### getInitialGeneratorContexts() (deprecated)

    public abstract Map<String,Conversation.GeneratorContext> getInitialGeneratorContexts()

Use [#getInitialGeneratorContextsMap()](https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.ConversationOrBuilder#com_google_cloud_dialogflow_v2_ConversationOrBuilder_getInitialGeneratorContextsMap__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.GeneratorContext>` |   |

### getInitialGeneratorContextsCount()

    public abstract int getInitialGeneratorContextsCount()

Output only. A map with generator name as key and generator context as
value.

`
map<string, .google.cloud.dialogflow.v2.Conversation.GeneratorContext> initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### getInitialGeneratorContextsMap()

    public abstract Map<String,Conversation.GeneratorContext> getInitialGeneratorContextsMap()

Output only. A map with generator name as key and generator context as
value.

`
map<string, .google.cloud.dialogflow.v2.Conversation.GeneratorContext> initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.GeneratorContext>` |   |

### getInitialGeneratorContextsOrDefault(String key, Conversation.GeneratorContext defaultValue)

    public abstract Conversation.GeneratorContext getInitialGeneratorContextsOrDefault(String key, Conversation.GeneratorContext defaultValue)

Output only. A map with generator name as key and generator context as
value.

`
map<string, .google.cloud.dialogflow.v2.Conversation.GeneratorContext> initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `defaultValue` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.GeneratorContext` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.GeneratorContext` |   |

### getInitialGeneratorContextsOrThrow(String key)

    public abstract Conversation.GeneratorContext getInitialGeneratorContextsOrThrow(String key)

Output only. A map with generator name as key and generator context as
value.

`
map<string, .google.cloud.dialogflow.v2.Conversation.GeneratorContext> initial_generator_contexts = 18 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `key` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.GeneratorContext` |   |

### getLifecycleState()

    public abstract Conversation.LifecycleState getLifecycleState()

Output only. The current state of the Conversation.

`
.google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.LifecycleState` | The lifecycleState. |

### getLifecycleStateValue()

    public abstract int getLifecycleStateValue()

Output only. The current state of the Conversation.

`
.google.cloud.dialogflow.v2.Conversation.LifecycleState lifecycle_state = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for lifecycleState. |

### getName()

    public abstract String getName()

Output only. Identifier. The unique identifier of this conversation.
Format: `projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>`.

`
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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()

Output only. Identifier. The unique identifier of this conversation.
Format: `projects/<Project ID>/locations/<Location
ID>/conversations/<Conversation ID>`.

`
string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.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. |

### getPhoneNumber()

    public abstract ConversationPhoneNumber getPhoneNumber()

Output only. It will not be empty if the conversation is to be connected
over telephony.

`
.google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.ConversationPhoneNumber` | The phoneNumber. |

### getPhoneNumberOrBuilder()

    public abstract ConversationPhoneNumberOrBuilder getPhoneNumberOrBuilder()

Output only. It will not be empty if the conversation is to be connected
over telephony.

`
.google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.ConversationPhoneNumberOrBuilder` |   |

### getStartTime()

    public abstract Timestamp getStartTime()

Output only. The time the conversation was started.

`.google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### getStartTimeOrBuilder()

    public abstract TimestampOrBuilder getStartTimeOrBuilder()

Output only. The time the conversation was started.

`.google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### getTelephonyConnectionInfo()

    public abstract Conversation.TelephonyConnectionInfo getTelephonyConnectionInfo()

Output only. The telephony connection information.

`
.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo` | The telephonyConnectionInfo. |

### getTelephonyConnectionInfoOrBuilder()

    public abstract Conversation.TelephonyConnectionInfoOrBuilder getTelephonyConnectionInfoOrBuilder()

Output only. The telephony connection information.

`
.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-dialogflow/latest/com.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfoOrBuilder` |   |

### hasEndTime()

    public abstract boolean hasEndTime()

Output only. The time the conversation was finished.

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

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

### hasInitialConversationProfile()

    public abstract boolean hasInitialConversationProfile()

Optional. Output only. The initial conversation profile to be used to
configure this conversation, which is a copy of the conversation profile
config read at conversation creation time.

`
.google.cloud.dialogflow.v2.ConversationProfile initial_conversation_profile = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### hasPhoneNumber()

    public abstract boolean hasPhoneNumber()

Output only. It will not be empty if the conversation is to be connected
over telephony.

`
.google.cloud.dialogflow.v2.ConversationPhoneNumber phone_number = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### hasStartTime()

    public abstract boolean hasStartTime()

Output only. The time the conversation was started.

`.google.protobuf.Timestamp start_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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

### hasTelephonyConnectionInfo()

    public abstract boolean hasTelephonyConnectionInfo()

Output only. The telephony connection information.

`
.google.cloud.dialogflow.v2.Conversation.TelephonyConnectionInfo telephony_connection_info = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
`

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