This commit is contained in:
2026-02-19 17:50:14 +00:00
parent da95a64fb7
commit 6f629c53a6
171 changed files with 7281 additions and 1144 deletions

View File

@@ -0,0 +1,34 @@
/*
* 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.conversation;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@JsonIgnoreProperties(ignoreUnknown = true)
public record QueryParamsDTO(
@JsonProperty("parameters") Map<String, Object> parameters) {
public QueryParamsDTO {
parameters = Objects.requireNonNullElseGet(parameters, HashMap::new);
parameters = new HashMap<>(parameters);
}
public QueryParamsDTO withSessionParameter(String key, Object value) {
Map<String, Object> updatedParams = new HashMap<>(this.parameters());
updatedParams.put(key, value);
return new QueryParamsDTO(updatedParams);
}
public QueryParamsDTO withSessionParameters(Map<String, Object> parameters) {
Map<String, Object> updatedParams = new HashMap<>(this.parameters());
updatedParams.putAll(parameters);
return new QueryParamsDTO(updatedParams);
}
}