com.amazonaws.services.datasync.model.ManifestConfig Maven / Gradle / Ivy
Show all versions of aws-java-sdk-datasync 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.datasync.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Configures a manifest, which is a list of files or objects that you want DataSync to transfer. For more information
* and configuration examples, see Specifying what DataSync
* transfers by using a manifest.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ManifestConfig implements Serializable, Cloneable, StructuredPojo {
/**
*
* Specifies what DataSync uses the manifest for.
*
*/
private String action;
/**
*
* Specifies the file format of your manifest. For more information, see Creating a manifest.
*
*/
private String format;
/**
*
* Specifies the manifest that you want DataSync to use and where it's hosted.
*
*
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're missing
* the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more information, see
* Providing DataSync access to your manifest.
*
*
*/
private SourceManifestConfig source;
/**
*
* Specifies what DataSync uses the manifest for.
*
*
* @param action
* Specifies what DataSync uses the manifest for.
* @see ManifestAction
*/
public void setAction(String action) {
this.action = action;
}
/**
*
* Specifies what DataSync uses the manifest for.
*
*
* @return Specifies what DataSync uses the manifest for.
* @see ManifestAction
*/
public String getAction() {
return this.action;
}
/**
*
* Specifies what DataSync uses the manifest for.
*
*
* @param action
* Specifies what DataSync uses the manifest for.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ManifestAction
*/
public ManifestConfig withAction(String action) {
setAction(action);
return this;
}
/**
*
* Specifies what DataSync uses the manifest for.
*
*
* @param action
* Specifies what DataSync uses the manifest for.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ManifestAction
*/
public ManifestConfig withAction(ManifestAction action) {
this.action = action.toString();
return this;
}
/**
*
* Specifies the file format of your manifest. For more information, see Creating a manifest.
*
*
* @param format
* Specifies the file format of your manifest. For more information, see Creating a manifest.
* @see ManifestFormat
*/
public void setFormat(String format) {
this.format = format;
}
/**
*
* Specifies the file format of your manifest. For more information, see Creating a manifest.
*
*
* @return Specifies the file format of your manifest. For more information, see Creating a manifest.
* @see ManifestFormat
*/
public String getFormat() {
return this.format;
}
/**
*
* Specifies the file format of your manifest. For more information, see Creating a manifest.
*
*
* @param format
* Specifies the file format of your manifest. For more information, see Creating a manifest.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ManifestFormat
*/
public ManifestConfig withFormat(String format) {
setFormat(format);
return this;
}
/**
*
* Specifies the file format of your manifest. For more information, see Creating a manifest.
*
*
* @param format
* Specifies the file format of your manifest. For more information, see Creating a manifest.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ManifestFormat
*/
public ManifestConfig withFormat(ManifestFormat format) {
this.format = format.toString();
return this;
}
/**
*
* Specifies the manifest that you want DataSync to use and where it's hosted.
*
*
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're missing
* the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more information, see
* Providing DataSync access to your manifest.
*
*
*
* @param source
* Specifies the manifest that you want DataSync to use and where it's hosted.
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're
* missing the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more
* information, see Providing DataSync access to your manifest.
*
*/
public void setSource(SourceManifestConfig source) {
this.source = source;
}
/**
*
* Specifies the manifest that you want DataSync to use and where it's hosted.
*
*
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're missing
* the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more information, see
* Providing DataSync access to your manifest.
*
*
*
* @return Specifies the manifest that you want DataSync to use and where it's hosted.
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're
* missing the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more
* information, see Providing DataSync access to your manifest.
*
*/
public SourceManifestConfig getSource() {
return this.source;
}
/**
*
* Specifies the manifest that you want DataSync to use and where it's hosted.
*
*
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're missing
* the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more information, see
* Providing DataSync access to your manifest.
*
*
*
* @param source
* Specifies the manifest that you want DataSync to use and where it's hosted.
*
* You must specify this parameter if you're configuring a new manifest on or after February 7, 2024.
*
*
* If you don't, you'll get a 400 status code and ValidationException
error stating that you're
* missing the IAM role for DataSync to access the S3 bucket where you're hosting your manifest. For more
* information, see Providing DataSync access to your manifest.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ManifestConfig withSource(SourceManifestConfig source) {
setSource(source);
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 (getAction() != null)
sb.append("Action: ").append(getAction()).append(",");
if (getFormat() != null)
sb.append("Format: ").append(getFormat()).append(",");
if (getSource() != null)
sb.append("Source: ").append(getSource());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ManifestConfig == false)
return false;
ManifestConfig other = (ManifestConfig) obj;
if (other.getAction() == null ^ this.getAction() == null)
return false;
if (other.getAction() != null && other.getAction().equals(this.getAction()) == false)
return false;
if (other.getFormat() == null ^ this.getFormat() == null)
return false;
if (other.getFormat() != null && other.getFormat().equals(this.getFormat()) == false)
return false;
if (other.getSource() == null ^ this.getSource() == null)
return false;
if (other.getSource() != null && other.getSource().equals(this.getSource()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAction() == null) ? 0 : getAction().hashCode());
hashCode = prime * hashCode + ((getFormat() == null) ? 0 : getFormat().hashCode());
hashCode = prime * hashCode + ((getSource() == null) ? 0 : getSource().hashCode());
return hashCode;
}
@Override
public ManifestConfig clone() {
try {
return (ManifestConfig) 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.datasync.model.transform.ManifestConfigMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}