All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.fsx.model.CompletionReport Maven / Gradle / Ivy

Go to download

The AWS Java SDK for FSx module holds the client classes that are used for communicating with FSx.

There is a newer version: 2.28.4
Show newest version
/*
 * Copyright 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 software.amazon.awssdk.services.fsx.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Provides a report detailing the data repository task results of the files processed that match the criteria specified * in the report Scope parameter. FSx delivers the report to the file system's linked data repository in * Amazon S3, using the path specified in the report Path parameter. You can specify whether or not a * report gets generated for a task using the Enabled parameter. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CompletionReport implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("Enabled").getter(getter(CompletionReport::enabled)).setter(setter(Builder::enabled)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Enabled").build()).build(); private static final SdkField PATH_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Path") .getter(getter(CompletionReport::path)).setter(setter(Builder::path)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Path").build()).build(); private static final SdkField FORMAT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Format") .getter(getter(CompletionReport::formatAsString)).setter(setter(Builder::format)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Format").build()).build(); private static final SdkField SCOPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Scope") .getter(getter(CompletionReport::scopeAsString)).setter(setter(Builder::scope)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Scope").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENABLED_FIELD, PATH_FIELD, FORMAT_FIELD, SCOPE_FIELD)); private static final long serialVersionUID = 1L; private final Boolean enabled; private final String path; private final String format; private final String scope; private CompletionReport(BuilderImpl builder) { this.enabled = builder.enabled; this.path = builder.path; this.format = builder.format; this.scope = builder.scope; } /** *

* Set Enabled to True to generate a CompletionReport when the task * completes. If set to true, then you need to provide a report Scope, Path, * and Format. Set Enabled to False if you do not want a * CompletionReport generated when the task completes. *

* * @return Set Enabled to True to generate a CompletionReport when the task * completes. If set to true, then you need to provide a report Scope, * Path, and Format. Set Enabled to False if you do not * want a CompletionReport generated when the task completes. */ public final Boolean enabled() { return enabled; } /** *

* Required if Enabled is set to true. Specifies the location of the report on the file * system's linked S3 data repository. An absolute path that defines where the completion report will be stored in * the destination location. The Path you provide must be located within the file system’s ExportPath. * An example Path value is "s3://amzn-s3-demo-bucket/myExportPath/optionalPrefix". The report provides * the following information for each file in the report: FilePath, FileStatus, and ErrorCode. *

* * @return Required if Enabled is set to true. Specifies the location of the report on the * file system's linked S3 data repository. An absolute path that defines where the completion report will * be stored in the destination location. The Path you provide must be located within the file * system’s ExportPath. An example Path value is * "s3://amzn-s3-demo-bucket/myExportPath/optionalPrefix". The report provides the following information for * each file in the report: FilePath, FileStatus, and ErrorCode. */ public final String path() { return path; } /** *

* Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently supported. When * Format is set to REPORT_CSV_20191124, the CompletionReport is provided in * CSV format, and is delivered to {path}/task-{id}/failures.csv. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #format} will * return {@link ReportFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #formatAsString}. *

* * @return Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently supported. * When Format is set to REPORT_CSV_20191124, the CompletionReport is * provided in CSV format, and is delivered to {path}/task-{id}/failures.csv. * @see ReportFormat */ public final ReportFormat format() { return ReportFormat.fromValue(format); } /** *

* Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently supported. When * Format is set to REPORT_CSV_20191124, the CompletionReport is provided in * CSV format, and is delivered to {path}/task-{id}/failures.csv. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #format} will * return {@link ReportFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #formatAsString}. *

* * @return Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently supported. * When Format is set to REPORT_CSV_20191124, the CompletionReport is * provided in CSV format, and is delivered to {path}/task-{id}/failures.csv. * @see ReportFormat */ public final String formatAsString() { return format; } /** *

* Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. When * Scope is set to FAILED_FILES_ONLY, the CompletionReport only contains * information about files that the data repository task failed to process. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #scope} will return * {@link ReportScope#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #scopeAsString}. *

* * @return Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. When * Scope is set to FAILED_FILES_ONLY, the CompletionReport only * contains information about files that the data repository task failed to process. * @see ReportScope */ public final ReportScope scope() { return ReportScope.fromValue(scope); } /** *

* Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. When * Scope is set to FAILED_FILES_ONLY, the CompletionReport only contains * information about files that the data repository task failed to process. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #scope} will return * {@link ReportScope#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #scopeAsString}. *

* * @return Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. When * Scope is set to FAILED_FILES_ONLY, the CompletionReport only * contains information about files that the data repository task failed to process. * @see ReportScope */ public final String scopeAsString() { return scope; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(enabled()); hashCode = 31 * hashCode + Objects.hashCode(path()); hashCode = 31 * hashCode + Objects.hashCode(formatAsString()); hashCode = 31 * hashCode + Objects.hashCode(scopeAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CompletionReport)) { return false; } CompletionReport other = (CompletionReport) obj; return Objects.equals(enabled(), other.enabled()) && Objects.equals(path(), other.path()) && Objects.equals(formatAsString(), other.formatAsString()) && Objects.equals(scopeAsString(), other.scopeAsString()); } /** * 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. */ @Override public final String toString() { return ToString.builder("CompletionReport").add("Enabled", enabled()).add("Path", path()).add("Format", formatAsString()) .add("Scope", scopeAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Enabled": return Optional.ofNullable(clazz.cast(enabled())); case "Path": return Optional.ofNullable(clazz.cast(path())); case "Format": return Optional.ofNullable(clazz.cast(formatAsString())); case "Scope": return Optional.ofNullable(clazz.cast(scopeAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CompletionReport) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Set Enabled to True to generate a CompletionReport when the task * completes. If set to true, then you need to provide a report Scope, * Path, and Format. Set Enabled to False if you do not want * a CompletionReport generated when the task completes. *

* * @param enabled * Set Enabled to True to generate a CompletionReport when the * task completes. If set to true, then you need to provide a report Scope, * Path, and Format. Set Enabled to False if you do * not want a CompletionReport generated when the task completes. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enabled(Boolean enabled); /** *

* Required if Enabled is set to true. Specifies the location of the report on the * file system's linked S3 data repository. An absolute path that defines where the completion report will be * stored in the destination location. The Path you provide must be located within the file * system’s ExportPath. An example Path value is * "s3://amzn-s3-demo-bucket/myExportPath/optionalPrefix". The report provides the following information for * each file in the report: FilePath, FileStatus, and ErrorCode. *

* * @param path * Required if Enabled is set to true. Specifies the location of the report on * the file system's linked S3 data repository. An absolute path that defines where the completion report * will be stored in the destination location. The Path you provide must be located within * the file system’s ExportPath. An example Path value is * "s3://amzn-s3-demo-bucket/myExportPath/optionalPrefix". The report provides the following information * for each file in the report: FilePath, FileStatus, and ErrorCode. * @return Returns a reference to this object so that method calls can be chained together. */ Builder path(String path); /** *

* Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently supported. When * Format is set to REPORT_CSV_20191124, the CompletionReport is provided * in CSV format, and is delivered to {path}/task-{id}/failures.csv. *

* * @param format * Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently * supported. When Format is set to REPORT_CSV_20191124, the * CompletionReport is provided in CSV format, and is delivered to * {path}/task-{id}/failures.csv. * @see ReportFormat * @return Returns a reference to this object so that method calls can be chained together. * @see ReportFormat */ Builder format(String format); /** *

* Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently supported. When * Format is set to REPORT_CSV_20191124, the CompletionReport is provided * in CSV format, and is delivered to {path}/task-{id}/failures.csv. *

* * @param format * Required if Enabled is set to true. Specifies the format of the * CompletionReport. REPORT_CSV_20191124 is the only format currently * supported. When Format is set to REPORT_CSV_20191124, the * CompletionReport is provided in CSV format, and is delivered to * {path}/task-{id}/failures.csv. * @see ReportFormat * @return Returns a reference to this object so that method calls can be chained together. * @see ReportFormat */ Builder format(ReportFormat format); /** *

* Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. When * Scope is set to FAILED_FILES_ONLY, the CompletionReport only contains * information about files that the data repository task failed to process. *

* * @param scope * Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. * When Scope is set to FAILED_FILES_ONLY, the CompletionReport * only contains information about files that the data repository task failed to process. * @see ReportScope * @return Returns a reference to this object so that method calls can be chained together. * @see ReportScope */ Builder scope(String scope); /** *

* Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. When * Scope is set to FAILED_FILES_ONLY, the CompletionReport only contains * information about files that the data repository task failed to process. *

* * @param scope * Required if Enabled is set to true. Specifies the scope of the * CompletionReport; FAILED_FILES_ONLY is the only scope currently supported. * When Scope is set to FAILED_FILES_ONLY, the CompletionReport * only contains information about files that the data repository task failed to process. * @see ReportScope * @return Returns a reference to this object so that method calls can be chained together. * @see ReportScope */ Builder scope(ReportScope scope); } static final class BuilderImpl implements Builder { private Boolean enabled; private String path; private String format; private String scope; private BuilderImpl() { } private BuilderImpl(CompletionReport model) { enabled(model.enabled); path(model.path); format(model.format); scope(model.scope); } public final Boolean getEnabled() { return enabled; } public final void setEnabled(Boolean enabled) { this.enabled = enabled; } @Override public final Builder enabled(Boolean enabled) { this.enabled = enabled; return this; } public final String getPath() { return path; } public final void setPath(String path) { this.path = path; } @Override public final Builder path(String path) { this.path = path; return this; } public final String getFormat() { return format; } public final void setFormat(String format) { this.format = format; } @Override public final Builder format(String format) { this.format = format; return this; } @Override public final Builder format(ReportFormat format) { this.format(format == null ? null : format.toString()); return this; } public final String getScope() { return scope; } public final void setScope(String scope) { this.scope = scope; } @Override public final Builder scope(String scope) { this.scope = scope; return this; } @Override public final Builder scope(ReportScope scope) { this.scope(scope == null ? null : scope.toString()); return this; } @Override public CompletionReport build() { return new CompletionReport(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy