
software.amazon.awssdk.services.securityhub.model.AwsApiGatewayV2RouteSettings Maven / Gradle / Ivy
/*
* 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.securityhub.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;
/**
*
* Contains route settings for a stage.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class AwsApiGatewayV2RouteSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DETAILED_METRICS_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("DetailedMetricsEnabled").getter(getter(AwsApiGatewayV2RouteSettings::detailedMetricsEnabled))
.setter(setter(Builder::detailedMetricsEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DetailedMetricsEnabled").build())
.build();
private static final SdkField LOGGING_LEVEL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LoggingLevel").getter(getter(AwsApiGatewayV2RouteSettings::loggingLevel))
.setter(setter(Builder::loggingLevel))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LoggingLevel").build()).build();
private static final SdkField DATA_TRACE_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("DataTraceEnabled").getter(getter(AwsApiGatewayV2RouteSettings::dataTraceEnabled))
.setter(setter(Builder::dataTraceEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataTraceEnabled").build()).build();
private static final SdkField THROTTLING_BURST_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ThrottlingBurstLimit").getter(getter(AwsApiGatewayV2RouteSettings::throttlingBurstLimit))
.setter(setter(Builder::throttlingBurstLimit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThrottlingBurstLimit").build())
.build();
private static final SdkField THROTTLING_RATE_LIMIT_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.memberName("ThrottlingRateLimit").getter(getter(AwsApiGatewayV2RouteSettings::throttlingRateLimit))
.setter(setter(Builder::throttlingRateLimit))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ThrottlingRateLimit").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
DETAILED_METRICS_ENABLED_FIELD, LOGGING_LEVEL_FIELD, DATA_TRACE_ENABLED_FIELD, THROTTLING_BURST_LIMIT_FIELD,
THROTTLING_RATE_LIMIT_FIELD));
private static final long serialVersionUID = 1L;
private final Boolean detailedMetricsEnabled;
private final String loggingLevel;
private final Boolean dataTraceEnabled;
private final Integer throttlingBurstLimit;
private final Double throttlingRateLimit;
private AwsApiGatewayV2RouteSettings(BuilderImpl builder) {
this.detailedMetricsEnabled = builder.detailedMetricsEnabled;
this.loggingLevel = builder.loggingLevel;
this.dataTraceEnabled = builder.dataTraceEnabled;
this.throttlingBurstLimit = builder.throttlingBurstLimit;
this.throttlingRateLimit = builder.throttlingRateLimit;
}
/**
*
* Indicates whether detailed metrics are enabled.
*
*
* @return Indicates whether detailed metrics are enabled.
*/
public final Boolean detailedMetricsEnabled() {
return detailedMetricsEnabled;
}
/**
*
* The logging level. The logging level affects the log entries that are pushed to CloudWatch Logs. Supported only
* for WebSocket APIs.
*
*
* If the logging level is ERROR
, then the logs only include error-level entries.
*
*
* If the logging level is INFO
, then the logs include both ERROR
events and extra
* informational events.
*
*
* Valid values: OFF
| ERROR
| INFO
*
*
* @return The logging level. The logging level affects the log entries that are pushed to CloudWatch Logs.
* Supported only for WebSocket APIs.
*
* If the logging level is ERROR
, then the logs only include error-level entries.
*
*
* If the logging level is INFO
, then the logs include both ERROR
events and extra
* informational events.
*
*
* Valid values: OFF
| ERROR
| INFO
*/
public final String loggingLevel() {
return loggingLevel;
}
/**
*
* Indicates whether data trace logging is enabled. Data trace logging affects the log entries that are pushed to
* CloudWatch Logs. Supported only for WebSocket APIs.
*
*
* @return Indicates whether data trace logging is enabled. Data trace logging affects the log entries that are
* pushed to CloudWatch Logs. Supported only for WebSocket APIs.
*/
public final Boolean dataTraceEnabled() {
return dataTraceEnabled;
}
/**
*
* The throttling burst limit.
*
*
* @return The throttling burst limit.
*/
public final Integer throttlingBurstLimit() {
return throttlingBurstLimit;
}
/**
*
* The throttling rate limit.
*
*
* @return The throttling rate limit.
*/
public final Double throttlingRateLimit() {
return throttlingRateLimit;
}
@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 + Objects.hashCode(detailedMetricsEnabled());
hashCode = 31 * hashCode + Objects.hashCode(loggingLevel());
hashCode = 31 * hashCode + Objects.hashCode(dataTraceEnabled());
hashCode = 31 * hashCode + Objects.hashCode(throttlingBurstLimit());
hashCode = 31 * hashCode + Objects.hashCode(throttlingRateLimit());
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 AwsApiGatewayV2RouteSettings)) {
return false;
}
AwsApiGatewayV2RouteSettings other = (AwsApiGatewayV2RouteSettings) obj;
return Objects.equals(detailedMetricsEnabled(), other.detailedMetricsEnabled())
&& Objects.equals(loggingLevel(), other.loggingLevel())
&& Objects.equals(dataTraceEnabled(), other.dataTraceEnabled())
&& Objects.equals(throttlingBurstLimit(), other.throttlingBurstLimit())
&& Objects.equals(throttlingRateLimit(), other.throttlingRateLimit());
}
/**
* 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("AwsApiGatewayV2RouteSettings").add("DetailedMetricsEnabled", detailedMetricsEnabled())
.add("LoggingLevel", loggingLevel()).add("DataTraceEnabled", dataTraceEnabled())
.add("ThrottlingBurstLimit", throttlingBurstLimit()).add("ThrottlingRateLimit", throttlingRateLimit()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DetailedMetricsEnabled":
return Optional.ofNullable(clazz.cast(detailedMetricsEnabled()));
case "LoggingLevel":
return Optional.ofNullable(clazz.cast(loggingLevel()));
case "DataTraceEnabled":
return Optional.ofNullable(clazz.cast(dataTraceEnabled()));
case "ThrottlingBurstLimit":
return Optional.ofNullable(clazz.cast(throttlingBurstLimit()));
case "ThrottlingRateLimit":
return Optional.ofNullable(clazz.cast(throttlingRateLimit()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function