software.amazon.awssdk.services.costexplorer.model.GetRightsizingRecommendationRequest Maven / Gradle / Ivy
Show all versions of costexplorer 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.costexplorer.model;
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.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 GetRightsizingRecommendationRequest extends CostExplorerRequest implements
ToCopyableBuilder {
private static final SdkField FILTER_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Filter").getter(getter(GetRightsizingRecommendationRequest::filter)).setter(setter(Builder::filter))
.constructor(Expression::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Filter").build()).build();
private static final SdkField CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Configuration")
.getter(getter(GetRightsizingRecommendationRequest::configuration)).setter(setter(Builder::configuration))
.constructor(RightsizingRecommendationConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Configuration").build()).build();
private static final SdkField SERVICE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Service")
.getter(getter(GetRightsizingRecommendationRequest::service)).setter(setter(Builder::service))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Service").build()).build();
private static final SdkField PAGE_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("PageSize").getter(getter(GetRightsizingRecommendationRequest::pageSize))
.setter(setter(Builder::pageSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PageSize").build()).build();
private static final SdkField NEXT_PAGE_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NextPageToken").getter(getter(GetRightsizingRecommendationRequest::nextPageToken))
.setter(setter(Builder::nextPageToken))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextPageToken").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FILTER_FIELD,
CONFIGURATION_FIELD, SERVICE_FIELD, PAGE_SIZE_FIELD, NEXT_PAGE_TOKEN_FIELD));
private final Expression filter;
private final RightsizingRecommendationConfiguration configuration;
private final String service;
private final Integer pageSize;
private final String nextPageToken;
private GetRightsizingRecommendationRequest(BuilderImpl builder) {
super(builder);
this.filter = builder.filter;
this.configuration = builder.configuration;
this.service = builder.service;
this.pageSize = builder.pageSize;
this.nextPageToken = builder.nextPageToken;
}
/**
* Returns the value of the Filter property for this object.
*
* @return The value of the Filter property for this object.
*/
public final Expression filter() {
return filter;
}
/**
*
* You can use Configuration to customize recommendations across two attributes. You can choose to view
* recommendations for instances within the same instance families or across different instance families. You can
* also choose to view your estimated savings that are associated with recommendations with consideration of
* existing Savings Plans or RI benefits, or neither.
*
*
* @return You can use Configuration to customize recommendations across two attributes. You can choose to view
* recommendations for instances within the same instance families or across different instance families.
* You can also choose to view your estimated savings that are associated with recommendations with
* consideration of existing Savings Plans or RI benefits, or neither.
*/
public final RightsizingRecommendationConfiguration configuration() {
return configuration;
}
/**
*
* The specific service that you want recommendations for. The only valid value for
* GetRightsizingRecommendation
is "AmazonEC2
".
*
*
* @return The specific service that you want recommendations for. The only valid value for
* GetRightsizingRecommendation
is "AmazonEC2
".
*/
public final String service() {
return service;
}
/**
*
* The number of recommendations that you want returned in a single response object.
*
*
* @return The number of recommendations that you want returned in a single response object.
*/
public final Integer pageSize() {
return pageSize;
}
/**
*
* The pagination token that indicates the next set of results that you want to retrieve.
*
*
* @return The pagination token that indicates the next set of results that you want to retrieve.
*/
public final String nextPageToken() {
return nextPageToken;
}
@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(filter());
hashCode = 31 * hashCode + Objects.hashCode(configuration());
hashCode = 31 * hashCode + Objects.hashCode(service());
hashCode = 31 * hashCode + Objects.hashCode(pageSize());
hashCode = 31 * hashCode + Objects.hashCode(nextPageToken());
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 GetRightsizingRecommendationRequest)) {
return false;
}
GetRightsizingRecommendationRequest other = (GetRightsizingRecommendationRequest) obj;
return Objects.equals(filter(), other.filter()) && Objects.equals(configuration(), other.configuration())
&& Objects.equals(service(), other.service()) && Objects.equals(pageSize(), other.pageSize())
&& Objects.equals(nextPageToken(), other.nextPageToken());
}
/**
* 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("GetRightsizingRecommendationRequest").add("Filter", filter())
.add("Configuration", configuration()).add("Service", service()).add("PageSize", pageSize())
.add("NextPageToken", nextPageToken()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Filter":
return Optional.ofNullable(clazz.cast(filter()));
case "Configuration":
return Optional.ofNullable(clazz.cast(configuration()));
case "Service":
return Optional.ofNullable(clazz.cast(service()));
case "PageSize":
return Optional.ofNullable(clazz.cast(pageSize()));
case "NextPageToken":
return Optional.ofNullable(clazz.cast(nextPageToken()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function