
com.amazonaws.services.imagebuilder.model.LifecycleExecutionResource 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.imagebuilder.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains details for a resource that the runtime instance of the lifecycle policy identified for action.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class LifecycleExecutionResource implements Serializable, Cloneable, StructuredPojo {
/**
*
* The account that owns the impacted resource.
*
*/
private String accountId;
/**
*
* Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
*
*/
private String resourceId;
/**
*
* The runtime state for the lifecycle execution.
*
*/
private LifecycleExecutionResourceState state;
/**
*
* The action to take for the identified resource.
*
*/
private LifecycleExecutionResourceAction action;
/**
*
* The Amazon Web Services Region where the lifecycle execution resource is stored.
*
*/
private String region;
/**
*
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
*
*/
private java.util.List snapshots;
/**
*
* For an impacted container image, this identifies a list of URIs for associated container images distributed to
* ECR repositories.
*
*/
private java.util.List imageUris;
/**
*
* The starting timestamp from the lifecycle action that was applied to the resource.
*
*/
private java.util.Date startTime;
/**
*
* The ending timestamp from the lifecycle action that was applied to the resource.
*
*/
private java.util.Date endTime;
/**
*
* The account that owns the impacted resource.
*
*
* @param accountId
* The account that owns the impacted resource.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* The account that owns the impacted resource.
*
*
* @return The account that owns the impacted resource.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* The account that owns the impacted resource.
*
*
* @param accountId
* The account that owns the impacted resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
*
*
* @param resourceId
* Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
*/
public void setResourceId(String resourceId) {
this.resourceId = resourceId;
}
/**
*
* Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
*
*
* @return Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
*/
public String getResourceId() {
return this.resourceId;
}
/**
*
* Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
*
*
* @param resourceId
* Identifies the impacted resource. The resource ID depends on the type of resource, as follows.
*
* -
*
* Image Builder image resources: Amazon Resource Name (ARN)
*
*
* -
*
* Distributed AMIs: AMI ID
*
*
* -
*
* Container images distributed to an ECR repository: image URI or SHA Digest
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withResourceId(String resourceId) {
setResourceId(resourceId);
return this;
}
/**
*
* The runtime state for the lifecycle execution.
*
*
* @param state
* The runtime state for the lifecycle execution.
*/
public void setState(LifecycleExecutionResourceState state) {
this.state = state;
}
/**
*
* The runtime state for the lifecycle execution.
*
*
* @return The runtime state for the lifecycle execution.
*/
public LifecycleExecutionResourceState getState() {
return this.state;
}
/**
*
* The runtime state for the lifecycle execution.
*
*
* @param state
* The runtime state for the lifecycle execution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withState(LifecycleExecutionResourceState state) {
setState(state);
return this;
}
/**
*
* The action to take for the identified resource.
*
*
* @param action
* The action to take for the identified resource.
*/
public void setAction(LifecycleExecutionResourceAction action) {
this.action = action;
}
/**
*
* The action to take for the identified resource.
*
*
* @return The action to take for the identified resource.
*/
public LifecycleExecutionResourceAction getAction() {
return this.action;
}
/**
*
* The action to take for the identified resource.
*
*
* @param action
* The action to take for the identified resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withAction(LifecycleExecutionResourceAction action) {
setAction(action);
return this;
}
/**
*
* The Amazon Web Services Region where the lifecycle execution resource is stored.
*
*
* @param region
* The Amazon Web Services Region where the lifecycle execution resource is stored.
*/
public void setRegion(String region) {
this.region = region;
}
/**
*
* The Amazon Web Services Region where the lifecycle execution resource is stored.
*
*
* @return The Amazon Web Services Region where the lifecycle execution resource is stored.
*/
public String getRegion() {
return this.region;
}
/**
*
* The Amazon Web Services Region where the lifecycle execution resource is stored.
*
*
* @param region
* The Amazon Web Services Region where the lifecycle execution resource is stored.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withRegion(String region) {
setRegion(region);
return this;
}
/**
*
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
*
*
* @return A list of associated resource snapshots for the impacted resource if it’s an AMI.
*/
public java.util.List getSnapshots() {
return snapshots;
}
/**
*
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
*
*
* @param snapshots
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
*/
public void setSnapshots(java.util.Collection snapshots) {
if (snapshots == null) {
this.snapshots = null;
return;
}
this.snapshots = new java.util.ArrayList(snapshots);
}
/**
*
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setSnapshots(java.util.Collection)} or {@link #withSnapshots(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param snapshots
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withSnapshots(LifecycleExecutionSnapshotResource... snapshots) {
if (this.snapshots == null) {
setSnapshots(new java.util.ArrayList(snapshots.length));
}
for (LifecycleExecutionSnapshotResource ele : snapshots) {
this.snapshots.add(ele);
}
return this;
}
/**
*
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
*
*
* @param snapshots
* A list of associated resource snapshots for the impacted resource if it’s an AMI.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withSnapshots(java.util.Collection snapshots) {
setSnapshots(snapshots);
return this;
}
/**
*
* For an impacted container image, this identifies a list of URIs for associated container images distributed to
* ECR repositories.
*
*
* @return For an impacted container image, this identifies a list of URIs for associated container images
* distributed to ECR repositories.
*/
public java.util.List getImageUris() {
return imageUris;
}
/**
*
* For an impacted container image, this identifies a list of URIs for associated container images distributed to
* ECR repositories.
*
*
* @param imageUris
* For an impacted container image, this identifies a list of URIs for associated container images
* distributed to ECR repositories.
*/
public void setImageUris(java.util.Collection imageUris) {
if (imageUris == null) {
this.imageUris = null;
return;
}
this.imageUris = new java.util.ArrayList(imageUris);
}
/**
*
* For an impacted container image, this identifies a list of URIs for associated container images distributed to
* ECR repositories.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setImageUris(java.util.Collection)} or {@link #withImageUris(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param imageUris
* For an impacted container image, this identifies a list of URIs for associated container images
* distributed to ECR repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withImageUris(String... imageUris) {
if (this.imageUris == null) {
setImageUris(new java.util.ArrayList(imageUris.length));
}
for (String ele : imageUris) {
this.imageUris.add(ele);
}
return this;
}
/**
*
* For an impacted container image, this identifies a list of URIs for associated container images distributed to
* ECR repositories.
*
*
* @param imageUris
* For an impacted container image, this identifies a list of URIs for associated container images
* distributed to ECR repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withImageUris(java.util.Collection imageUris) {
setImageUris(imageUris);
return this;
}
/**
*
* The starting timestamp from the lifecycle action that was applied to the resource.
*
*
* @param startTime
* The starting timestamp from the lifecycle action that was applied to the resource.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The starting timestamp from the lifecycle action that was applied to the resource.
*
*
* @return The starting timestamp from the lifecycle action that was applied to the resource.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The starting timestamp from the lifecycle action that was applied to the resource.
*
*
* @param startTime
* The starting timestamp from the lifecycle action that was applied to the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The ending timestamp from the lifecycle action that was applied to the resource.
*
*
* @param endTime
* The ending timestamp from the lifecycle action that was applied to the resource.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The ending timestamp from the lifecycle action that was applied to the resource.
*
*
* @return The ending timestamp from the lifecycle action that was applied to the resource.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The ending timestamp from the lifecycle action that was applied to the resource.
*
*
* @param endTime
* The ending timestamp from the lifecycle action that was applied to the resource.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public LifecycleExecutionResource withEndTime(java.util.Date endTime) {
setEndTime(endTime);
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 (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getResourceId() != null)
sb.append("ResourceId: ").append(getResourceId()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getAction() != null)
sb.append("Action: ").append(getAction()).append(",");
if (getRegion() != null)
sb.append("Region: ").append(getRegion()).append(",");
if (getSnapshots() != null)
sb.append("Snapshots: ").append(getSnapshots()).append(",");
if (getImageUris() != null)
sb.append("ImageUris: ").append(getImageUris()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof LifecycleExecutionResource == false)
return false;
LifecycleExecutionResource other = (LifecycleExecutionResource) obj;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getResourceId() == null ^ this.getResourceId() == null)
return false;
if (other.getResourceId() != null && other.getResourceId().equals(this.getResourceId()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getAction() == null ^ this.getAction() == null)
return false;
if (other.getAction() != null && other.getAction().equals(this.getAction()) == false)
return false;
if (other.getRegion() == null ^ this.getRegion() == null)
return false;
if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false)
return false;
if (other.getSnapshots() == null ^ this.getSnapshots() == null)
return false;
if (other.getSnapshots() != null && other.getSnapshots().equals(this.getSnapshots()) == false)
return false;
if (other.getImageUris() == null ^ this.getImageUris() == null)
return false;
if (other.getImageUris() != null && other.getImageUris().equals(this.getImageUris()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getResourceId() == null) ? 0 : getResourceId().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode());
hashCode = prime * hashCode + ((getRegion() == null) ? 0 : getRegion().hashCode());
hashCode = prime * hashCode + ((getSnapshots() == null) ? 0 : getSnapshots().hashCode());
hashCode = prime * hashCode + ((getImageUris() == null) ? 0 : getImageUris().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
return hashCode;
}
@Override
public LifecycleExecutionResource clone() {
try {
return (LifecycleExecutionResource) 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.imagebuilder.model.transform.LifecycleExecutionResourceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}