com.amazonaws.services.codedeploy.model.S3Location Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codedeploy 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.codedeploy.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about the location of application artifacts stored in Amazon S3.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class S3Location implements Serializable, Cloneable, StructuredPojo {
/**
*
* The name of the Amazon S3 bucket where the application revision is stored.
*
*/
private String bucket;
/**
*
* The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*/
private String key;
/**
*
* The file type of the application revision. Must be one of the following:
*
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
*
*/
private String bundleType;
/**
*
* A specific version of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the version is not specified, the system uses the most recent version by default.
*
*/
private String version;
/**
*
* The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
*
*/
private String eTag;
/**
*
* The name of the Amazon S3 bucket where the application revision is stored.
*
*
* @param bucket
* The name of the Amazon S3 bucket where the application revision is stored.
*/
public void setBucket(String bucket) {
this.bucket = bucket;
}
/**
*
* The name of the Amazon S3 bucket where the application revision is stored.
*
*
* @return The name of the Amazon S3 bucket where the application revision is stored.
*/
public String getBucket() {
return this.bucket;
}
/**
*
* The name of the Amazon S3 bucket where the application revision is stored.
*
*
* @param bucket
* The name of the Amazon S3 bucket where the application revision is stored.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3Location withBucket(String bucket) {
setBucket(bucket);
return this;
}
/**
*
* The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* @param key
* The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
*/
public void setKey(String key) {
this.key = key;
}
/**
*
* The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* @return The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
*/
public String getKey() {
return this.key;
}
/**
*
* The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* @param key
* The name of the Amazon S3 object that represents the bundled artifacts for the application revision.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3Location withKey(String key) {
setKey(key);
return this;
}
/**
*
* The file type of the application revision. Must be one of the following:
*
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
*
*
* @param bundleType
* The file type of the application revision. Must be one of the following:
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
* @see BundleType
*/
public void setBundleType(String bundleType) {
this.bundleType = bundleType;
}
/**
*
* The file type of the application revision. Must be one of the following:
*
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
*
*
* @return The file type of the application revision. Must be one of the following:
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
* @see BundleType
*/
public String getBundleType() {
return this.bundleType;
}
/**
*
* The file type of the application revision. Must be one of the following:
*
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
*
*
* @param bundleType
* The file type of the application revision. Must be one of the following:
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see BundleType
*/
public S3Location withBundleType(String bundleType) {
setBundleType(bundleType);
return this;
}
/**
*
* The file type of the application revision. Must be one of the following:
*
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
*
*
* @param bundleType
* The file type of the application revision. Must be one of the following:
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
* @see BundleType
*/
public void setBundleType(BundleType bundleType) {
withBundleType(bundleType);
}
/**
*
* The file type of the application revision. Must be one of the following:
*
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
*
*
* @param bundleType
* The file type of the application revision. Must be one of the following:
*
* -
*
* tar
: A tar archive file.
*
*
* -
*
* tgz
: A compressed tar archive file.
*
*
* -
*
* zip
: A zip archive file.
*
*
* -
*
* YAML
: A YAML-formatted file.
*
*
* -
*
* JSON
: A JSON-formatted file.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see BundleType
*/
public S3Location withBundleType(BundleType bundleType) {
this.bundleType = bundleType.toString();
return this;
}
/**
*
* A specific version of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the version is not specified, the system uses the most recent version by default.
*
*
* @param version
* A specific version of the Amazon S3 object that represents the bundled artifacts for the application
* revision.
*
* If the version is not specified, the system uses the most recent version by default.
*/
public void setVersion(String version) {
this.version = version;
}
/**
*
* A specific version of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the version is not specified, the system uses the most recent version by default.
*
*
* @return A specific version of the Amazon S3 object that represents the bundled artifacts for the application
* revision.
*
* If the version is not specified, the system uses the most recent version by default.
*/
public String getVersion() {
return this.version;
}
/**
*
* A specific version of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the version is not specified, the system uses the most recent version by default.
*
*
* @param version
* A specific version of the Amazon S3 object that represents the bundled artifacts for the application
* revision.
*
* If the version is not specified, the system uses the most recent version by default.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3Location withVersion(String version) {
setVersion(version);
return this;
}
/**
*
* The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
*
*
* @param eTag
* The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
*/
public void setETag(String eTag) {
this.eTag = eTag;
}
/**
*
* The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
*
*
* @return The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
*/
public String getETag() {
return this.eTag;
}
/**
*
* The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
*
*
* @param eTag
* The ETag of the Amazon S3 object that represents the bundled artifacts for the application revision.
*
* If the ETag is not specified as an input parameter, ETag validation of the object is skipped.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public S3Location withETag(String eTag) {
setETag(eTag);
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 (getBucket() != null)
sb.append("Bucket: ").append(getBucket()).append(",");
if (getKey() != null)
sb.append("Key: ").append(getKey()).append(",");
if (getBundleType() != null)
sb.append("BundleType: ").append(getBundleType()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getETag() != null)
sb.append("ETag: ").append(getETag());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof S3Location == false)
return false;
S3Location other = (S3Location) obj;
if (other.getBucket() == null ^ this.getBucket() == null)
return false;
if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == false)
return false;
if (other.getKey() == null ^ this.getKey() == null)
return false;
if (other.getKey() != null && other.getKey().equals(this.getKey()) == false)
return false;
if (other.getBundleType() == null ^ this.getBundleType() == null)
return false;
if (other.getBundleType() != null && other.getBundleType().equals(this.getBundleType()) == false)
return false;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getETag() == null ^ this.getETag() == null)
return false;
if (other.getETag() != null && other.getETag().equals(this.getETag()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode());
hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode());
hashCode = prime * hashCode + ((getBundleType() == null) ? 0 : getBundleType().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getETag() == null) ? 0 : getETag().hashCode());
return hashCode;
}
@Override
public S3Location clone() {
try {
return (S3Location) 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.codedeploy.model.transform.S3LocationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}