com.amazonaws.services.ecs.model.ExecuteCommandResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ecs Show documentation
/*
* Copyright 2018-2023 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.ecs.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ExecuteCommandResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the cluster.
*
*/
private String clusterArn;
/**
*
* The Amazon Resource Name (ARN) of the container.
*
*/
private String containerArn;
/**
*
* The name of the container.
*
*/
private String containerName;
/**
*
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*
*/
private Boolean interactive;
/**
*
* The details of the SSM session that was created for this instance of execute-command.
*
*/
private Session session;
/**
*
* The Amazon Resource Name (ARN) of the task.
*
*/
private String taskArn;
/**
*
* The Amazon Resource Name (ARN) of the cluster.
*
*
* @param clusterArn
* The Amazon Resource Name (ARN) of the cluster.
*/
public void setClusterArn(String clusterArn) {
this.clusterArn = clusterArn;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster.
*
*
* @return The Amazon Resource Name (ARN) of the cluster.
*/
public String getClusterArn() {
return this.clusterArn;
}
/**
*
* The Amazon Resource Name (ARN) of the cluster.
*
*
* @param clusterArn
* The Amazon Resource Name (ARN) of the cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExecuteCommandResult withClusterArn(String clusterArn) {
setClusterArn(clusterArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the container.
*
*
* @param containerArn
* The Amazon Resource Name (ARN) of the container.
*/
public void setContainerArn(String containerArn) {
this.containerArn = containerArn;
}
/**
*
* The Amazon Resource Name (ARN) of the container.
*
*
* @return The Amazon Resource Name (ARN) of the container.
*/
public String getContainerArn() {
return this.containerArn;
}
/**
*
* The Amazon Resource Name (ARN) of the container.
*
*
* @param containerArn
* The Amazon Resource Name (ARN) of the container.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExecuteCommandResult withContainerArn(String containerArn) {
setContainerArn(containerArn);
return this;
}
/**
*
* The name of the container.
*
*
* @param containerName
* The name of the container.
*/
public void setContainerName(String containerName) {
this.containerName = containerName;
}
/**
*
* The name of the container.
*
*
* @return The name of the container.
*/
public String getContainerName() {
return this.containerName;
}
/**
*
* The name of the container.
*
*
* @param containerName
* The name of the container.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExecuteCommandResult withContainerName(String containerName) {
setContainerName(containerName);
return this;
}
/**
*
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*
*
* @param interactive
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*/
public void setInteractive(Boolean interactive) {
this.interactive = interactive;
}
/**
*
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*
*
* @return Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*/
public Boolean getInteractive() {
return this.interactive;
}
/**
*
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*
*
* @param interactive
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExecuteCommandResult withInteractive(Boolean interactive) {
setInteractive(interactive);
return this;
}
/**
*
* Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*
*
* @return Determines whether the execute command session is running in interactive mode. Amazon ECS only supports
* initiating interactive sessions, so you must specify true
for this value.
*/
public Boolean isInteractive() {
return this.interactive;
}
/**
*
* The details of the SSM session that was created for this instance of execute-command.
*
*
* @param session
* The details of the SSM session that was created for this instance of execute-command.
*/
public void setSession(Session session) {
this.session = session;
}
/**
*
* The details of the SSM session that was created for this instance of execute-command.
*
*
* @return The details of the SSM session that was created for this instance of execute-command.
*/
public Session getSession() {
return this.session;
}
/**
*
* The details of the SSM session that was created for this instance of execute-command.
*
*
* @param session
* The details of the SSM session that was created for this instance of execute-command.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExecuteCommandResult withSession(Session session) {
setSession(session);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the task.
*
*
* @param taskArn
* The Amazon Resource Name (ARN) of the task.
*/
public void setTaskArn(String taskArn) {
this.taskArn = taskArn;
}
/**
*
* The Amazon Resource Name (ARN) of the task.
*
*
* @return The Amazon Resource Name (ARN) of the task.
*/
public String getTaskArn() {
return this.taskArn;
}
/**
*
* The Amazon Resource Name (ARN) of the task.
*
*
* @param taskArn
* The Amazon Resource Name (ARN) of the task.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ExecuteCommandResult withTaskArn(String taskArn) {
setTaskArn(taskArn);
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 (getClusterArn() != null)
sb.append("ClusterArn: ").append(getClusterArn()).append(",");
if (getContainerArn() != null)
sb.append("ContainerArn: ").append(getContainerArn()).append(",");
if (getContainerName() != null)
sb.append("ContainerName: ").append(getContainerName()).append(",");
if (getInteractive() != null)
sb.append("Interactive: ").append(getInteractive()).append(",");
if (getSession() != null)
sb.append("Session: ").append(getSession()).append(",");
if (getTaskArn() != null)
sb.append("TaskArn: ").append(getTaskArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ExecuteCommandResult == false)
return false;
ExecuteCommandResult other = (ExecuteCommandResult) obj;
if (other.getClusterArn() == null ^ this.getClusterArn() == null)
return false;
if (other.getClusterArn() != null && other.getClusterArn().equals(this.getClusterArn()) == false)
return false;
if (other.getContainerArn() == null ^ this.getContainerArn() == null)
return false;
if (other.getContainerArn() != null && other.getContainerArn().equals(this.getContainerArn()) == false)
return false;
if (other.getContainerName() == null ^ this.getContainerName() == null)
return false;
if (other.getContainerName() != null && other.getContainerName().equals(this.getContainerName()) == false)
return false;
if (other.getInteractive() == null ^ this.getInteractive() == null)
return false;
if (other.getInteractive() != null && other.getInteractive().equals(this.getInteractive()) == false)
return false;
if (other.getSession() == null ^ this.getSession() == null)
return false;
if (other.getSession() != null && other.getSession().equals(this.getSession()) == false)
return false;
if (other.getTaskArn() == null ^ this.getTaskArn() == null)
return false;
if (other.getTaskArn() != null && other.getTaskArn().equals(this.getTaskArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClusterArn() == null) ? 0 : getClusterArn().hashCode());
hashCode = prime * hashCode + ((getContainerArn() == null) ? 0 : getContainerArn().hashCode());
hashCode = prime * hashCode + ((getContainerName() == null) ? 0 : getContainerName().hashCode());
hashCode = prime * hashCode + ((getInteractive() == null) ? 0 : getInteractive().hashCode());
hashCode = prime * hashCode + ((getSession() == null) ? 0 : getSession().hashCode());
hashCode = prime * hashCode + ((getTaskArn() == null) ? 0 : getTaskArn().hashCode());
return hashCode;
}
@Override
public ExecuteCommandResult clone() {
try {
return (ExecuteCommandResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}