software.amazon.awssdk.services.computeoptimizer.model.ExportRdsDatabaseRecommendationsRequest Maven / Gradle / Ivy
Show all versions of computeoptimizer Show documentation
/*
* 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.computeoptimizer.model;
import java.util.Arrays;
import java.util.Collection;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 ExportRdsDatabaseRecommendationsRequest extends ComputeOptimizerRequest implements
ToCopyableBuilder {
private static final SdkField> ACCOUNT_IDS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("accountIds")
.getter(getter(ExportRdsDatabaseRecommendationsRequest::accountIds))
.setter(setter(Builder::accountIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("accountIds").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> FILTERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("filters")
.getter(getter(ExportRdsDatabaseRecommendationsRequest::filters))
.setter(setter(Builder::filters))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("filters").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(RDSDBRecommendationFilter::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> FIELDS_TO_EXPORT_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("fieldsToExport")
.getter(getter(ExportRdsDatabaseRecommendationsRequest::fieldsToExportAsStrings))
.setter(setter(Builder::fieldsToExportWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fieldsToExport").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField S3_DESTINATION_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("s3DestinationConfig")
.getter(getter(ExportRdsDatabaseRecommendationsRequest::s3DestinationConfig))
.setter(setter(Builder::s3DestinationConfig)).constructor(S3DestinationConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("s3DestinationConfig").build())
.build();
private static final SdkField FILE_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("fileFormat").getter(getter(ExportRdsDatabaseRecommendationsRequest::fileFormatAsString))
.setter(setter(Builder::fileFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fileFormat").build()).build();
private static final SdkField INCLUDE_MEMBER_ACCOUNTS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("includeMemberAccounts").getter(getter(ExportRdsDatabaseRecommendationsRequest::includeMemberAccounts))
.setter(setter(Builder::includeMemberAccounts))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("includeMemberAccounts").build())
.build();
private static final SdkField RECOMMENDATION_PREFERENCES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("recommendationPreferences")
.getter(getter(ExportRdsDatabaseRecommendationsRequest::recommendationPreferences))
.setter(setter(Builder::recommendationPreferences)).constructor(RecommendationPreferences::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recommendationPreferences").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_IDS_FIELD,
FILTERS_FIELD, FIELDS_TO_EXPORT_FIELD, S3_DESTINATION_CONFIG_FIELD, FILE_FORMAT_FIELD, INCLUDE_MEMBER_ACCOUNTS_FIELD,
RECOMMENDATION_PREFERENCES_FIELD));
private final List accountIds;
private final List filters;
private final List fieldsToExport;
private final S3DestinationConfig s3DestinationConfig;
private final String fileFormat;
private final Boolean includeMemberAccounts;
private final RecommendationPreferences recommendationPreferences;
private ExportRdsDatabaseRecommendationsRequest(BuilderImpl builder) {
super(builder);
this.accountIds = builder.accountIds;
this.filters = builder.filters;
this.fieldsToExport = builder.fieldsToExport;
this.s3DestinationConfig = builder.s3DestinationConfig;
this.fileFormat = builder.fileFormat;
this.includeMemberAccounts = builder.includeMemberAccounts;
this.recommendationPreferences = builder.recommendationPreferences;
}
/**
* For responses, this returns true if the service returned a value for the AccountIds property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasAccountIds() {
return accountIds != null && !(accountIds instanceof SdkAutoConstructList);
}
/**
*
* The Amazon Web Services account IDs for the export Amazon RDS recommendations.
*
*
* If your account is the management account or the delegated administrator of an organization, use this parameter
* to specify the member account you want to export recommendations to.
*
*
* This parameter can't be specified together with the include member accounts parameter. The parameters are
* mutually exclusive.
*
*
* If this parameter or the include member accounts parameter is omitted, the recommendations for member accounts
* aren't included in the export.
*
*
* You can specify multiple account IDs per request.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasAccountIds} method.
*
*
* @return The Amazon Web Services account IDs for the export Amazon RDS recommendations.
*
* If your account is the management account or the delegated administrator of an organization, use this
* parameter to specify the member account you want to export recommendations to.
*
*
* This parameter can't be specified together with the include member accounts parameter. The parameters are
* mutually exclusive.
*
*
* If this parameter or the include member accounts parameter is omitted, the recommendations for member
* accounts aren't included in the export.
*
*
* You can specify multiple account IDs per request.
*/
public final List accountIds() {
return accountIds;
}
/**
* For responses, this returns true if the service returned a value for the Filters property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasFilters() {
return filters != null && !(filters instanceof SdkAutoConstructList);
}
/**
*
* An array of objects to specify a filter that exports a more specific set of Amazon RDS recommendations.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasFilters} method.
*
*
* @return An array of objects to specify a filter that exports a more specific set of Amazon RDS recommendations.
*/
public final List filters() {
return filters;
}
/**
*
* The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasFieldsToExport} method.
*
*
* @return The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*/
public final List fieldsToExport() {
return ExportableRDSDBFieldsCopier.copyStringToEnum(fieldsToExport);
}
/**
* For responses, this returns true if the service returned a value for the FieldsToExport property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasFieldsToExport() {
return fieldsToExport != null && !(fieldsToExport instanceof SdkAutoConstructList);
}
/**
*
* The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasFieldsToExport} method.
*
*
* @return The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*/
public final List fieldsToExportAsStrings() {
return fieldsToExport;
}
/**
* Returns the value of the S3DestinationConfig property for this object.
*
* @return The value of the S3DestinationConfig property for this object.
*/
public final S3DestinationConfig s3DestinationConfig() {
return s3DestinationConfig;
}
/**
*
* The format of the export file.
*
*
* The CSV file is the only export file format currently supported.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #fileFormat} will
* return {@link FileFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #fileFormatAsString}.
*
*
* @return The format of the export file.
*
* The CSV file is the only export file format currently supported.
* @see FileFormat
*/
public final FileFormat fileFormat() {
return FileFormat.fromValue(fileFormat);
}
/**
*
* The format of the export file.
*
*
* The CSV file is the only export file format currently supported.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #fileFormat} will
* return {@link FileFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #fileFormatAsString}.
*
*
* @return The format of the export file.
*
* The CSV file is the only export file format currently supported.
* @see FileFormat
*/
public final String fileFormatAsString() {
return fileFormat;
}
/**
*
* If your account is the management account or the delegated administrator of an organization, this parameter
* indicates whether to include recommendations for resources in all member accounts of the organization.
*
*
* The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must be
* enabled in the organization account. For more information, see Compute
* Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User Guide.
*
*
* If this parameter is omitted, recommendations for member accounts of the organization aren't included in the
* export file.
*
*
* If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't included in
* the export.
*
*
* @return If your account is the management account or the delegated administrator of an organization, this
* parameter indicates whether to include recommendations for resources in all member accounts of the
* organization.
*
* The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer
* must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer
* User Guide.
*
*
* If this parameter is omitted, recommendations for member accounts of the organization aren't included in
* the export file.
*
*
* If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't
* included in the export.
*/
public final Boolean includeMemberAccounts() {
return includeMemberAccounts;
}
/**
* Returns the value of the RecommendationPreferences property for this object.
*
* @return The value of the RecommendationPreferences property for this object.
*/
public final RecommendationPreferences recommendationPreferences() {
return recommendationPreferences;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasAccountIds() ? accountIds() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasFilters() ? filters() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasFieldsToExport() ? fieldsToExportAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(s3DestinationConfig());
hashCode = 31 * hashCode + Objects.hashCode(fileFormatAsString());
hashCode = 31 * hashCode + Objects.hashCode(includeMemberAccounts());
hashCode = 31 * hashCode + Objects.hashCode(recommendationPreferences());
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 ExportRdsDatabaseRecommendationsRequest)) {
return false;
}
ExportRdsDatabaseRecommendationsRequest other = (ExportRdsDatabaseRecommendationsRequest) obj;
return hasAccountIds() == other.hasAccountIds() && Objects.equals(accountIds(), other.accountIds())
&& hasFilters() == other.hasFilters() && Objects.equals(filters(), other.filters())
&& hasFieldsToExport() == other.hasFieldsToExport()
&& Objects.equals(fieldsToExportAsStrings(), other.fieldsToExportAsStrings())
&& Objects.equals(s3DestinationConfig(), other.s3DestinationConfig())
&& Objects.equals(fileFormatAsString(), other.fileFormatAsString())
&& Objects.equals(includeMemberAccounts(), other.includeMemberAccounts())
&& Objects.equals(recommendationPreferences(), other.recommendationPreferences());
}
/**
* 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("ExportRdsDatabaseRecommendationsRequest")
.add("AccountIds", hasAccountIds() ? accountIds() : null).add("Filters", hasFilters() ? filters() : null)
.add("FieldsToExport", hasFieldsToExport() ? fieldsToExportAsStrings() : null)
.add("S3DestinationConfig", s3DestinationConfig()).add("FileFormat", fileFormatAsString())
.add("IncludeMemberAccounts", includeMemberAccounts())
.add("RecommendationPreferences", recommendationPreferences()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "accountIds":
return Optional.ofNullable(clazz.cast(accountIds()));
case "filters":
return Optional.ofNullable(clazz.cast(filters()));
case "fieldsToExport":
return Optional.ofNullable(clazz.cast(fieldsToExportAsStrings()));
case "s3DestinationConfig":
return Optional.ofNullable(clazz.cast(s3DestinationConfig()));
case "fileFormat":
return Optional.ofNullable(clazz.cast(fileFormatAsString()));
case "includeMemberAccounts":
return Optional.ofNullable(clazz.cast(includeMemberAccounts()));
case "recommendationPreferences":
return Optional.ofNullable(clazz.cast(recommendationPreferences()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* If your account is the management account or the delegated administrator of an organization, use this
* parameter to specify the member account you want to export recommendations to.
*
*
* This parameter can't be specified together with the include member accounts parameter. The parameters
* are mutually exclusive.
*
*
* If this parameter or the include member accounts parameter is omitted, the recommendations for member
* accounts aren't included in the export.
*
*
* You can specify multiple account IDs per request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder accountIds(Collection accountIds);
/**
*
* The Amazon Web Services account IDs for the export Amazon RDS recommendations.
*
*
* If your account is the management account or the delegated administrator of an organization, use this
* parameter to specify the member account you want to export recommendations to.
*
*
* This parameter can't be specified together with the include member accounts parameter. The parameters are
* mutually exclusive.
*
*
* If this parameter or the include member accounts parameter is omitted, the recommendations for member
* accounts aren't included in the export.
*
*
* You can specify multiple account IDs per request.
*
*
* @param accountIds
* The Amazon Web Services account IDs for the export Amazon RDS recommendations.
*
* If your account is the management account or the delegated administrator of an organization, use this
* parameter to specify the member account you want to export recommendations to.
*
*
* This parameter can't be specified together with the include member accounts parameter. The parameters
* are mutually exclusive.
*
*
* If this parameter or the include member accounts parameter is omitted, the recommendations for member
* accounts aren't included in the export.
*
*
* You can specify multiple account IDs per request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder accountIds(String... accountIds);
/**
*
* An array of objects to specify a filter that exports a more specific set of Amazon RDS recommendations.
*
*
* @param filters
* An array of objects to specify a filter that exports a more specific set of Amazon RDS
* recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filters(Collection filters);
/**
*
* An array of objects to specify a filter that exports a more specific set of Amazon RDS recommendations.
*
*
* @param filters
* An array of objects to specify a filter that exports a more specific set of Amazon RDS
* recommendations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder filters(RDSDBRecommendationFilter... filters);
/**
*
* An array of objects to specify a filter that exports a more specific set of Amazon RDS recommendations.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.computeoptimizer.model.RDSDBRecommendationFilter.Builder} avoiding the
* need to create one manually via
* {@link software.amazon.awssdk.services.computeoptimizer.model.RDSDBRecommendationFilter#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.computeoptimizer.model.RDSDBRecommendationFilter.Builder#build()} is
* called immediately and its result is passed to {@link #filters(List)}.
*
* @param filters
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.computeoptimizer.model.RDSDBRecommendationFilter.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #filters(java.util.Collection)
*/
Builder filters(Consumer... filters);
/**
*
* The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*
*
* @param fieldsToExport
* The recommendations data to include in the export file. For more information about the fields that can
* be exported, see Exported files in the Compute Optimizer User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fieldsToExportWithStrings(Collection fieldsToExport);
/**
*
* The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*
*
* @param fieldsToExport
* The recommendations data to include in the export file. For more information about the fields that can
* be exported, see Exported files in the Compute Optimizer User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fieldsToExportWithStrings(String... fieldsToExport);
/**
*
* The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*
*
* @param fieldsToExport
* The recommendations data to include in the export file. For more information about the fields that can
* be exported, see Exported files in the Compute Optimizer User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fieldsToExport(Collection fieldsToExport);
/**
*
* The recommendations data to include in the export file. For more information about the fields that can be
* exported, see Exported files in the Compute Optimizer User Guide.
*
*
* @param fieldsToExport
* The recommendations data to include in the export file. For more information about the fields that can
* be exported, see Exported files in the Compute Optimizer User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder fieldsToExport(ExportableRDSDBField... fieldsToExport);
/**
* Sets the value of the S3DestinationConfig property for this object.
*
* @param s3DestinationConfig
* The new value for the S3DestinationConfig property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder s3DestinationConfig(S3DestinationConfig s3DestinationConfig);
/**
* Sets the value of the S3DestinationConfig property for this object.
*
* This is a convenience method that creates an instance of the {@link S3DestinationConfig.Builder} avoiding the
* need to create one manually via {@link S3DestinationConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link S3DestinationConfig.Builder#build()} is called immediately and
* its result is passed to {@link #s3DestinationConfig(S3DestinationConfig)}.
*
* @param s3DestinationConfig
* a consumer that will call methods on {@link S3DestinationConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #s3DestinationConfig(S3DestinationConfig)
*/
default Builder s3DestinationConfig(Consumer s3DestinationConfig) {
return s3DestinationConfig(S3DestinationConfig.builder().applyMutation(s3DestinationConfig).build());
}
/**
*
* The format of the export file.
*
*
* The CSV file is the only export file format currently supported.
*
*
* @param fileFormat
* The format of the export file.
*
* The CSV file is the only export file format currently supported.
* @see FileFormat
* @return Returns a reference to this object so that method calls can be chained together.
* @see FileFormat
*/
Builder fileFormat(String fileFormat);
/**
*
* The format of the export file.
*
*
* The CSV file is the only export file format currently supported.
*
*
* @param fileFormat
* The format of the export file.
*
* The CSV file is the only export file format currently supported.
* @see FileFormat
* @return Returns a reference to this object so that method calls can be chained together.
* @see FileFormat
*/
Builder fileFormat(FileFormat fileFormat);
/**
*
* If your account is the management account or the delegated administrator of an organization, this parameter
* indicates whether to include recommendations for resources in all member accounts of the organization.
*
*
* The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute Optimizer must
* be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute Optimizer User
* Guide.
*
*
* If this parameter is omitted, recommendations for member accounts of the organization aren't included in the
* export file.
*
*
* If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't included
* in the export.
*
*
* @param includeMemberAccounts
* If your account is the management account or the delegated administrator of an organization, this
* parameter indicates whether to include recommendations for resources in all member accounts of the
* organization.
*
* The member accounts must also be opted in to Compute Optimizer, and trusted access for Compute
* Optimizer must be enabled in the organization account. For more information, see Compute Optimizer and Amazon Web Services Organizations trusted access in the Compute
* Optimizer User Guide.
*
*
* If this parameter is omitted, recommendations for member accounts of the organization aren't included
* in the export file.
*
*
* If this parameter or the account ID parameter is omitted, recommendations for member accounts aren't
* included in the export.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder includeMemberAccounts(Boolean includeMemberAccounts);
/**
* Sets the value of the RecommendationPreferences property for this object.
*
* @param recommendationPreferences
* The new value for the RecommendationPreferences property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recommendationPreferences(RecommendationPreferences recommendationPreferences);
/**
* Sets the value of the RecommendationPreferences property for this object.
*
* This is a convenience method that creates an instance of the {@link RecommendationPreferences.Builder}
* avoiding the need to create one manually via {@link RecommendationPreferences#builder()}.
*
*
* When the {@link Consumer} completes, {@link RecommendationPreferences.Builder#build()} is called immediately
* and its result is passed to {@link #recommendationPreferences(RecommendationPreferences)}.
*
* @param recommendationPreferences
* a consumer that will call methods on {@link RecommendationPreferences.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recommendationPreferences(RecommendationPreferences)
*/
default Builder recommendationPreferences(Consumer recommendationPreferences) {
return recommendationPreferences(RecommendationPreferences.builder().applyMutation(recommendationPreferences).build());
}
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends ComputeOptimizerRequest.BuilderImpl implements Builder {
private List accountIds = DefaultSdkAutoConstructList.getInstance();
private List filters = DefaultSdkAutoConstructList.getInstance();
private List fieldsToExport = DefaultSdkAutoConstructList.getInstance();
private S3DestinationConfig s3DestinationConfig;
private String fileFormat;
private Boolean includeMemberAccounts;
private RecommendationPreferences recommendationPreferences;
private BuilderImpl() {
}
private BuilderImpl(ExportRdsDatabaseRecommendationsRequest model) {
super(model);
accountIds(model.accountIds);
filters(model.filters);
fieldsToExportWithStrings(model.fieldsToExport);
s3DestinationConfig(model.s3DestinationConfig);
fileFormat(model.fileFormat);
includeMemberAccounts(model.includeMemberAccounts);
recommendationPreferences(model.recommendationPreferences);
}
public final Collection getAccountIds() {
if (accountIds instanceof SdkAutoConstructList) {
return null;
}
return accountIds;
}
public final void setAccountIds(Collection accountIds) {
this.accountIds = AccountIdsCopier.copy(accountIds);
}
@Override
public final Builder accountIds(Collection accountIds) {
this.accountIds = AccountIdsCopier.copy(accountIds);
return this;
}
@Override
@SafeVarargs
public final Builder accountIds(String... accountIds) {
accountIds(Arrays.asList(accountIds));
return this;
}
public final List getFilters() {
List result = RDSDBRecommendationFiltersCopier.copyToBuilder(this.filters);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setFilters(Collection filters) {
this.filters = RDSDBRecommendationFiltersCopier.copyFromBuilder(filters);
}
@Override
public final Builder filters(Collection filters) {
this.filters = RDSDBRecommendationFiltersCopier.copy(filters);
return this;
}
@Override
@SafeVarargs
public final Builder filters(RDSDBRecommendationFilter... filters) {
filters(Arrays.asList(filters));
return this;
}
@Override
@SafeVarargs
public final Builder filters(Consumer... filters) {
filters(Stream.of(filters).map(c -> RDSDBRecommendationFilter.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection getFieldsToExport() {
if (fieldsToExport instanceof SdkAutoConstructList) {
return null;
}
return fieldsToExport;
}
public final void setFieldsToExport(Collection fieldsToExport) {
this.fieldsToExport = ExportableRDSDBFieldsCopier.copy(fieldsToExport);
}
@Override
public final Builder fieldsToExportWithStrings(Collection fieldsToExport) {
this.fieldsToExport = ExportableRDSDBFieldsCopier.copy(fieldsToExport);
return this;
}
@Override
@SafeVarargs
public final Builder fieldsToExportWithStrings(String... fieldsToExport) {
fieldsToExportWithStrings(Arrays.asList(fieldsToExport));
return this;
}
@Override
public final Builder fieldsToExport(Collection fieldsToExport) {
this.fieldsToExport = ExportableRDSDBFieldsCopier.copyEnumToString(fieldsToExport);
return this;
}
@Override
@SafeVarargs
public final Builder fieldsToExport(ExportableRDSDBField... fieldsToExport) {
fieldsToExport(Arrays.asList(fieldsToExport));
return this;
}
public final S3DestinationConfig.Builder getS3DestinationConfig() {
return s3DestinationConfig != null ? s3DestinationConfig.toBuilder() : null;
}
public final void setS3DestinationConfig(S3DestinationConfig.BuilderImpl s3DestinationConfig) {
this.s3DestinationConfig = s3DestinationConfig != null ? s3DestinationConfig.build() : null;
}
@Override
public final Builder s3DestinationConfig(S3DestinationConfig s3DestinationConfig) {
this.s3DestinationConfig = s3DestinationConfig;
return this;
}
public final String getFileFormat() {
return fileFormat;
}
public final void setFileFormat(String fileFormat) {
this.fileFormat = fileFormat;
}
@Override
public final Builder fileFormat(String fileFormat) {
this.fileFormat = fileFormat;
return this;
}
@Override
public final Builder fileFormat(FileFormat fileFormat) {
this.fileFormat(fileFormat == null ? null : fileFormat.toString());
return this;
}
public final Boolean getIncludeMemberAccounts() {
return includeMemberAccounts;
}
public final void setIncludeMemberAccounts(Boolean includeMemberAccounts) {
this.includeMemberAccounts = includeMemberAccounts;
}
@Override
public final Builder includeMemberAccounts(Boolean includeMemberAccounts) {
this.includeMemberAccounts = includeMemberAccounts;
return this;
}
public final RecommendationPreferences.Builder getRecommendationPreferences() {
return recommendationPreferences != null ? recommendationPreferences.toBuilder() : null;
}
public final void setRecommendationPreferences(RecommendationPreferences.BuilderImpl recommendationPreferences) {
this.recommendationPreferences = recommendationPreferences != null ? recommendationPreferences.build() : null;
}
@Override
public final Builder recommendationPreferences(RecommendationPreferences recommendationPreferences) {
this.recommendationPreferences = recommendationPreferences;
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 ExportRdsDatabaseRecommendationsRequest build() {
return new ExportRdsDatabaseRecommendationsRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}