
software.amazon.awssdk.services.lambda.model.CreateFunctionResponse Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.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.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;
/**
*
* Details about a function's configuration.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateFunctionResponse extends LambdaResponse implements
ToCopyableBuilder {
private static final SdkField FUNCTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::functionName)).setter(setter(Builder::functionName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FunctionName").build()).build();
private static final SdkField FUNCTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::functionArn)).setter(setter(Builder::functionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FunctionArn").build()).build();
private static final SdkField RUNTIME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::runtimeAsString)).setter(setter(Builder::runtime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Runtime").build()).build();
private static final SdkField ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::role)).setter(setter(Builder::role))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Role").build()).build();
private static final SdkField HANDLER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::handler)).setter(setter(Builder::handler))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Handler").build()).build();
private static final SdkField CODE_SIZE_FIELD = SdkField. builder(MarshallingType.LONG)
.getter(getter(CreateFunctionResponse::codeSize)).setter(setter(Builder::codeSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeSize").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField TIMEOUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(CreateFunctionResponse::timeout)).setter(setter(Builder::timeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Timeout").build()).build();
private static final SdkField MEMORY_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(CreateFunctionResponse::memorySize)).setter(setter(Builder::memorySize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemorySize").build()).build();
private static final SdkField LAST_MODIFIED_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::lastModified)).setter(setter(Builder::lastModified))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModified").build()).build();
private static final SdkField CODE_SHA256_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::codeSha256)).setter(setter(Builder::codeSha256))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CodeSha256").build()).build();
private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::version)).setter(setter(Builder::version))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Version").build()).build();
private static final SdkField VPC_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(CreateFunctionResponse::vpcConfig))
.setter(setter(Builder::vpcConfig)).constructor(VpcConfigResponse::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfig").build()).build();
private static final SdkField DEAD_LETTER_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(CreateFunctionResponse::deadLetterConfig))
.setter(setter(Builder::deadLetterConfig)).constructor(DeadLetterConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeadLetterConfig").build()).build();
private static final SdkField ENVIRONMENT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(CreateFunctionResponse::environment))
.setter(setter(Builder::environment)).constructor(EnvironmentResponse::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Environment").build()).build();
private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::kmsKeyArn)).setter(setter(Builder::kmsKeyArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KMSKeyArn").build()).build();
private static final SdkField TRACING_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(CreateFunctionResponse::tracingConfig))
.setter(setter(Builder::tracingConfig)).constructor(TracingConfigResponse::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TracingConfig").build()).build();
private static final SdkField MASTER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::masterArn)).setter(setter(Builder::masterArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MasterArn").build()).build();
private static final SdkField REVISION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::revisionId)).setter(setter(Builder::revisionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RevisionId").build()).build();
private static final SdkField> LAYERS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(CreateFunctionResponse::layers))
.setter(setter(Builder::layers))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Layers").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Layer::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField STATE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::stateAsString)).setter(setter(Builder::state))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("State").build()).build();
private static final SdkField STATE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::stateReason)).setter(setter(Builder::stateReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StateReason").build()).build();
private static final SdkField STATE_REASON_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::stateReasonCodeAsString)).setter(setter(Builder::stateReasonCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StateReasonCode").build()).build();
private static final SdkField LAST_UPDATE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::lastUpdateStatusAsString)).setter(setter(Builder::lastUpdateStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdateStatus").build()).build();
private static final SdkField LAST_UPDATE_STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::lastUpdateStatusReason)).setter(setter(Builder::lastUpdateStatusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdateStatusReason").build())
.build();
private static final SdkField LAST_UPDATE_STATUS_REASON_CODE_FIELD = SdkField
. builder(MarshallingType.STRING)
.getter(getter(CreateFunctionResponse::lastUpdateStatusReasonCodeAsString))
.setter(setter(Builder::lastUpdateStatusReasonCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastUpdateStatusReasonCode").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FUNCTION_NAME_FIELD,
FUNCTION_ARN_FIELD, RUNTIME_FIELD, ROLE_FIELD, HANDLER_FIELD, CODE_SIZE_FIELD, DESCRIPTION_FIELD, TIMEOUT_FIELD,
MEMORY_SIZE_FIELD, LAST_MODIFIED_FIELD, CODE_SHA256_FIELD, VERSION_FIELD, VPC_CONFIG_FIELD, DEAD_LETTER_CONFIG_FIELD,
ENVIRONMENT_FIELD, KMS_KEY_ARN_FIELD, TRACING_CONFIG_FIELD, MASTER_ARN_FIELD, REVISION_ID_FIELD, LAYERS_FIELD,
STATE_FIELD, STATE_REASON_FIELD, STATE_REASON_CODE_FIELD, LAST_UPDATE_STATUS_FIELD, LAST_UPDATE_STATUS_REASON_FIELD,
LAST_UPDATE_STATUS_REASON_CODE_FIELD));
private final String functionName;
private final String functionArn;
private final String runtime;
private final String role;
private final String handler;
private final Long codeSize;
private final String description;
private final Integer timeout;
private final Integer memorySize;
private final String lastModified;
private final String codeSha256;
private final String version;
private final VpcConfigResponse vpcConfig;
private final DeadLetterConfig deadLetterConfig;
private final EnvironmentResponse environment;
private final String kmsKeyArn;
private final TracingConfigResponse tracingConfig;
private final String masterArn;
private final String revisionId;
private final List layers;
private final String state;
private final String stateReason;
private final String stateReasonCode;
private final String lastUpdateStatus;
private final String lastUpdateStatusReason;
private final String lastUpdateStatusReasonCode;
private CreateFunctionResponse(BuilderImpl builder) {
super(builder);
this.functionName = builder.functionName;
this.functionArn = builder.functionArn;
this.runtime = builder.runtime;
this.role = builder.role;
this.handler = builder.handler;
this.codeSize = builder.codeSize;
this.description = builder.description;
this.timeout = builder.timeout;
this.memorySize = builder.memorySize;
this.lastModified = builder.lastModified;
this.codeSha256 = builder.codeSha256;
this.version = builder.version;
this.vpcConfig = builder.vpcConfig;
this.deadLetterConfig = builder.deadLetterConfig;
this.environment = builder.environment;
this.kmsKeyArn = builder.kmsKeyArn;
this.tracingConfig = builder.tracingConfig;
this.masterArn = builder.masterArn;
this.revisionId = builder.revisionId;
this.layers = builder.layers;
this.state = builder.state;
this.stateReason = builder.stateReason;
this.stateReasonCode = builder.stateReasonCode;
this.lastUpdateStatus = builder.lastUpdateStatus;
this.lastUpdateStatusReason = builder.lastUpdateStatusReason;
this.lastUpdateStatusReasonCode = builder.lastUpdateStatusReasonCode;
}
/**
*
* The name of the function.
*
*
* @return The name of the function.
*/
public String functionName() {
return functionName;
}
/**
*
* The function's Amazon Resource Name (ARN).
*
*
* @return The function's Amazon Resource Name (ARN).
*/
public String functionArn() {
return functionArn;
}
/**
*
* The runtime environment for the Lambda function.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #runtime} will
* return {@link Runtime#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #runtimeAsString}.
*
*
* @return The runtime environment for the Lambda function.
* @see Runtime
*/
public Runtime runtime() {
return Runtime.fromValue(runtime);
}
/**
*
* The runtime environment for the Lambda function.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #runtime} will
* return {@link Runtime#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #runtimeAsString}.
*
*
* @return The runtime environment for the Lambda function.
* @see Runtime
*/
public String runtimeAsString() {
return runtime;
}
/**
*
* The function's execution role.
*
*
* @return The function's execution role.
*/
public String role() {
return role;
}
/**
*
* The function that Lambda calls to begin executing your function.
*
*
* @return The function that Lambda calls to begin executing your function.
*/
public String handler() {
return handler;
}
/**
*
* The size of the function's deployment package, in bytes.
*
*
* @return The size of the function's deployment package, in bytes.
*/
public Long codeSize() {
return codeSize;
}
/**
*
* The function's description.
*
*
* @return The function's description.
*/
public String description() {
return description;
}
/**
*
* The amount of time that Lambda allows a function to run before stopping it.
*
*
* @return The amount of time that Lambda allows a function to run before stopping it.
*/
public Integer timeout() {
return timeout;
}
/**
*
* The memory that's allocated to the function.
*
*
* @return The memory that's allocated to the function.
*/
public Integer memorySize() {
return memorySize;
}
/**
*
* The date and time that the function was last updated, in ISO-8601
* format (YYYY-MM-DDThh:mm:ss.sTZD).
*
*
* @return The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
*/
public String lastModified() {
return lastModified;
}
/**
*
* The SHA256 hash of the function's deployment package.
*
*
* @return The SHA256 hash of the function's deployment package.
*/
public String codeSha256() {
return codeSha256;
}
/**
*
* The version of the Lambda function.
*
*
* @return The version of the Lambda function.
*/
public String version() {
return version;
}
/**
*
* The function's networking configuration.
*
*
* @return The function's networking configuration.
*/
public VpcConfigResponse vpcConfig() {
return vpcConfig;
}
/**
*
* The function's dead letter queue.
*
*
* @return The function's dead letter queue.
*/
public DeadLetterConfig deadLetterConfig() {
return deadLetterConfig;
}
/**
*
* The function's environment variables.
*
*
* @return The function's environment variables.
*/
public EnvironmentResponse environment() {
return environment;
}
/**
*
* The KMS key that's used to encrypt the function's environment variables. This key is only returned if you've
* configured a customer managed CMK.
*
*
* @return The KMS key that's used to encrypt the function's environment variables. This key is only returned if
* you've configured a customer managed CMK.
*/
public String kmsKeyArn() {
return kmsKeyArn;
}
/**
*
* The function's AWS X-Ray tracing configuration.
*
*
* @return The function's AWS X-Ray tracing configuration.
*/
public TracingConfigResponse tracingConfig() {
return tracingConfig;
}
/**
*
* For Lambda@Edge functions, the ARN of the master function.
*
*
* @return For Lambda@Edge functions, the ARN of the master function.
*/
public String masterArn() {
return masterArn;
}
/**
*
* The latest updated revision of the function or alias.
*
*
* @return The latest updated revision of the function or alias.
*/
public String revisionId() {
return revisionId;
}
/**
* Returns true if the Layers property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasLayers() {
return layers != null && !(layers instanceof SdkAutoConstructList);
}
/**
*
* The function's layers.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasLayers()} to see if a value was sent in this field.
*
*
* @return The function's
* layers.
*/
public List layers() {
return layers;
}
/**
*
* The current state of the function. When the state is Inactive
, you can reactivate the function by
* invoking it.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return
* {@link State#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stateAsString}.
*
*
* @return The current state of the function. When the state is Inactive
, you can reactivate the
* function by invoking it.
* @see State
*/
public State state() {
return State.fromValue(state);
}
/**
*
* The current state of the function. When the state is Inactive
, you can reactivate the function by
* invoking it.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #state} will return
* {@link State#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #stateAsString}.
*
*
* @return The current state of the function. When the state is Inactive
, you can reactivate the
* function by invoking it.
* @see State
*/
public String stateAsString() {
return state;
}
/**
*
* The reason for the function's current state.
*
*
* @return The reason for the function's current state.
*/
public String stateReason() {
return stateReason;
}
/**
*
* The reason code for the function's current state. When the code is Creating
, you can't invoke or
* modify the function.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #stateReasonCode}
* will return {@link StateReasonCode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #stateReasonCodeAsString}.
*
*
* @return The reason code for the function's current state. When the code is Creating
, you can't
* invoke or modify the function.
* @see StateReasonCode
*/
public StateReasonCode stateReasonCode() {
return StateReasonCode.fromValue(stateReasonCode);
}
/**
*
* The reason code for the function's current state. When the code is Creating
, you can't invoke or
* modify the function.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #stateReasonCode}
* will return {@link StateReasonCode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #stateReasonCodeAsString}.
*
*
* @return The reason code for the function's current state. When the code is Creating
, you can't
* invoke or modify the function.
* @see StateReasonCode
*/
public String stateReasonCodeAsString() {
return stateReasonCode;
}
/**
*
* The status of the last update that was performed on the function.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #lastUpdateStatus}
* will return {@link LastUpdateStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #lastUpdateStatusAsString}.
*
*
* @return The status of the last update that was performed on the function.
* @see LastUpdateStatus
*/
public LastUpdateStatus lastUpdateStatus() {
return LastUpdateStatus.fromValue(lastUpdateStatus);
}
/**
*
* The status of the last update that was performed on the function.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #lastUpdateStatus}
* will return {@link LastUpdateStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #lastUpdateStatusAsString}.
*
*
* @return The status of the last update that was performed on the function.
* @see LastUpdateStatus
*/
public String lastUpdateStatusAsString() {
return lastUpdateStatus;
}
/**
*
* The reason for the last update that was performed on the function.
*
*
* @return The reason for the last update that was performed on the function.
*/
public String lastUpdateStatusReason() {
return lastUpdateStatusReason;
}
/**
*
* The reason code for the last update that was performed on the function.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #lastUpdateStatusReasonCode} will return {@link LastUpdateStatusReasonCode#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #lastUpdateStatusReasonCodeAsString}.
*
*
* @return The reason code for the last update that was performed on the function.
* @see LastUpdateStatusReasonCode
*/
public LastUpdateStatusReasonCode lastUpdateStatusReasonCode() {
return LastUpdateStatusReasonCode.fromValue(lastUpdateStatusReasonCode);
}
/**
*
* The reason code for the last update that was performed on the function.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #lastUpdateStatusReasonCode} will return {@link LastUpdateStatusReasonCode#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #lastUpdateStatusReasonCodeAsString}.
*
*
* @return The reason code for the last update that was performed on the function.
* @see LastUpdateStatusReasonCode
*/
public String lastUpdateStatusReasonCodeAsString() {
return lastUpdateStatusReasonCode;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(functionName());
hashCode = 31 * hashCode + Objects.hashCode(functionArn());
hashCode = 31 * hashCode + Objects.hashCode(runtimeAsString());
hashCode = 31 * hashCode + Objects.hashCode(role());
hashCode = 31 * hashCode + Objects.hashCode(handler());
hashCode = 31 * hashCode + Objects.hashCode(codeSize());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(timeout());
hashCode = 31 * hashCode + Objects.hashCode(memorySize());
hashCode = 31 * hashCode + Objects.hashCode(lastModified());
hashCode = 31 * hashCode + Objects.hashCode(codeSha256());
hashCode = 31 * hashCode + Objects.hashCode(version());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfig());
hashCode = 31 * hashCode + Objects.hashCode(deadLetterConfig());
hashCode = 31 * hashCode + Objects.hashCode(environment());
hashCode = 31 * hashCode + Objects.hashCode(kmsKeyArn());
hashCode = 31 * hashCode + Objects.hashCode(tracingConfig());
hashCode = 31 * hashCode + Objects.hashCode(masterArn());
hashCode = 31 * hashCode + Objects.hashCode(revisionId());
hashCode = 31 * hashCode + Objects.hashCode(layers());
hashCode = 31 * hashCode + Objects.hashCode(stateAsString());
hashCode = 31 * hashCode + Objects.hashCode(stateReason());
hashCode = 31 * hashCode + Objects.hashCode(stateReasonCodeAsString());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdateStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdateStatusReason());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdateStatusReasonCodeAsString());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof CreateFunctionResponse)) {
return false;
}
CreateFunctionResponse other = (CreateFunctionResponse) obj;
return Objects.equals(functionName(), other.functionName()) && Objects.equals(functionArn(), other.functionArn())
&& Objects.equals(runtimeAsString(), other.runtimeAsString()) && Objects.equals(role(), other.role())
&& Objects.equals(handler(), other.handler()) && Objects.equals(codeSize(), other.codeSize())
&& Objects.equals(description(), other.description()) && Objects.equals(timeout(), other.timeout())
&& Objects.equals(memorySize(), other.memorySize()) && Objects.equals(lastModified(), other.lastModified())
&& Objects.equals(codeSha256(), other.codeSha256()) && Objects.equals(version(), other.version())
&& Objects.equals(vpcConfig(), other.vpcConfig()) && Objects.equals(deadLetterConfig(), other.deadLetterConfig())
&& Objects.equals(environment(), other.environment()) && Objects.equals(kmsKeyArn(), other.kmsKeyArn())
&& Objects.equals(tracingConfig(), other.tracingConfig()) && Objects.equals(masterArn(), other.masterArn())
&& Objects.equals(revisionId(), other.revisionId()) && Objects.equals(layers(), other.layers())
&& Objects.equals(stateAsString(), other.stateAsString()) && Objects.equals(stateReason(), other.stateReason())
&& Objects.equals(stateReasonCodeAsString(), other.stateReasonCodeAsString())
&& Objects.equals(lastUpdateStatusAsString(), other.lastUpdateStatusAsString())
&& Objects.equals(lastUpdateStatusReason(), other.lastUpdateStatusReason())
&& Objects.equals(lastUpdateStatusReasonCodeAsString(), other.lastUpdateStatusReasonCodeAsString());
}
/**
* 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 String toString() {
return ToString.builder("CreateFunctionResponse").add("FunctionName", functionName()).add("FunctionArn", functionArn())
.add("Runtime", runtimeAsString()).add("Role", role()).add("Handler", handler()).add("CodeSize", codeSize())
.add("Description", description()).add("Timeout", timeout()).add("MemorySize", memorySize())
.add("LastModified", lastModified()).add("CodeSha256", codeSha256()).add("Version", version())
.add("VpcConfig", vpcConfig()).add("DeadLetterConfig", deadLetterConfig()).add("Environment", environment())
.add("KMSKeyArn", kmsKeyArn()).add("TracingConfig", tracingConfig()).add("MasterArn", masterArn())
.add("RevisionId", revisionId()).add("Layers", layers()).add("State", stateAsString())
.add("StateReason", stateReason()).add("StateReasonCode", stateReasonCodeAsString())
.add("LastUpdateStatus", lastUpdateStatusAsString()).add("LastUpdateStatusReason", lastUpdateStatusReason())
.add("LastUpdateStatusReasonCode", lastUpdateStatusReasonCodeAsString()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FunctionName":
return Optional.ofNullable(clazz.cast(functionName()));
case "FunctionArn":
return Optional.ofNullable(clazz.cast(functionArn()));
case "Runtime":
return Optional.ofNullable(clazz.cast(runtimeAsString()));
case "Role":
return Optional.ofNullable(clazz.cast(role()));
case "Handler":
return Optional.ofNullable(clazz.cast(handler()));
case "CodeSize":
return Optional.ofNullable(clazz.cast(codeSize()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "Timeout":
return Optional.ofNullable(clazz.cast(timeout()));
case "MemorySize":
return Optional.ofNullable(clazz.cast(memorySize()));
case "LastModified":
return Optional.ofNullable(clazz.cast(lastModified()));
case "CodeSha256":
return Optional.ofNullable(clazz.cast(codeSha256()));
case "Version":
return Optional.ofNullable(clazz.cast(version()));
case "VpcConfig":
return Optional.ofNullable(clazz.cast(vpcConfig()));
case "DeadLetterConfig":
return Optional.ofNullable(clazz.cast(deadLetterConfig()));
case "Environment":
return Optional.ofNullable(clazz.cast(environment()));
case "KMSKeyArn":
return Optional.ofNullable(clazz.cast(kmsKeyArn()));
case "TracingConfig":
return Optional.ofNullable(clazz.cast(tracingConfig()));
case "MasterArn":
return Optional.ofNullable(clazz.cast(masterArn()));
case "RevisionId":
return Optional.ofNullable(clazz.cast(revisionId()));
case "Layers":
return Optional.ofNullable(clazz.cast(layers()));
case "State":
return Optional.ofNullable(clazz.cast(stateAsString()));
case "StateReason":
return Optional.ofNullable(clazz.cast(stateReason()));
case "StateReasonCode":
return Optional.ofNullable(clazz.cast(stateReasonCodeAsString()));
case "LastUpdateStatus":
return Optional.ofNullable(clazz.cast(lastUpdateStatusAsString()));
case "LastUpdateStatusReason":
return Optional.ofNullable(clazz.cast(lastUpdateStatusReason()));
case "LastUpdateStatusReasonCode":
return Optional.ofNullable(clazz.cast(lastUpdateStatusReasonCodeAsString()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function