
com.amazonaws.services.codeconnections.model.ResourceSyncAttempt 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.codeconnections.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about a resource sync attempt.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ResourceSyncAttempt implements Serializable, Cloneable, StructuredPojo {
/**
*
* The events related to a resource sync attempt.
*
*/
private java.util.List events;
/**
*
* The current state of the resource as defined in the resource's config-file
in the linked repository.
*
*/
private Revision initialRevision;
/**
*
* The start time for a resource sync attempt.
*
*/
private java.util.Date startedAt;
/**
*
* The status for a resource sync attempt. The follow are valid statuses:
*
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
*
*/
private String status;
/**
*
* The desired state of the resource as defined in the resource's config-file
in the linked repository.
* Git sync attempts to update the resource to this state.
*
*/
private Revision targetRevision;
/**
*
* The name of the Amazon Web Services resource that is attempted to be synchronized.
*
*/
private String target;
/**
*
* The events related to a resource sync attempt.
*
*
* @return The events related to a resource sync attempt.
*/
public java.util.List getEvents() {
return events;
}
/**
*
* The events related to a resource sync attempt.
*
*
* @param events
* The events related to a resource sync attempt.
*/
public void setEvents(java.util.Collection events) {
if (events == null) {
this.events = null;
return;
}
this.events = new java.util.ArrayList(events);
}
/**
*
* The events related to a resource sync attempt.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEvents(java.util.Collection)} or {@link #withEvents(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param events
* The events related to a resource sync attempt.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSyncAttempt withEvents(ResourceSyncEvent... events) {
if (this.events == null) {
setEvents(new java.util.ArrayList(events.length));
}
for (ResourceSyncEvent ele : events) {
this.events.add(ele);
}
return this;
}
/**
*
* The events related to a resource sync attempt.
*
*
* @param events
* The events related to a resource sync attempt.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSyncAttempt withEvents(java.util.Collection events) {
setEvents(events);
return this;
}
/**
*
* The current state of the resource as defined in the resource's config-file
in the linked repository.
*
*
* @param initialRevision
* The current state of the resource as defined in the resource's config-file
in the linked
* repository.
*/
public void setInitialRevision(Revision initialRevision) {
this.initialRevision = initialRevision;
}
/**
*
* The current state of the resource as defined in the resource's config-file
in the linked repository.
*
*
* @return The current state of the resource as defined in the resource's config-file
in the linked
* repository.
*/
public Revision getInitialRevision() {
return this.initialRevision;
}
/**
*
* The current state of the resource as defined in the resource's config-file
in the linked repository.
*
*
* @param initialRevision
* The current state of the resource as defined in the resource's config-file
in the linked
* repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSyncAttempt withInitialRevision(Revision initialRevision) {
setInitialRevision(initialRevision);
return this;
}
/**
*
* The start time for a resource sync attempt.
*
*
* @param startedAt
* The start time for a resource sync attempt.
*/
public void setStartedAt(java.util.Date startedAt) {
this.startedAt = startedAt;
}
/**
*
* The start time for a resource sync attempt.
*
*
* @return The start time for a resource sync attempt.
*/
public java.util.Date getStartedAt() {
return this.startedAt;
}
/**
*
* The start time for a resource sync attempt.
*
*
* @param startedAt
* The start time for a resource sync attempt.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSyncAttempt withStartedAt(java.util.Date startedAt) {
setStartedAt(startedAt);
return this;
}
/**
*
* The status for a resource sync attempt. The follow are valid statuses:
*
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
*
*
* @param status
* The status for a resource sync attempt. The follow are valid statuses:
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
* @see ResourceSyncStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status for a resource sync attempt. The follow are valid statuses:
*
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
*
*
* @return The status for a resource sync attempt. The follow are valid statuses:
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
* @see ResourceSyncStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status for a resource sync attempt. The follow are valid statuses:
*
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
*
*
* @param status
* The status for a resource sync attempt. The follow are valid statuses:
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceSyncStatus
*/
public ResourceSyncAttempt withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status for a resource sync attempt. The follow are valid statuses:
*
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
*
*
* @param status
* The status for a resource sync attempt. The follow are valid statuses:
*
* -
*
* SYNC-INITIATED - A resource sync attempt has been created and will begin soon.
*
*
* -
*
* SYNCING - Syncing has started and work is being done to reconcile state.
*
*
* -
*
* SYNCED - Syncing has completed successfully.
*
*
* -
*
* SYNC_FAILED - A resource sync attempt has failed.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see ResourceSyncStatus
*/
public ResourceSyncAttempt withStatus(ResourceSyncStatus status) {
this.status = status.toString();
return this;
}
/**
*
* The desired state of the resource as defined in the resource's config-file
in the linked repository.
* Git sync attempts to update the resource to this state.
*
*
* @param targetRevision
* The desired state of the resource as defined in the resource's config-file
in the linked
* repository. Git sync attempts to update the resource to this state.
*/
public void setTargetRevision(Revision targetRevision) {
this.targetRevision = targetRevision;
}
/**
*
* The desired state of the resource as defined in the resource's config-file
in the linked repository.
* Git sync attempts to update the resource to this state.
*
*
* @return The desired state of the resource as defined in the resource's config-file
in the linked
* repository. Git sync attempts to update the resource to this state.
*/
public Revision getTargetRevision() {
return this.targetRevision;
}
/**
*
* The desired state of the resource as defined in the resource's config-file
in the linked repository.
* Git sync attempts to update the resource to this state.
*
*
* @param targetRevision
* The desired state of the resource as defined in the resource's config-file
in the linked
* repository. Git sync attempts to update the resource to this state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSyncAttempt withTargetRevision(Revision targetRevision) {
setTargetRevision(targetRevision);
return this;
}
/**
*
* The name of the Amazon Web Services resource that is attempted to be synchronized.
*
*
* @param target
* The name of the Amazon Web Services resource that is attempted to be synchronized.
*/
public void setTarget(String target) {
this.target = target;
}
/**
*
* The name of the Amazon Web Services resource that is attempted to be synchronized.
*
*
* @return The name of the Amazon Web Services resource that is attempted to be synchronized.
*/
public String getTarget() {
return this.target;
}
/**
*
* The name of the Amazon Web Services resource that is attempted to be synchronized.
*
*
* @param target
* The name of the Amazon Web Services resource that is attempted to be synchronized.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ResourceSyncAttempt withTarget(String target) {
setTarget(target);
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 (getEvents() != null)
sb.append("Events: ").append(getEvents()).append(",");
if (getInitialRevision() != null)
sb.append("InitialRevision: ").append(getInitialRevision()).append(",");
if (getStartedAt() != null)
sb.append("StartedAt: ").append(getStartedAt()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getTargetRevision() != null)
sb.append("TargetRevision: ").append(getTargetRevision()).append(",");
if (getTarget() != null)
sb.append("Target: ").append(getTarget());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ResourceSyncAttempt == false)
return false;
ResourceSyncAttempt other = (ResourceSyncAttempt) obj;
if (other.getEvents() == null ^ this.getEvents() == null)
return false;
if (other.getEvents() != null && other.getEvents().equals(this.getEvents()) == false)
return false;
if (other.getInitialRevision() == null ^ this.getInitialRevision() == null)
return false;
if (other.getInitialRevision() != null && other.getInitialRevision().equals(this.getInitialRevision()) == false)
return false;
if (other.getStartedAt() == null ^ this.getStartedAt() == null)
return false;
if (other.getStartedAt() != null && other.getStartedAt().equals(this.getStartedAt()) == 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.getTargetRevision() == null ^ this.getTargetRevision() == null)
return false;
if (other.getTargetRevision() != null && other.getTargetRevision().equals(this.getTargetRevision()) == false)
return false;
if (other.getTarget() == null ^ this.getTarget() == null)
return false;
if (other.getTarget() != null && other.getTarget().equals(this.getTarget()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEvents() == null) ? 0 : getEvents().hashCode());
hashCode = prime * hashCode + ((getInitialRevision() == null) ? 0 : getInitialRevision().hashCode());
hashCode = prime * hashCode + ((getStartedAt() == null) ? 0 : getStartedAt().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getTargetRevision() == null) ? 0 : getTargetRevision().hashCode());
hashCode = prime * hashCode + ((getTarget() == null) ? 0 : getTarget().hashCode());
return hashCode;
}
@Override
public ResourceSyncAttempt clone() {
try {
return (ResourceSyncAttempt) 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.codeconnections.model.transform.ResourceSyncAttemptMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}