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

software.amazon.awssdk.services.applicationcostprofiler.model.PutReportDefinitionRequest Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.15
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.applicationcostprofiler.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class PutReportDefinitionRequest extends ApplicationCostProfilerRequest implements
        ToCopyableBuilder {
    private static final SdkField REPORT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("reportId").getter(getter(PutReportDefinitionRequest::reportId)).setter(setter(Builder::reportId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reportId").build()).build();

    private static final SdkField REPORT_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("reportDescription").getter(getter(PutReportDefinitionRequest::reportDescription))
            .setter(setter(Builder::reportDescription))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reportDescription").build()).build();

    private static final SdkField REPORT_FREQUENCY_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("reportFrequency").getter(getter(PutReportDefinitionRequest::reportFrequencyAsString))
            .setter(setter(Builder::reportFrequency))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("reportFrequency").build()).build();

    private static final SdkField FORMAT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("format")
            .getter(getter(PutReportDefinitionRequest::formatAsString)).setter(setter(Builder::format))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("format").build()).build();

    private static final SdkField DESTINATION_S3_LOCATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("destinationS3Location")
            .getter(getter(PutReportDefinitionRequest::destinationS3Location)).setter(setter(Builder::destinationS3Location))
            .constructor(S3Location::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("destinationS3Location").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPORT_ID_FIELD,
            REPORT_DESCRIPTION_FIELD, REPORT_FREQUENCY_FIELD, FORMAT_FIELD, DESTINATION_S3_LOCATION_FIELD));

    private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();

    private final String reportId;

    private final String reportDescription;

    private final String reportFrequency;

    private final String format;

    private final S3Location destinationS3Location;

    private PutReportDefinitionRequest(BuilderImpl builder) {
        super(builder);
        this.reportId = builder.reportId;
        this.reportDescription = builder.reportDescription;
        this.reportFrequency = builder.reportFrequency;
        this.format = builder.format;
        this.destinationS3Location = builder.destinationS3Location;
    }

    /**
     * 

* Required. ID of the report. You can choose any valid string matching the pattern for the ID. *

* * @return Required. ID of the report. You can choose any valid string matching the pattern for the ID. */ public final String reportId() { return reportId; } /** *

* Required. Description of the report. *

* * @return Required. Description of the report. */ public final String reportDescription() { return reportDescription; } /** *

* Required. The cadence to generate the report. *

*

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

* * @return Required. The cadence to generate the report. * @see ReportFrequency */ public final ReportFrequency reportFrequency() { return ReportFrequency.fromValue(reportFrequency); } /** *

* Required. The cadence to generate the report. *

*

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

* * @return Required. The cadence to generate the report. * @see ReportFrequency */ public final String reportFrequencyAsString() { return reportFrequency; } /** *

* Required. The format to use for the generated report. *

*

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

* * @return Required. The format to use for the generated report. * @see Format */ public final Format format() { return Format.fromValue(format); } /** *

* Required. The format to use for the generated report. *

*

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

* * @return Required. The format to use for the generated report. * @see Format */ public final String formatAsString() { return format; } /** *

* Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the report. *

* * @return Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the * report. */ public final S3Location destinationS3Location() { return destinationS3Location; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(reportId()); hashCode = 31 * hashCode + Objects.hashCode(reportDescription()); hashCode = 31 * hashCode + Objects.hashCode(reportFrequencyAsString()); hashCode = 31 * hashCode + Objects.hashCode(formatAsString()); hashCode = 31 * hashCode + Objects.hashCode(destinationS3Location()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof PutReportDefinitionRequest)) { return false; } PutReportDefinitionRequest other = (PutReportDefinitionRequest) obj; return Objects.equals(reportId(), other.reportId()) && Objects.equals(reportDescription(), other.reportDescription()) && Objects.equals(reportFrequencyAsString(), other.reportFrequencyAsString()) && Objects.equals(formatAsString(), other.formatAsString()) && Objects.equals(destinationS3Location(), other.destinationS3Location()); } /** * 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("PutReportDefinitionRequest").add("ReportId", reportId()) .add("ReportDescription", reportDescription()).add("ReportFrequency", reportFrequencyAsString()) .add("Format", formatAsString()).add("DestinationS3Location", destinationS3Location()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "reportId": return Optional.ofNullable(clazz.cast(reportId())); case "reportDescription": return Optional.ofNullable(clazz.cast(reportDescription())); case "reportFrequency": return Optional.ofNullable(clazz.cast(reportFrequencyAsString())); case "format": return Optional.ofNullable(clazz.cast(formatAsString())); case "destinationS3Location": return Optional.ofNullable(clazz.cast(destinationS3Location())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("reportId", REPORT_ID_FIELD); map.put("reportDescription", REPORT_DESCRIPTION_FIELD); map.put("reportFrequency", REPORT_FREQUENCY_FIELD); map.put("format", FORMAT_FIELD); map.put("destinationS3Location", DESTINATION_S3_LOCATION_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((PutReportDefinitionRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ApplicationCostProfilerRequest.Builder, SdkPojo, CopyableBuilder { /** *

* Required. ID of the report. You can choose any valid string matching the pattern for the ID. *

* * @param reportId * Required. ID of the report. You can choose any valid string matching the pattern for the ID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reportId(String reportId); /** *

* Required. Description of the report. *

* * @param reportDescription * Required. Description of the report. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reportDescription(String reportDescription); /** *

* Required. The cadence to generate the report. *

* * @param reportFrequency * Required. The cadence to generate the report. * @see ReportFrequency * @return Returns a reference to this object so that method calls can be chained together. * @see ReportFrequency */ Builder reportFrequency(String reportFrequency); /** *

* Required. The cadence to generate the report. *

* * @param reportFrequency * Required. The cadence to generate the report. * @see ReportFrequency * @return Returns a reference to this object so that method calls can be chained together. * @see ReportFrequency */ Builder reportFrequency(ReportFrequency reportFrequency); /** *

* Required. The format to use for the generated report. *

* * @param format * Required. The format to use for the generated report. * @see Format * @return Returns a reference to this object so that method calls can be chained together. * @see Format */ Builder format(String format); /** *

* Required. The format to use for the generated report. *

* * @param format * Required. The format to use for the generated report. * @see Format * @return Returns a reference to this object so that method calls can be chained together. * @see Format */ Builder format(Format format); /** *

* Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the * report. *

* * @param destinationS3Location * Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads * the report. * @return Returns a reference to this object so that method calls can be chained together. */ Builder destinationS3Location(S3Location destinationS3Location); /** *

* Required. Amazon Simple Storage Service (Amazon S3) location where Application Cost Profiler uploads the * report. *

* This is a convenience method that creates an instance of the {@link S3Location.Builder} avoiding the need to * create one manually via {@link S3Location#builder()}. * *

* When the {@link Consumer} completes, {@link S3Location.Builder#build()} is called immediately and its result * is passed to {@link #destinationS3Location(S3Location)}. * * @param destinationS3Location * a consumer that will call methods on {@link S3Location.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #destinationS3Location(S3Location) */ default Builder destinationS3Location(Consumer destinationS3Location) { return destinationS3Location(S3Location.builder().applyMutation(destinationS3Location).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ApplicationCostProfilerRequest.BuilderImpl implements Builder { private String reportId; private String reportDescription; private String reportFrequency; private String format; private S3Location destinationS3Location; private BuilderImpl() { } private BuilderImpl(PutReportDefinitionRequest model) { super(model); reportId(model.reportId); reportDescription(model.reportDescription); reportFrequency(model.reportFrequency); format(model.format); destinationS3Location(model.destinationS3Location); } public final String getReportId() { return reportId; } public final void setReportId(String reportId) { this.reportId = reportId; } @Override public final Builder reportId(String reportId) { this.reportId = reportId; return this; } public final String getReportDescription() { return reportDescription; } public final void setReportDescription(String reportDescription) { this.reportDescription = reportDescription; } @Override public final Builder reportDescription(String reportDescription) { this.reportDescription = reportDescription; return this; } public final String getReportFrequency() { return reportFrequency; } public final void setReportFrequency(String reportFrequency) { this.reportFrequency = reportFrequency; } @Override public final Builder reportFrequency(String reportFrequency) { this.reportFrequency = reportFrequency; return this; } @Override public final Builder reportFrequency(ReportFrequency reportFrequency) { this.reportFrequency(reportFrequency == null ? null : reportFrequency.toString()); 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(Format format) { this.format(format == null ? null : format.toString()); return this; } public final S3Location.Builder getDestinationS3Location() { return destinationS3Location != null ? destinationS3Location.toBuilder() : null; } public final void setDestinationS3Location(S3Location.BuilderImpl destinationS3Location) { this.destinationS3Location = destinationS3Location != null ? destinationS3Location.build() : null; } @Override public final Builder destinationS3Location(S3Location destinationS3Location) { this.destinationS3Location = destinationS3Location; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public PutReportDefinitionRequest build() { return new PutReportDefinitionRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy