Files
int-layer/src.bak/main/java/com/example/dto/dialogflow/base/DetectIntentRequestDTO.java
2026-02-20 08:42:45 +00:00

40 lines
1.6 KiB
Java

/*
* Copyright 2025 Google. This software is provided as-is, without warranty or representation for any use or purpose.
* Your use of it is subject to your agreement with Google.
*/
package com.example.dto.dialogflow.base;
import com.example.dto.dialogflow.conversation.QueryInputDTO;
import com.example.dto.dialogflow.conversation.QueryParamsDTO;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown = true)
public record DetectIntentRequestDTO(
@JsonProperty("queryInput") QueryInputDTO queryInput,
@JsonProperty("queryParams") QueryParamsDTO queryParams
) {
public DetectIntentRequestDTO withParameter(String key, Object value) {
// Create a new QueryParamsDTO with the updated session parameter
QueryParamsDTO updatedQueryParams = this.queryParams().withSessionParameter(key, value);
// Return a new DetectIntentRequestDTO instance with the updated QueryParamsDTO
return new DetectIntentRequestDTO(
this.queryInput(),
updatedQueryParams
);
}
public DetectIntentRequestDTO withParameters(java.util.Map<String, Object> parameters) {
// Create a new QueryParamsDTO with the updated session parameters
QueryParamsDTO updatedQueryParams = this.queryParams().withSessionParameters(parameters);
// Return a new DetectIntentRequestDTO instance with the updated QueryParamsDTO
return new DetectIntentRequestDTO(
this.queryInput(),
updatedQueryParams
);
}
}