
com.amazonaws.services.accessanalyzer.model.JobDetails 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.accessanalyzer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains details about the policy generation request.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class JobDetails implements Serializable, Cloneable, StructuredPojo {
/**
*
* The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or used
* with CancelPolicyGeneration
to cancel the policy generation request.
*
*/
private String jobId;
/**
*
* The status of the job request.
*
*/
private String status;
/**
*
* A timestamp of when the job was started.
*
*/
private java.util.Date startedOn;
/**
*
* A timestamp of when the job was completed.
*
*/
private java.util.Date completedOn;
/**
*
* The job error for the policy generation request.
*
*/
private JobError jobError;
/**
*
* The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or used
* with CancelPolicyGeneration
to cancel the policy generation request.
*
*
* @param jobId
* The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or
* used with CancelPolicyGeneration
to cancel the policy generation request.
*/
public void setJobId(String jobId) {
this.jobId = jobId;
}
/**
*
* The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or used
* with CancelPolicyGeneration
to cancel the policy generation request.
*
*
* @return The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or
* used with CancelPolicyGeneration
to cancel the policy generation request.
*/
public String getJobId() {
return this.jobId;
}
/**
*
* The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or used
* with CancelPolicyGeneration
to cancel the policy generation request.
*
*
* @param jobId
* The JobId
that is returned by the StartPolicyGeneration
operation. The
* JobId
can be used with GetGeneratedPolicy
to retrieve the generated policies or
* used with CancelPolicyGeneration
to cancel the policy generation request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobDetails withJobId(String jobId) {
setJobId(jobId);
return this;
}
/**
*
* The status of the job request.
*
*
* @param status
* The status of the job request.
* @see JobStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the job request.
*
*
* @return The status of the job request.
* @see JobStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the job request.
*
*
* @param status
* The status of the job request.
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobStatus
*/
public JobDetails withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the job request.
*
*
* @param status
* The status of the job request.
* @return Returns a reference to this object so that method calls can be chained together.
* @see JobStatus
*/
public JobDetails withStatus(JobStatus status) {
this.status = status.toString();
return this;
}
/**
*
* A timestamp of when the job was started.
*
*
* @param startedOn
* A timestamp of when the job was started.
*/
public void setStartedOn(java.util.Date startedOn) {
this.startedOn = startedOn;
}
/**
*
* A timestamp of when the job was started.
*
*
* @return A timestamp of when the job was started.
*/
public java.util.Date getStartedOn() {
return this.startedOn;
}
/**
*
* A timestamp of when the job was started.
*
*
* @param startedOn
* A timestamp of when the job was started.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobDetails withStartedOn(java.util.Date startedOn) {
setStartedOn(startedOn);
return this;
}
/**
*
* A timestamp of when the job was completed.
*
*
* @param completedOn
* A timestamp of when the job was completed.
*/
public void setCompletedOn(java.util.Date completedOn) {
this.completedOn = completedOn;
}
/**
*
* A timestamp of when the job was completed.
*
*
* @return A timestamp of when the job was completed.
*/
public java.util.Date getCompletedOn() {
return this.completedOn;
}
/**
*
* A timestamp of when the job was completed.
*
*
* @param completedOn
* A timestamp of when the job was completed.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobDetails withCompletedOn(java.util.Date completedOn) {
setCompletedOn(completedOn);
return this;
}
/**
*
* The job error for the policy generation request.
*
*
* @param jobError
* The job error for the policy generation request.
*/
public void setJobError(JobError jobError) {
this.jobError = jobError;
}
/**
*
* The job error for the policy generation request.
*
*
* @return The job error for the policy generation request.
*/
public JobError getJobError() {
return this.jobError;
}
/**
*
* The job error for the policy generation request.
*
*
* @param jobError
* The job error for the policy generation request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public JobDetails withJobError(JobError jobError) {
setJobError(jobError);
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 (getJobId() != null)
sb.append("JobId: ").append(getJobId()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getStartedOn() != null)
sb.append("StartedOn: ").append(getStartedOn()).append(",");
if (getCompletedOn() != null)
sb.append("CompletedOn: ").append(getCompletedOn()).append(",");
if (getJobError() != null)
sb.append("JobError: ").append(getJobError());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof JobDetails == false)
return false;
JobDetails other = (JobDetails) obj;
if (other.getJobId() == null ^ this.getJobId() == null)
return false;
if (other.getJobId() != null && other.getJobId().equals(this.getJobId()) == 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.getStartedOn() == null ^ this.getStartedOn() == null)
return false;
if (other.getStartedOn() != null && other.getStartedOn().equals(this.getStartedOn()) == false)
return false;
if (other.getCompletedOn() == null ^ this.getCompletedOn() == null)
return false;
if (other.getCompletedOn() != null && other.getCompletedOn().equals(this.getCompletedOn()) == false)
return false;
if (other.getJobError() == null ^ this.getJobError() == null)
return false;
if (other.getJobError() != null && other.getJobError().equals(this.getJobError()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getJobId() == null) ? 0 : getJobId().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getStartedOn() == null) ? 0 : getStartedOn().hashCode());
hashCode = prime * hashCode + ((getCompletedOn() == null) ? 0 : getCompletedOn().hashCode());
hashCode = prime * hashCode + ((getJobError() == null) ? 0 : getJobError().hashCode());
return hashCode;
}
@Override
public JobDetails clone() {
try {
return (JobDetails) 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.accessanalyzer.model.transform.JobDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}