software.amazon.awssdk.services.lambda.model.GetProvisionedConcurrencyConfigResponse Maven / Gradle / Ivy
Show all versions of lambda 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.lambda.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.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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetProvisionedConcurrencyConfigResponse extends LambdaResponse implements
ToCopyableBuilder {
private static final SdkField REQUESTED_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("RequestedProvisionedConcurrentExecutions")
.getter(getter(GetProvisionedConcurrencyConfigResponse::requestedProvisionedConcurrentExecutions))
.setter(setter(Builder::requestedProvisionedConcurrentExecutions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("RequestedProvisionedConcurrentExecutions").build()).build();
private static final SdkField AVAILABLE_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("AvailableProvisionedConcurrentExecutions")
.getter(getter(GetProvisionedConcurrencyConfigResponse::availableProvisionedConcurrentExecutions))
.setter(setter(Builder::availableProvisionedConcurrentExecutions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("AvailableProvisionedConcurrentExecutions").build()).build();
private static final SdkField ALLOCATED_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD = SdkField
. builder(MarshallingType.INTEGER)
.memberName("AllocatedProvisionedConcurrentExecutions")
.getter(getter(GetProvisionedConcurrencyConfigResponse::allocatedProvisionedConcurrentExecutions))
.setter(setter(Builder::allocatedProvisionedConcurrentExecutions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("AllocatedProvisionedConcurrentExecutions").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(GetProvisionedConcurrencyConfigResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatusReason").getter(getter(GetProvisionedConcurrencyConfigResponse::statusReason))
.setter(setter(Builder::statusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusReason").build()).build();
private static final SdkField LAST_MODIFIED_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastModified").getter(getter(GetProvisionedConcurrencyConfigResponse::lastModified))
.setter(setter(Builder::lastModified))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModified").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
REQUESTED_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD, AVAILABLE_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD,
ALLOCATED_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD, STATUS_FIELD, STATUS_REASON_FIELD, LAST_MODIFIED_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("RequestedProvisionedConcurrentExecutions", REQUESTED_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD);
put("AvailableProvisionedConcurrentExecutions", AVAILABLE_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD);
put("AllocatedProvisionedConcurrentExecutions", ALLOCATED_PROVISIONED_CONCURRENT_EXECUTIONS_FIELD);
put("Status", STATUS_FIELD);
put("StatusReason", STATUS_REASON_FIELD);
put("LastModified", LAST_MODIFIED_FIELD);
}
});
private final Integer requestedProvisionedConcurrentExecutions;
private final Integer availableProvisionedConcurrentExecutions;
private final Integer allocatedProvisionedConcurrentExecutions;
private final String status;
private final String statusReason;
private final String lastModified;
private GetProvisionedConcurrencyConfigResponse(BuilderImpl builder) {
super(builder);
this.requestedProvisionedConcurrentExecutions = builder.requestedProvisionedConcurrentExecutions;
this.availableProvisionedConcurrentExecutions = builder.availableProvisionedConcurrentExecutions;
this.allocatedProvisionedConcurrentExecutions = builder.allocatedProvisionedConcurrentExecutions;
this.status = builder.status;
this.statusReason = builder.statusReason;
this.lastModified = builder.lastModified;
}
/**
*
* The amount of provisioned concurrency requested.
*
*
* @return The amount of provisioned concurrency requested.
*/
public final Integer requestedProvisionedConcurrentExecutions() {
return requestedProvisionedConcurrentExecutions;
}
/**
*
* The amount of provisioned concurrency available.
*
*
* @return The amount of provisioned concurrency available.
*/
public final Integer availableProvisionedConcurrentExecutions() {
return availableProvisionedConcurrentExecutions;
}
/**
*
* The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary
* deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the function
* versions.
*
*
* @return The amount of provisioned concurrency allocated. When a weighted alias is used during linear and canary
* deployments, this value fluctuates depending on the amount of concurrency that is provisioned for the
* function versions.
*/
public final Integer allocatedProvisionedConcurrentExecutions() {
return allocatedProvisionedConcurrentExecutions;
}
/**
*
* The status of the allocation process.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ProvisionedConcurrencyStatusEnum#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The status of the allocation process.
* @see ProvisionedConcurrencyStatusEnum
*/
public final ProvisionedConcurrencyStatusEnum status() {
return ProvisionedConcurrencyStatusEnum.fromValue(status);
}
/**
*
* The status of the allocation process.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ProvisionedConcurrencyStatusEnum#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The status of the allocation process.
* @see ProvisionedConcurrencyStatusEnum
*/
public final String statusAsString() {
return status;
}
/**
*
* For failed allocations, the reason that provisioned concurrency could not be allocated.
*
*
* @return For failed allocations, the reason that provisioned concurrency could not be allocated.
*/
public final String statusReason() {
return statusReason;
}
/**
*
* The date and time that a user last updated the configuration, in ISO 8601 format.
*
*
* @return The date and time that a user last updated the configuration, in ISO 8601 format.
*/
public final String lastModified() {
return lastModified;
}
@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(requestedProvisionedConcurrentExecutions());
hashCode = 31 * hashCode + Objects.hashCode(availableProvisionedConcurrentExecutions());
hashCode = 31 * hashCode + Objects.hashCode(allocatedProvisionedConcurrentExecutions());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusReason());
hashCode = 31 * hashCode + Objects.hashCode(lastModified());
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 GetProvisionedConcurrencyConfigResponse)) {
return false;
}
GetProvisionedConcurrencyConfigResponse other = (GetProvisionedConcurrencyConfigResponse) obj;
return Objects.equals(requestedProvisionedConcurrentExecutions(), other.requestedProvisionedConcurrentExecutions())
&& Objects.equals(availableProvisionedConcurrentExecutions(), other.availableProvisionedConcurrentExecutions())
&& Objects.equals(allocatedProvisionedConcurrentExecutions(), other.allocatedProvisionedConcurrentExecutions())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(statusReason(), other.statusReason()) && Objects.equals(lastModified(), other.lastModified());
}
/**
* 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("GetProvisionedConcurrencyConfigResponse")
.add("RequestedProvisionedConcurrentExecutions", requestedProvisionedConcurrentExecutions())
.add("AvailableProvisionedConcurrentExecutions", availableProvisionedConcurrentExecutions())
.add("AllocatedProvisionedConcurrentExecutions", allocatedProvisionedConcurrentExecutions())
.add("Status", statusAsString()).add("StatusReason", statusReason()).add("LastModified", lastModified()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RequestedProvisionedConcurrentExecutions":
return Optional.ofNullable(clazz.cast(requestedProvisionedConcurrentExecutions()));
case "AvailableProvisionedConcurrentExecutions":
return Optional.ofNullable(clazz.cast(availableProvisionedConcurrentExecutions()));
case "AllocatedProvisionedConcurrentExecutions":
return Optional.ofNullable(clazz.cast(allocatedProvisionedConcurrentExecutions()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "StatusReason":
return Optional.ofNullable(clazz.cast(statusReason()));
case "LastModified":
return Optional.ofNullable(clazz.cast(lastModified()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function