com.amazonaws.services.qapps.model.StartQAppSessionRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-qapps Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.qapps.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class StartQAppSessionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The unique identifier of the Amazon Q Business application environment instance.
*
*/
private String instanceId;
/**
*
* The unique identifier of the Q App to start a session for.
*
*/
private String appId;
/**
*
* The version of the Q App to use for the session.
*
*/
private Integer appVersion;
/**
*
* Optional initial input values to provide for the Q App session.
*
*/
private java.util.List initialValues;
/**
*
* Optional tags to associate with the new Q App session.
*
*/
private java.util.Map tags;
/**
*
* The unique identifier of the Amazon Q Business application environment instance.
*
*
* @param instanceId
* The unique identifier of the Amazon Q Business application environment instance.
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
/**
*
* The unique identifier of the Amazon Q Business application environment instance.
*
*
* @return The unique identifier of the Amazon Q Business application environment instance.
*/
public String getInstanceId() {
return this.instanceId;
}
/**
*
* The unique identifier of the Amazon Q Business application environment instance.
*
*
* @param instanceId
* The unique identifier of the Amazon Q Business application environment instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest withInstanceId(String instanceId) {
setInstanceId(instanceId);
return this;
}
/**
*
* The unique identifier of the Q App to start a session for.
*
*
* @param appId
* The unique identifier of the Q App to start a session for.
*/
public void setAppId(String appId) {
this.appId = appId;
}
/**
*
* The unique identifier of the Q App to start a session for.
*
*
* @return The unique identifier of the Q App to start a session for.
*/
public String getAppId() {
return this.appId;
}
/**
*
* The unique identifier of the Q App to start a session for.
*
*
* @param appId
* The unique identifier of the Q App to start a session for.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest withAppId(String appId) {
setAppId(appId);
return this;
}
/**
*
* The version of the Q App to use for the session.
*
*
* @param appVersion
* The version of the Q App to use for the session.
*/
public void setAppVersion(Integer appVersion) {
this.appVersion = appVersion;
}
/**
*
* The version of the Q App to use for the session.
*
*
* @return The version of the Q App to use for the session.
*/
public Integer getAppVersion() {
return this.appVersion;
}
/**
*
* The version of the Q App to use for the session.
*
*
* @param appVersion
* The version of the Q App to use for the session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest withAppVersion(Integer appVersion) {
setAppVersion(appVersion);
return this;
}
/**
*
* Optional initial input values to provide for the Q App session.
*
*
* @return Optional initial input values to provide for the Q App session.
*/
public java.util.List getInitialValues() {
return initialValues;
}
/**
*
* Optional initial input values to provide for the Q App session.
*
*
* @param initialValues
* Optional initial input values to provide for the Q App session.
*/
public void setInitialValues(java.util.Collection initialValues) {
if (initialValues == null) {
this.initialValues = null;
return;
}
this.initialValues = new java.util.ArrayList(initialValues);
}
/**
*
* Optional initial input values to provide for the Q App session.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setInitialValues(java.util.Collection)} or {@link #withInitialValues(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param initialValues
* Optional initial input values to provide for the Q App session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest withInitialValues(CardValue... initialValues) {
if (this.initialValues == null) {
setInitialValues(new java.util.ArrayList(initialValues.length));
}
for (CardValue ele : initialValues) {
this.initialValues.add(ele);
}
return this;
}
/**
*
* Optional initial input values to provide for the Q App session.
*
*
* @param initialValues
* Optional initial input values to provide for the Q App session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest withInitialValues(java.util.Collection initialValues) {
setInitialValues(initialValues);
return this;
}
/**
*
* Optional tags to associate with the new Q App session.
*
*
* @return Optional tags to associate with the new Q App session.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* Optional tags to associate with the new Q App session.
*
*
* @param tags
* Optional tags to associate with the new Q App session.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* Optional tags to associate with the new Q App session.
*
*
* @param tags
* Optional tags to associate with the new Q App session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see StartQAppSessionRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartQAppSessionRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getInstanceId() != null)
sb.append("InstanceId: ").append(getInstanceId()).append(",");
if (getAppId() != null)
sb.append("AppId: ").append(getAppId()).append(",");
if (getAppVersion() != null)
sb.append("AppVersion: ").append(getAppVersion()).append(",");
if (getInitialValues() != null)
sb.append("InitialValues: ").append(getInitialValues()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof StartQAppSessionRequest == false)
return false;
StartQAppSessionRequest other = (StartQAppSessionRequest) obj;
if (other.getInstanceId() == null ^ this.getInstanceId() == null)
return false;
if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false)
return false;
if (other.getAppId() == null ^ this.getAppId() == null)
return false;
if (other.getAppId() != null && other.getAppId().equals(this.getAppId()) == false)
return false;
if (other.getAppVersion() == null ^ this.getAppVersion() == null)
return false;
if (other.getAppVersion() != null && other.getAppVersion().equals(this.getAppVersion()) == false)
return false;
if (other.getInitialValues() == null ^ this.getInitialValues() == null)
return false;
if (other.getInitialValues() != null && other.getInitialValues().equals(this.getInitialValues()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
hashCode = prime * hashCode + ((getAppId() == null) ? 0 : getAppId().hashCode());
hashCode = prime * hashCode + ((getAppVersion() == null) ? 0 : getAppVersion().hashCode());
hashCode = prime * hashCode + ((getInitialValues() == null) ? 0 : getInitialValues().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public StartQAppSessionRequest clone() {
return (StartQAppSessionRequest) super.clone();
}
}