com.amazonaws.services.simplesystemsmanagement.model.StartSessionRequest Maven / Gradle / Ivy
/*
* 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.simplesystemsmanagement.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 StartSessionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The managed node to connect to for the session.
*
*/
private String target;
/**
*
* The name of the SSM document you want to use to define the type of session, input parameters, or preferences for
* the session. For example, SSM-SessionManagerRunShell
. You can call the GetDocument API to
* verify the document exists before attempting to start a session. If no document name is provided, a shell to the
* managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
*
*/
private String documentName;
/**
*
* The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events
* event created when you start the session.
*
*/
private String reason;
/**
*
* The values you want to specify for the parameters defined in the Session document.
*
*/
private java.util.Map> parameters;
/**
*
* The managed node to connect to for the session.
*
*
* @param target
* The managed node to connect to for the session.
*/
public void setTarget(String target) {
this.target = target;
}
/**
*
* The managed node to connect to for the session.
*
*
* @return The managed node to connect to for the session.
*/
public String getTarget() {
return this.target;
}
/**
*
* The managed node to connect to for the session.
*
*
* @param target
* The managed node to connect to for the session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSessionRequest withTarget(String target) {
setTarget(target);
return this;
}
/**
*
* The name of the SSM document you want to use to define the type of session, input parameters, or preferences for
* the session. For example, SSM-SessionManagerRunShell
. You can call the GetDocument API to
* verify the document exists before attempting to start a session. If no document name is provided, a shell to the
* managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
*
*
* @param documentName
* The name of the SSM document you want to use to define the type of session, input parameters, or
* preferences for the session. For example, SSM-SessionManagerRunShell
. You can call the
* GetDocument API to verify the document exists before attempting to start a session. If no document
* name is provided, a shell to the managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
*/
public void setDocumentName(String documentName) {
this.documentName = documentName;
}
/**
*
* The name of the SSM document you want to use to define the type of session, input parameters, or preferences for
* the session. For example, SSM-SessionManagerRunShell
. You can call the GetDocument API to
* verify the document exists before attempting to start a session. If no document name is provided, a shell to the
* managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
*
*
* @return The name of the SSM document you want to use to define the type of session, input parameters, or
* preferences for the session. For example, SSM-SessionManagerRunShell
. You can call the
* GetDocument API to verify the document exists before attempting to start a session. If no document
* name is provided, a shell to the managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
*/
public String getDocumentName() {
return this.documentName;
}
/**
*
* The name of the SSM document you want to use to define the type of session, input parameters, or preferences for
* the session. For example, SSM-SessionManagerRunShell
. You can call the GetDocument API to
* verify the document exists before attempting to start a session. If no document name is provided, a shell to the
* managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
*
*
* @param documentName
* The name of the SSM document you want to use to define the type of session, input parameters, or
* preferences for the session. For example, SSM-SessionManagerRunShell
. You can call the
* GetDocument API to verify the document exists before attempting to start a session. If no document
* name is provided, a shell to the managed node is launched by default. For more information, see Start a session in the Amazon Web Services Systems Manager User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSessionRequest withDocumentName(String documentName) {
setDocumentName(documentName);
return this;
}
/**
*
* The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events
* event created when you start the session.
*
*
* @param reason
* The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch
* Events event created when you start the session.
*/
public void setReason(String reason) {
this.reason = reason;
}
/**
*
* The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events
* event created when you start the session.
*
*
* @return The reason for connecting to the instance. This value is included in the details for the Amazon
* CloudWatch Events event created when you start the session.
*/
public String getReason() {
return this.reason;
}
/**
*
* The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events
* event created when you start the session.
*
*
* @param reason
* The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch
* Events event created when you start the session.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSessionRequest withReason(String reason) {
setReason(reason);
return this;
}
/**
*
* The values you want to specify for the parameters defined in the Session document.
*
*
* @return The values you want to specify for the parameters defined in the Session document.
*/
public java.util.Map> getParameters() {
return parameters;
}
/**
*
* The values you want to specify for the parameters defined in the Session document.
*
*
* @param parameters
* The values you want to specify for the parameters defined in the Session document.
*/
public void setParameters(java.util.Map> parameters) {
this.parameters = parameters;
}
/**
*
* The values you want to specify for the parameters defined in the Session document.
*
*
* @param parameters
* The values you want to specify for the parameters defined in the Session document.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSessionRequest withParameters(java.util.Map> parameters) {
setParameters(parameters);
return this;
}
/**
* Add a single Parameters entry
*
* @see StartSessionRequest#withParameters
* @returns a reference to this object so that method calls can be chained together.
*/
public StartSessionRequest addParametersEntry(String key, java.util.List value) {
if (null == this.parameters) {
this.parameters = new java.util.HashMap>();
}
if (this.parameters.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.parameters.put(key, value);
return this;
}
/**
* Removes all the entries added into Parameters.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public StartSessionRequest clearParametersEntries() {
this.parameters = 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 (getTarget() != null)
sb.append("Target: ").append(getTarget()).append(",");
if (getDocumentName() != null)
sb.append("DocumentName: ").append(getDocumentName()).append(",");
if (getReason() != null)
sb.append("Reason: ").append(getReason()).append(",");
if (getParameters() != null)
sb.append("Parameters: ").append(getParameters());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof StartSessionRequest == false)
return false;
StartSessionRequest other = (StartSessionRequest) obj;
if (other.getTarget() == null ^ this.getTarget() == null)
return false;
if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false)
return false;
if (other.getDocumentName() == null ^ this.getDocumentName() == null)
return false;
if (other.getDocumentName() != null && other.getDocumentName().equals(this.getDocumentName()) == false)
return false;
if (other.getReason() == null ^ this.getReason() == null)
return false;
if (other.getReason() != null && other.getReason().equals(this.getReason()) == false)
return false;
if (other.getParameters() == null ^ this.getParameters() == null)
return false;
if (other.getParameters() != null && other.getParameters().equals(this.getParameters()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode());
hashCode = prime * hashCode + ((getDocumentName() == null) ? 0 : getDocumentName().hashCode());
hashCode = prime * hashCode + ((getReason() == null) ? 0 : getReason().hashCode());
hashCode = prime * hashCode + ((getParameters() == null) ? 0 : getParameters().hashCode());
return hashCode;
}
@Override
public StartSessionRequest clone() {
return (StartSessionRequest) super.clone();
}
}