All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.lambda.model.UpdateFunctionConfigurationRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Lambda module holds the client classes that are used for communicating with AWS Lambda Service

There is a newer version: 2.28.3
Show newest version
/*
 * Copyright 2013-2018 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.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 UpdateFunctionConfigurationRequest extends LambdaRequest implements
        ToCopyableBuilder {
    private static final SdkField FUNCTION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateFunctionConfigurationRequest::functionName)).setter(setter(Builder::functionName))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("FunctionName").build()).build();

    private static final SdkField ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateFunctionConfigurationRequest::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(UpdateFunctionConfigurationRequest::handler)).setter(setter(Builder::handler))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Handler").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateFunctionConfigurationRequest::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(UpdateFunctionConfigurationRequest::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(UpdateFunctionConfigurationRequest::memorySize)).setter(setter(Builder::memorySize))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemorySize").build()).build();

    private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .getter(getter(UpdateFunctionConfigurationRequest::vpcConfig)).setter(setter(Builder::vpcConfig))
            .constructor(VpcConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfig").build()).build();

    private static final SdkField ENVIRONMENT_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .getter(getter(UpdateFunctionConfigurationRequest::environment)).setter(setter(Builder::environment))
            .constructor(Environment::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Environment").build()).build();

    private static final SdkField RUNTIME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateFunctionConfigurationRequest::runtimeAsString)).setter(setter(Builder::runtime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Runtime").build()).build();

    private static final SdkField DEAD_LETTER_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .getter(getter(UpdateFunctionConfigurationRequest::deadLetterConfig)).setter(setter(Builder::deadLetterConfig))
            .constructor(DeadLetterConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeadLetterConfig").build()).build();

    private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateFunctionConfigurationRequest::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(UpdateFunctionConfigurationRequest::tracingConfig))
            .setter(setter(Builder::tracingConfig)).constructor(TracingConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TracingConfig").build()).build();

    private static final SdkField REVISION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(UpdateFunctionConfigurationRequest::revisionId)).setter(setter(Builder::revisionId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RevisionId").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FUNCTION_NAME_FIELD,
            ROLE_FIELD, HANDLER_FIELD, DESCRIPTION_FIELD, TIMEOUT_FIELD, MEMORY_SIZE_FIELD, VPC_CONFIG_FIELD, ENVIRONMENT_FIELD,
            RUNTIME_FIELD, DEAD_LETTER_CONFIG_FIELD, KMS_KEY_ARN_FIELD, TRACING_CONFIG_FIELD, REVISION_ID_FIELD));

    private final String functionName;

    private final String role;

    private final String handler;

    private final String description;

    private final Integer timeout;

    private final Integer memorySize;

    private final VpcConfig vpcConfig;

    private final Environment environment;

    private final String runtime;

    private final DeadLetterConfig deadLetterConfig;

    private final String kmsKeyArn;

    private final TracingConfig tracingConfig;

    private final String revisionId;

    private UpdateFunctionConfigurationRequest(BuilderImpl builder) {
        super(builder);
        this.functionName = builder.functionName;
        this.role = builder.role;
        this.handler = builder.handler;
        this.description = builder.description;
        this.timeout = builder.timeout;
        this.memorySize = builder.memorySize;
        this.vpcConfig = builder.vpcConfig;
        this.environment = builder.environment;
        this.runtime = builder.runtime;
        this.deadLetterConfig = builder.deadLetterConfig;
        this.kmsKeyArn = builder.kmsKeyArn;
        this.tracingConfig = builder.tracingConfig;
        this.revisionId = builder.revisionId;
    }

    /**
     * 

* The name of the lambda function. *

*

* Name formats *

*
    *
  • *

    * Function name - MyFunction. *

    *
  • *
  • *

    * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

    *
  • *
  • *

    * Partial ARN - 123456789012:function:MyFunction. *

    *
  • *
*

* The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 * characters in length. *

* * @return The name of the lambda function.

*

* Name formats *

*
    *
  • *

    * Function name - MyFunction. *

    *
  • *
  • *

    * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

    *
  • *
  • *

    * Partial ARN - 123456789012:function:MyFunction. *

    *
  • *
*

* The length constraint applies only to the full ARN. If you specify only the function name, it is limited * to 64 characters in length. */ public String functionName() { return functionName; } /** *

* The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when it executes your function. *

* * @return The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when it executes your function. */ public String role() { return role; } /** *

* The function that Lambda calls to begin executing your function. For Node.js, it is the * module-name.export value in your function. *

* * @return The function that Lambda calls to begin executing your function. For Node.js, it is the * module-name.export value in your function. */ public String handler() { return handler; } /** *

* A short user-defined function description. AWS Lambda does not use this value. Assign a meaningful description as * you see fit. *

* * @return A short user-defined function description. AWS Lambda does not use this value. Assign a meaningful * description as you see fit. */ public String description() { return description; } /** *

* The amount of time that Lambda allows a function to run before terminating it. The default is 3 seconds. The * maximum allowed value is 900 seconds. *

* * @return The amount of time that Lambda allows a function to run before terminating it. The default is 3 seconds. * The maximum allowed value is 900 seconds. */ public Integer timeout() { return timeout; } /** *

* The amount of memory, in MB, your Lambda function is given. AWS Lambda uses this memory size to infer the amount * of CPU allocated to your function. Your function use-case determines your CPU and memory requirements. For * example, a database operation might need less memory compared to an image processing function. The default value * is 128 MB. The value must be a multiple of 64 MB. *

* * @return The amount of memory, in MB, your Lambda function is given. AWS Lambda uses this memory size to infer the * amount of CPU allocated to your function. Your function use-case determines your CPU and memory * requirements. For example, a database operation might need less memory compared to an image processing * function. The default value is 128 MB. The value must be a multiple of 64 MB. */ public Integer memorySize() { return memorySize; } /** *

* Specify security groups and subnets in a VPC to which your Lambda function needs access. *

* * @return Specify security groups and subnets in a VPC to which your Lambda function needs access. */ public VpcConfig vpcConfig() { return vpcConfig; } /** *

* The parent object that contains your environment's configuration settings. *

* * @return The parent object that contains your environment's configuration settings. */ public Environment environment() { return environment; } /** *

* The runtime version for the 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 version for the function. * @see Runtime */ public Runtime runtime() { return Runtime.fromValue(runtime); } /** *

* The runtime version for the 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 version for the function. * @see Runtime */ public String runtimeAsString() { return runtime; } /** *

* A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when * they fail processing. For more information, see Dead Letter Queues. *

* * @return A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous * events when they fail processing. For more information, see Dead Letter Queues. */ public DeadLetterConfig deadLetterConfig() { return deadLetterConfig; } /** *

* The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's environment variables. If you elect * to use the AWS Lambda default service key, pass in an empty string ("") for this parameter. *

* * @return The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's environment variables. If * you elect to use the AWS Lambda default service key, pass in an empty string ("") for this parameter. */ public String kmsKeyArn() { return kmsKeyArn; } /** *

* Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray. *

* * @return Set Mode to Active to sample and trace a subset of incoming requests with AWS * X-Ray. */ public TracingConfig tracingConfig() { return tracingConfig; } /** *

* An optional value you can use to ensure you are updating the latest update of the function version or alias. If * the RevisionID you pass doesn't match the latest RevisionId of the function or alias, * it will fail with an error message, advising you to retrieve the latest function version or alias * RevisionID using either GetFunction or GetAlias. *

* * @return An optional value you can use to ensure you are updating the latest update of the function version or * alias. If the RevisionID you pass doesn't match the latest RevisionId of the * function or alias, it will fail with an error message, advising you to retrieve the latest function * version or alias RevisionID using either GetFunction or GetAlias. */ public String revisionId() { return revisionId; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(functionName()); hashCode = 31 * hashCode + Objects.hashCode(role()); hashCode = 31 * hashCode + Objects.hashCode(handler()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(timeout()); hashCode = 31 * hashCode + Objects.hashCode(memorySize()); hashCode = 31 * hashCode + Objects.hashCode(vpcConfig()); hashCode = 31 * hashCode + Objects.hashCode(environment()); hashCode = 31 * hashCode + Objects.hashCode(runtimeAsString()); hashCode = 31 * hashCode + Objects.hashCode(deadLetterConfig()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyArn()); hashCode = 31 * hashCode + Objects.hashCode(tracingConfig()); hashCode = 31 * hashCode + Objects.hashCode(revisionId()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateFunctionConfigurationRequest)) { return false; } UpdateFunctionConfigurationRequest other = (UpdateFunctionConfigurationRequest) obj; return Objects.equals(functionName(), other.functionName()) && Objects.equals(role(), other.role()) && Objects.equals(handler(), other.handler()) && Objects.equals(description(), other.description()) && Objects.equals(timeout(), other.timeout()) && Objects.equals(memorySize(), other.memorySize()) && Objects.equals(vpcConfig(), other.vpcConfig()) && Objects.equals(environment(), other.environment()) && Objects.equals(runtimeAsString(), other.runtimeAsString()) && Objects.equals(deadLetterConfig(), other.deadLetterConfig()) && Objects.equals(kmsKeyArn(), other.kmsKeyArn()) && Objects.equals(tracingConfig(), other.tracingConfig()) && Objects.equals(revisionId(), other.revisionId()); } @Override public String toString() { return ToString.builder("UpdateFunctionConfigurationRequest").add("FunctionName", functionName()).add("Role", role()) .add("Handler", handler()).add("Description", description()).add("Timeout", timeout()) .add("MemorySize", memorySize()).add("VpcConfig", vpcConfig()).add("Environment", environment()) .add("Runtime", runtimeAsString()).add("DeadLetterConfig", deadLetterConfig()).add("KMSKeyArn", kmsKeyArn()) .add("TracingConfig", tracingConfig()).add("RevisionId", revisionId()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "FunctionName": return Optional.ofNullable(clazz.cast(functionName())); case "Role": return Optional.ofNullable(clazz.cast(role())); case "Handler": return Optional.ofNullable(clazz.cast(handler())); 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 "VpcConfig": return Optional.ofNullable(clazz.cast(vpcConfig())); case "Environment": return Optional.ofNullable(clazz.cast(environment())); case "Runtime": return Optional.ofNullable(clazz.cast(runtimeAsString())); case "DeadLetterConfig": return Optional.ofNullable(clazz.cast(deadLetterConfig())); case "KMSKeyArn": return Optional.ofNullable(clazz.cast(kmsKeyArn())); case "TracingConfig": return Optional.ofNullable(clazz.cast(tracingConfig())); case "RevisionId": return Optional.ofNullable(clazz.cast(revisionId())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateFunctionConfigurationRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends LambdaRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the lambda function. *

*

* Name formats *

*
    *
  • *

    * Function name - MyFunction. *

    *
  • *
  • *

    * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

    *
  • *
  • *

    * Partial ARN - 123456789012:function:MyFunction. *

    *
  • *
*

* The length constraint applies only to the full ARN. If you specify only the function name, it is limited to * 64 characters in length. *

* * @param functionName * The name of the lambda function.

*

* Name formats *

*
    *
  • *

    * Function name - MyFunction. *

    *
  • *
  • *

    * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. *

    *
  • *
  • *

    * Partial ARN - 123456789012:function:MyFunction. *

    *
  • *
*

* The length constraint applies only to the full ARN. If you specify only the function name, it is * limited to 64 characters in length. * @return Returns a reference to this object so that method calls can be chained together. */ Builder functionName(String functionName); /** *

* The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when it executes your function. *

* * @param role * The Amazon Resource Name (ARN) of the IAM role that Lambda will assume when it executes your function. * @return Returns a reference to this object so that method calls can be chained together. */ Builder role(String role); /** *

* The function that Lambda calls to begin executing your function. For Node.js, it is the * module-name.export value in your function. *

* * @param handler * The function that Lambda calls to begin executing your function. For Node.js, it is the * module-name.export value in your function. * @return Returns a reference to this object so that method calls can be chained together. */ Builder handler(String handler); /** *

* A short user-defined function description. AWS Lambda does not use this value. Assign a meaningful * description as you see fit. *

* * @param description * A short user-defined function description. AWS Lambda does not use this value. Assign a meaningful * description as you see fit. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The amount of time that Lambda allows a function to run before terminating it. The default is 3 seconds. The * maximum allowed value is 900 seconds. *

* * @param timeout * The amount of time that Lambda allows a function to run before terminating it. The default is 3 * seconds. The maximum allowed value is 900 seconds. * @return Returns a reference to this object so that method calls can be chained together. */ Builder timeout(Integer timeout); /** *

* The amount of memory, in MB, your Lambda function is given. AWS Lambda uses this memory size to infer the * amount of CPU allocated to your function. Your function use-case determines your CPU and memory requirements. * For example, a database operation might need less memory compared to an image processing function. The * default value is 128 MB. The value must be a multiple of 64 MB. *

* * @param memorySize * The amount of memory, in MB, your Lambda function is given. AWS Lambda uses this memory size to infer * the amount of CPU allocated to your function. Your function use-case determines your CPU and memory * requirements. For example, a database operation might need less memory compared to an image processing * function. The default value is 128 MB. The value must be a multiple of 64 MB. * @return Returns a reference to this object so that method calls can be chained together. */ Builder memorySize(Integer memorySize); /** *

* Specify security groups and subnets in a VPC to which your Lambda function needs access. *

* * @param vpcConfig * Specify security groups and subnets in a VPC to which your Lambda function needs access. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcConfig(VpcConfig vpcConfig); /** *

* Specify security groups and subnets in a VPC to which your Lambda function needs access. *

* This is a convenience that creates an instance of the {@link VpcConfig.Builder} avoiding the need to create * one manually via {@link VpcConfig#builder()}. * * When the {@link Consumer} completes, {@link VpcConfig.Builder#build()} is called immediately and its result * is passed to {@link #vpcConfig(VpcConfig)}. * * @param vpcConfig * a consumer that will call methods on {@link VpcConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #vpcConfig(VpcConfig) */ default Builder vpcConfig(Consumer vpcConfig) { return vpcConfig(VpcConfig.builder().applyMutation(vpcConfig).build()); } /** *

* The parent object that contains your environment's configuration settings. *

* * @param environment * The parent object that contains your environment's configuration settings. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environment(Environment environment); /** *

* The parent object that contains your environment's configuration settings. *

* This is a convenience that creates an instance of the {@link Environment.Builder} avoiding the need to create * one manually via {@link Environment#builder()}. * * When the {@link Consumer} completes, {@link Environment.Builder#build()} is called immediately and its result * is passed to {@link #environment(Environment)}. * * @param environment * a consumer that will call methods on {@link Environment.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #environment(Environment) */ default Builder environment(Consumer environment) { return environment(Environment.builder().applyMutation(environment).build()); } /** *

* The runtime version for the function. *

* * @param runtime * The runtime version for the function. * @see Runtime * @return Returns a reference to this object so that method calls can be chained together. * @see Runtime */ Builder runtime(String runtime); /** *

* The runtime version for the function. *

* * @param runtime * The runtime version for the function. * @see Runtime * @return Returns a reference to this object so that method calls can be chained together. * @see Runtime */ Builder runtime(Runtime runtime); /** *

* A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events * when they fail processing. For more information, see Dead Letter Queues. *

* * @param deadLetterConfig * A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous * events when they fail processing. For more information, see Dead Letter Queues. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deadLetterConfig(DeadLetterConfig deadLetterConfig); /** *

* A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events * when they fail processing. For more information, see Dead Letter Queues. *

* This is a convenience that creates an instance of the {@link DeadLetterConfig.Builder} avoiding the need to * create one manually via {@link DeadLetterConfig#builder()}. * * When the {@link Consumer} completes, {@link DeadLetterConfig.Builder#build()} is called immediately and its * result is passed to {@link #deadLetterConfig(DeadLetterConfig)}. * * @param deadLetterConfig * a consumer that will call methods on {@link DeadLetterConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #deadLetterConfig(DeadLetterConfig) */ default Builder deadLetterConfig(Consumer deadLetterConfig) { return deadLetterConfig(DeadLetterConfig.builder().applyMutation(deadLetterConfig).build()); } /** *

* The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's environment variables. If you * elect to use the AWS Lambda default service key, pass in an empty string ("") for this parameter. *

* * @param kmsKeyArn * The Amazon Resource Name (ARN) of the KMS key used to encrypt your function's environment variables. * If you elect to use the AWS Lambda default service key, pass in an empty string ("") for this * parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyArn(String kmsKeyArn); /** *

* Set Mode to Active to sample and trace a subset of incoming requests with AWS * X-Ray. *

* * @param tracingConfig * Set Mode to Active to sample and trace a subset of incoming requests with * AWS X-Ray. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tracingConfig(TracingConfig tracingConfig); /** *

* Set Mode to Active to sample and trace a subset of incoming requests with AWS * X-Ray. *

* This is a convenience that creates an instance of the {@link TracingConfig.Builder} avoiding the need to * create one manually via {@link TracingConfig#builder()}. * * When the {@link Consumer} completes, {@link TracingConfig.Builder#build()} is called immediately and its * result is passed to {@link #tracingConfig(TracingConfig)}. * * @param tracingConfig * a consumer that will call methods on {@link TracingConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tracingConfig(TracingConfig) */ default Builder tracingConfig(Consumer tracingConfig) { return tracingConfig(TracingConfig.builder().applyMutation(tracingConfig).build()); } /** *

* An optional value you can use to ensure you are updating the latest update of the function version or alias. * If the RevisionID you pass doesn't match the latest RevisionId of the function or * alias, it will fail with an error message, advising you to retrieve the latest function version or alias * RevisionID using either GetFunction or GetAlias. *

* * @param revisionId * An optional value you can use to ensure you are updating the latest update of the function version or * alias. If the RevisionID you pass doesn't match the latest RevisionId of the * function or alias, it will fail with an error message, advising you to retrieve the latest function * version or alias RevisionID using either GetFunction or GetAlias. * @return Returns a reference to this object so that method calls can be chained together. */ Builder revisionId(String revisionId); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends LambdaRequest.BuilderImpl implements Builder { private String functionName; private String role; private String handler; private String description; private Integer timeout; private Integer memorySize; private VpcConfig vpcConfig; private Environment environment; private String runtime; private DeadLetterConfig deadLetterConfig; private String kmsKeyArn; private TracingConfig tracingConfig; private String revisionId; private BuilderImpl() { } private BuilderImpl(UpdateFunctionConfigurationRequest model) { super(model); functionName(model.functionName); role(model.role); handler(model.handler); description(model.description); timeout(model.timeout); memorySize(model.memorySize); vpcConfig(model.vpcConfig); environment(model.environment); runtime(model.runtime); deadLetterConfig(model.deadLetterConfig); kmsKeyArn(model.kmsKeyArn); tracingConfig(model.tracingConfig); revisionId(model.revisionId); } public final String getFunctionName() { return functionName; } @Override public final Builder functionName(String functionName) { this.functionName = functionName; return this; } public final void setFunctionName(String functionName) { this.functionName = functionName; } public final String getRole() { return role; } @Override public final Builder role(String role) { this.role = role; return this; } public final void setRole(String role) { this.role = role; } public final String getHandler() { return handler; } @Override public final Builder handler(String handler) { this.handler = handler; return this; } public final void setHandler(String handler) { this.handler = handler; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final Integer getTimeout() { return timeout; } @Override public final Builder timeout(Integer timeout) { this.timeout = timeout; return this; } public final void setTimeout(Integer timeout) { this.timeout = timeout; } public final Integer getMemorySize() { return memorySize; } @Override public final Builder memorySize(Integer memorySize) { this.memorySize = memorySize; return this; } public final void setMemorySize(Integer memorySize) { this.memorySize = memorySize; } public final VpcConfig.Builder getVpcConfig() { return vpcConfig != null ? vpcConfig.toBuilder() : null; } @Override public final Builder vpcConfig(VpcConfig vpcConfig) { this.vpcConfig = vpcConfig; return this; } public final void setVpcConfig(VpcConfig.BuilderImpl vpcConfig) { this.vpcConfig = vpcConfig != null ? vpcConfig.build() : null; } public final Environment.Builder getEnvironment() { return environment != null ? environment.toBuilder() : null; } @Override public final Builder environment(Environment environment) { this.environment = environment; return this; } public final void setEnvironment(Environment.BuilderImpl environment) { this.environment = environment != null ? environment.build() : null; } public final String getRuntime() { return runtime; } @Override public final Builder runtime(String runtime) { this.runtime = runtime; return this; } @Override public final Builder runtime(Runtime runtime) { this.runtime(runtime.toString()); return this; } public final void setRuntime(String runtime) { this.runtime = runtime; } public final DeadLetterConfig.Builder getDeadLetterConfig() { return deadLetterConfig != null ? deadLetterConfig.toBuilder() : null; } @Override public final Builder deadLetterConfig(DeadLetterConfig deadLetterConfig) { this.deadLetterConfig = deadLetterConfig; return this; } public final void setDeadLetterConfig(DeadLetterConfig.BuilderImpl deadLetterConfig) { this.deadLetterConfig = deadLetterConfig != null ? deadLetterConfig.build() : null; } public final String getKMSKeyArn() { return kmsKeyArn; } @Override public final Builder kmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; return this; } public final void setKMSKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; } public final TracingConfig.Builder getTracingConfig() { return tracingConfig != null ? tracingConfig.toBuilder() : null; } @Override public final Builder tracingConfig(TracingConfig tracingConfig) { this.tracingConfig = tracingConfig; return this; } public final void setTracingConfig(TracingConfig.BuilderImpl tracingConfig) { this.tracingConfig = tracingConfig != null ? tracingConfig.build() : null; } public final String getRevisionId() { return revisionId; } @Override public final Builder revisionId(String revisionId) { this.revisionId = revisionId; return this; } public final void setRevisionId(String revisionId) { this.revisionId = revisionId; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateFunctionConfigurationRequest build() { return new UpdateFunctionConfigurationRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy