com.amazonaws.services.ssmsap.model.OperationEvent Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ssmsap 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.ssmsap.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* An operation event returns details for an operation, including key milestones which can be used to monitor and track
* operations in progress.
*
*
* Operation events contain:
*
*
* -
*
* Description string
*
*
* -
*
* Resource, including its ARN and type
*
*
* -
*
* Status
*
*
* -
*
* StatusMessage string
*
*
* -
*
* TimeStamp
*
*
*
*
* Operation event examples include StartApplication or StopApplication.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OperationEvent implements Serializable, Cloneable, StructuredPojo {
/**
*
* A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
*
*/
private String description;
/**
*
* The resource involved in the operations event.
*
*
* Contains ResourceArn
ARN and ResourceType
.
*
*/
private Resource resource;
/**
*
* The status of the operation event. The possible statuses are: IN_PROGRESS
, COMPLETED
,
* and FAILED
.
*
*/
private String status;
/**
*
* The status message relating to a specific operation event.
*
*/
private String statusMessage;
/**
*
* The timestamp of the specified operation event.
*
*/
private java.util.Date timestamp;
/**
*
* A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
*
*
* @param description
* A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
*
*
* @return A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
*/
public String getDescription() {
return this.description;
}
/**
*
* A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
*
*
* @param description
* A description of the operation event. For example, "Stop the EC2 instance i-abcdefgh987654321".
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperationEvent withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The resource involved in the operations event.
*
*
* Contains ResourceArn
ARN and ResourceType
.
*
*
* @param resource
* The resource involved in the operations event.
*
* Contains ResourceArn
ARN and ResourceType
.
*/
public void setResource(Resource resource) {
this.resource = resource;
}
/**
*
* The resource involved in the operations event.
*
*
* Contains ResourceArn
ARN and ResourceType
.
*
*
* @return The resource involved in the operations event.
*
* Contains ResourceArn
ARN and ResourceType
.
*/
public Resource getResource() {
return this.resource;
}
/**
*
* The resource involved in the operations event.
*
*
* Contains ResourceArn
ARN and ResourceType
.
*
*
* @param resource
* The resource involved in the operations event.
*
* Contains ResourceArn
ARN and ResourceType
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperationEvent withResource(Resource resource) {
setResource(resource);
return this;
}
/**
*
* The status of the operation event. The possible statuses are: IN_PROGRESS
, COMPLETED
,
* and FAILED
.
*
*
* @param status
* The status of the operation event. The possible statuses are: IN_PROGRESS
,
* COMPLETED
, and FAILED
.
* @see OperationEventStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the operation event. The possible statuses are: IN_PROGRESS
, COMPLETED
,
* and FAILED
.
*
*
* @return The status of the operation event. The possible statuses are: IN_PROGRESS
,
* COMPLETED
, and FAILED
.
* @see OperationEventStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the operation event. The possible statuses are: IN_PROGRESS
, COMPLETED
,
* and FAILED
.
*
*
* @param status
* The status of the operation event. The possible statuses are: IN_PROGRESS
,
* COMPLETED
, and FAILED
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OperationEventStatus
*/
public OperationEvent withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the operation event. The possible statuses are: IN_PROGRESS
, COMPLETED
,
* and FAILED
.
*
*
* @param status
* The status of the operation event. The possible statuses are: IN_PROGRESS
,
* COMPLETED
, and FAILED
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OperationEventStatus
*/
public OperationEvent withStatus(OperationEventStatus status) {
this.status = status.toString();
return this;
}
/**
*
* The status message relating to a specific operation event.
*
*
* @param statusMessage
* The status message relating to a specific operation event.
*/
public void setStatusMessage(String statusMessage) {
this.statusMessage = statusMessage;
}
/**
*
* The status message relating to a specific operation event.
*
*
* @return The status message relating to a specific operation event.
*/
public String getStatusMessage() {
return this.statusMessage;
}
/**
*
* The status message relating to a specific operation event.
*
*
* @param statusMessage
* The status message relating to a specific operation event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperationEvent withStatusMessage(String statusMessage) {
setStatusMessage(statusMessage);
return this;
}
/**
*
* The timestamp of the specified operation event.
*
*
* @param timestamp
* The timestamp of the specified operation event.
*/
public void setTimestamp(java.util.Date timestamp) {
this.timestamp = timestamp;
}
/**
*
* The timestamp of the specified operation event.
*
*
* @return The timestamp of the specified operation event.
*/
public java.util.Date getTimestamp() {
return this.timestamp;
}
/**
*
* The timestamp of the specified operation event.
*
*
* @param timestamp
* The timestamp of the specified operation event.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OperationEvent withTimestamp(java.util.Date timestamp) {
setTimestamp(timestamp);
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 (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getResource() != null)
sb.append("Resource: ").append(getResource()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getStatusMessage() != null)
sb.append("StatusMessage: ").append(getStatusMessage()).append(",");
if (getTimestamp() != null)
sb.append("Timestamp: ").append(getTimestamp());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OperationEvent == false)
return false;
OperationEvent other = (OperationEvent) obj;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getResource() == null ^ this.getResource() == null)
return false;
if (other.getResource() != null && other.getResource().equals(this.getResource()) == false)
return false;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getStatusMessage() == null ^ this.getStatusMessage() == null)
return false;
if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false)
return false;
if (other.getTimestamp() == null ^ this.getTimestamp() == null)
return false;
if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getResource() == null) ? 0 : getResource().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode());
hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode());
return hashCode;
}
@Override
public OperationEvent clone() {
try {
return (OperationEvent) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.ssmsap.model.transform.OperationEventMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}