com.amazonaws.services.datasync.model.CreateTaskRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-datasync Show documentation
/*
* Copyright 2017-2022 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.AmazonWebServiceRequest;
/**
*
* CreateTaskRequest
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateTaskRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the source location for the task.
*
*/
private String sourceLocationArn;
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
*
*/
private String destinationLocationArn;
/**
*
* The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the
* task.
*
*/
private String cloudWatchLogGroupArn;
/**
*
* The name of a task. This value is a text reference that is used to identify the task in the console.
*
*/
private String name;
/**
*
* The set of configuration options that control the behavior of a single execution of the task that occurs when you
* call StartTaskExecution
. You can configure these options to preserve metadata such as user ID (UID)
* and group ID (GID), file permissions, data integrity verification, and so on.
*
*
* For each individual task execution, you can override these options by specifying the OverrideOptions
* before starting the task execution. For more information, see the StartTaskExecution
* operation.
*
*/
private Options options;
/**
*
* A list of filter rules that determines which files to exclude from a task. The list should contain a single
* filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
*
*/
private java.util.List excludes;
/**
*
* Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule
* should be specified in UTC time. For more information, see Scheduling your task.
*
*/
private TaskSchedule schedule;
/**
*
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
*
*/
private java.util.List tags;
/**
*
* A list of filter rules that determines which files to include when running a task. The pattern contains a single
* filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*/
private java.util.List includes;
/**
*
* The Amazon Resource Name (ARN) of the source location for the task.
*
*
* @param sourceLocationArn
* The Amazon Resource Name (ARN) of the source location for the task.
*/
public void setSourceLocationArn(String sourceLocationArn) {
this.sourceLocationArn = sourceLocationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the source location for the task.
*
*
* @return The Amazon Resource Name (ARN) of the source location for the task.
*/
public String getSourceLocationArn() {
return this.sourceLocationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the source location for the task.
*
*
* @param sourceLocationArn
* The Amazon Resource Name (ARN) of the source location for the task.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withSourceLocationArn(String sourceLocationArn) {
setSourceLocationArn(sourceLocationArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
*
*
* @param destinationLocationArn
* The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
*/
public void setDestinationLocationArn(String destinationLocationArn) {
this.destinationLocationArn = destinationLocationArn;
}
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
*
*
* @return The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
*/
public String getDestinationLocationArn() {
return this.destinationLocationArn;
}
/**
*
* The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
*
*
* @param destinationLocationArn
* The Amazon Resource Name (ARN) of an Amazon Web Services storage resource's location.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withDestinationLocationArn(String destinationLocationArn) {
setDestinationLocationArn(destinationLocationArn);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the
* task.
*
*
* @param cloudWatchLogGroupArn
* The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events
* in the task.
*/
public void setCloudWatchLogGroupArn(String cloudWatchLogGroupArn) {
this.cloudWatchLogGroupArn = cloudWatchLogGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the
* task.
*
*
* @return The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events
* in the task.
*/
public String getCloudWatchLogGroupArn() {
return this.cloudWatchLogGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events in the
* task.
*
*
* @param cloudWatchLogGroupArn
* The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that is used to monitor and log events
* in the task.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withCloudWatchLogGroupArn(String cloudWatchLogGroupArn) {
setCloudWatchLogGroupArn(cloudWatchLogGroupArn);
return this;
}
/**
*
* The name of a task. This value is a text reference that is used to identify the task in the console.
*
*
* @param name
* The name of a task. This value is a text reference that is used to identify the task in the console.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of a task. This value is a text reference that is used to identify the task in the console.
*
*
* @return The name of a task. This value is a text reference that is used to identify the task in the console.
*/
public String getName() {
return this.name;
}
/**
*
* The name of a task. This value is a text reference that is used to identify the task in the console.
*
*
* @param name
* The name of a task. This value is a text reference that is used to identify the task in the console.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The set of configuration options that control the behavior of a single execution of the task that occurs when you
* call StartTaskExecution
. You can configure these options to preserve metadata such as user ID (UID)
* and group ID (GID), file permissions, data integrity verification, and so on.
*
*
* For each individual task execution, you can override these options by specifying the OverrideOptions
* before starting the task execution. For more information, see the StartTaskExecution
* operation.
*
*
* @param options
* The set of configuration options that control the behavior of a single execution of the task that occurs
* when you call StartTaskExecution
. You can configure these options to preserve metadata such
* as user ID (UID) and group ID (GID), file permissions, data integrity verification, and so on.
*
* For each individual task execution, you can override these options by specifying the
* OverrideOptions
before starting the task execution. For more information, see the StartTaskExecution operation.
*/
public void setOptions(Options options) {
this.options = options;
}
/**
*
* The set of configuration options that control the behavior of a single execution of the task that occurs when you
* call StartTaskExecution
. You can configure these options to preserve metadata such as user ID (UID)
* and group ID (GID), file permissions, data integrity verification, and so on.
*
*
* For each individual task execution, you can override these options by specifying the OverrideOptions
* before starting the task execution. For more information, see the StartTaskExecution
* operation.
*
*
* @return The set of configuration options that control the behavior of a single execution of the task that occurs
* when you call StartTaskExecution
. You can configure these options to preserve metadata such
* as user ID (UID) and group ID (GID), file permissions, data integrity verification, and so on.
*
* For each individual task execution, you can override these options by specifying the
* OverrideOptions
before starting the task execution. For more information, see the StartTaskExecution operation.
*/
public Options getOptions() {
return this.options;
}
/**
*
* The set of configuration options that control the behavior of a single execution of the task that occurs when you
* call StartTaskExecution
. You can configure these options to preserve metadata such as user ID (UID)
* and group ID (GID), file permissions, data integrity verification, and so on.
*
*
* For each individual task execution, you can override these options by specifying the OverrideOptions
* before starting the task execution. For more information, see the StartTaskExecution
* operation.
*
*
* @param options
* The set of configuration options that control the behavior of a single execution of the task that occurs
* when you call StartTaskExecution
. You can configure these options to preserve metadata such
* as user ID (UID) and group ID (GID), file permissions, data integrity verification, and so on.
*
* For each individual task execution, you can override these options by specifying the
* OverrideOptions
before starting the task execution. For more information, see the StartTaskExecution operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withOptions(Options options) {
setOptions(options);
return this;
}
/**
*
* A list of filter rules that determines which files to exclude from a task. The list should contain a single
* filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
*
*
* @return A list of filter rules that determines which files to exclude from a task. The list should contain a
* single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that
* is, a pipe), for example, "/folder1|/folder2"
.
*
*/
public java.util.List getExcludes() {
return excludes;
}
/**
*
* A list of filter rules that determines which files to exclude from a task. The list should contain a single
* filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
*
*
* @param excludes
* A list of filter rules that determines which files to exclude from a task. The list should contain a
* single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is,
* a pipe), for example, "/folder1|/folder2"
.
*
*/
public void setExcludes(java.util.Collection excludes) {
if (excludes == null) {
this.excludes = null;
return;
}
this.excludes = new java.util.ArrayList(excludes);
}
/**
*
* A list of filter rules that determines which files to exclude from a task. The list should contain a single
* filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setExcludes(java.util.Collection)} or {@link #withExcludes(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param excludes
* A list of filter rules that determines which files to exclude from a task. The list should contain a
* single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is,
* a pipe), for example, "/folder1|/folder2"
.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withExcludes(FilterRule... excludes) {
if (this.excludes == null) {
setExcludes(new java.util.ArrayList(excludes.length));
}
for (FilterRule ele : excludes) {
this.excludes.add(ele);
}
return this;
}
/**
*
* A list of filter rules that determines which files to exclude from a task. The list should contain a single
* filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
*
*
* @param excludes
* A list of filter rules that determines which files to exclude from a task. The list should contain a
* single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is,
* a pipe), for example, "/folder1|/folder2"
.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withExcludes(java.util.Collection excludes) {
setExcludes(excludes);
return this;
}
/**
*
* Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule
* should be specified in UTC time. For more information, see Scheduling your task.
*
*
* @param schedule
* Specifies a schedule used to periodically transfer files from a source to a destination location. The
* schedule should be specified in UTC time. For more information, see Scheduling your
* task.
*/
public void setSchedule(TaskSchedule schedule) {
this.schedule = schedule;
}
/**
*
* Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule
* should be specified in UTC time. For more information, see Scheduling your task.
*
*
* @return Specifies a schedule used to periodically transfer files from a source to a destination location. The
* schedule should be specified in UTC time. For more information, see Scheduling your
* task.
*/
public TaskSchedule getSchedule() {
return this.schedule;
}
/**
*
* Specifies a schedule used to periodically transfer files from a source to a destination location. The schedule
* should be specified in UTC time. For more information, see Scheduling your task.
*
*
* @param schedule
* Specifies a schedule used to periodically transfer files from a source to a destination location. The
* schedule should be specified in UTC time. For more information, see Scheduling your
* task.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withSchedule(TaskSchedule schedule) {
setSchedule(schedule);
return this;
}
/**
*
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
*
*
* @return The key-value pair that represents the tag that you want to add to the resource. The value can be an
* empty string.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
*
*
* @param tags
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withTags(TagListEntry... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (TagListEntry ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
*
*
* @param tags
* The key-value pair that represents the tag that you want to add to the resource. The value can be an empty
* string.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withTags(java.util.Collection tags) {
setTags(tags);
return this;
}
/**
*
* A list of filter rules that determines which files to include when running a task. The pattern contains a single
* filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
* @return A list of filter rules that determines which files to include when running a task. The pattern contains a
* single filter string that consists of the patterns to include. The patterns are delimited by "|" (that
* is, a pipe), for example, "/folder1|/folder2"
.
*/
public java.util.List getIncludes() {
return includes;
}
/**
*
* A list of filter rules that determines which files to include when running a task. The pattern contains a single
* filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
* @param includes
* A list of filter rules that determines which files to include when running a task. The pattern contains a
* single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is,
* a pipe), for example, "/folder1|/folder2"
.
*/
public void setIncludes(java.util.Collection includes) {
if (includes == null) {
this.includes = null;
return;
}
this.includes = new java.util.ArrayList(includes);
}
/**
*
* A list of filter rules that determines which files to include when running a task. The pattern contains a single
* filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setIncludes(java.util.Collection)} or {@link #withIncludes(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param includes
* A list of filter rules that determines which files to include when running a task. The pattern contains a
* single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is,
* a pipe), for example, "/folder1|/folder2"
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withIncludes(FilterRule... includes) {
if (this.includes == null) {
setIncludes(new java.util.ArrayList(includes.length));
}
for (FilterRule ele : includes) {
this.includes.add(ele);
}
return this;
}
/**
*
* A list of filter rules that determines which files to include when running a task. The pattern contains a single
* filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a pipe), for
* example, "/folder1|/folder2"
.
*
*
* @param includes
* A list of filter rules that determines which files to include when running a task. The pattern contains a
* single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is,
* a pipe), for example, "/folder1|/folder2"
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateTaskRequest withIncludes(java.util.Collection includes) {
setIncludes(includes);
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 (getSourceLocationArn() != null)
sb.append("SourceLocationArn: ").append(getSourceLocationArn()).append(",");
if (getDestinationLocationArn() != null)
sb.append("DestinationLocationArn: ").append(getDestinationLocationArn()).append(",");
if (getCloudWatchLogGroupArn() != null)
sb.append("CloudWatchLogGroupArn: ").append(getCloudWatchLogGroupArn()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getOptions() != null)
sb.append("Options: ").append(getOptions()).append(",");
if (getExcludes() != null)
sb.append("Excludes: ").append(getExcludes()).append(",");
if (getSchedule() != null)
sb.append("Schedule: ").append(getSchedule()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getIncludes() != null)
sb.append("Includes: ").append(getIncludes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateTaskRequest == false)
return false;
CreateTaskRequest other = (CreateTaskRequest) obj;
if (other.getSourceLocationArn() == null ^ this.getSourceLocationArn() == null)
return false;
if (other.getSourceLocationArn() != null && other.getSourceLocationArn().equals(this.getSourceLocationArn()) == false)
return false;
if (other.getDestinationLocationArn() == null ^ this.getDestinationLocationArn() == null)
return false;
if (other.getDestinationLocationArn() != null && other.getDestinationLocationArn().equals(this.getDestinationLocationArn()) == false)
return false;
if (other.getCloudWatchLogGroupArn() == null ^ this.getCloudWatchLogGroupArn() == null)
return false;
if (other.getCloudWatchLogGroupArn() != null && other.getCloudWatchLogGroupArn().equals(this.getCloudWatchLogGroupArn()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getOptions() == null ^ this.getOptions() == null)
return false;
if (other.getOptions() != null && other.getOptions().equals(this.getOptions()) == false)
return false;
if (other.getExcludes() == null ^ this.getExcludes() == null)
return false;
if (other.getExcludes() != null && other.getExcludes().equals(this.getExcludes()) == false)
return false;
if (other.getSchedule() == null ^ this.getSchedule() == null)
return false;
if (other.getSchedule() != null && other.getSchedule().equals(this.getSchedule()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getIncludes() == null ^ this.getIncludes() == null)
return false;
if (other.getIncludes() != null && other.getIncludes().equals(this.getIncludes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getSourceLocationArn() == null) ? 0 : getSourceLocationArn().hashCode());
hashCode = prime * hashCode + ((getDestinationLocationArn() == null) ? 0 : getDestinationLocationArn().hashCode());
hashCode = prime * hashCode + ((getCloudWatchLogGroupArn() == null) ? 0 : getCloudWatchLogGroupArn().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getOptions() == null) ? 0 : getOptions().hashCode());
hashCode = prime * hashCode + ((getExcludes() == null) ? 0 : getExcludes().hashCode());
hashCode = prime * hashCode + ((getSchedule() == null) ? 0 : getSchedule().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getIncludes() == null) ? 0 : getIncludes().hashCode());
return hashCode;
}
@Override
public CreateTaskRequest clone() {
return (CreateTaskRequest) super.clone();
}
}