001
002package com.commercetools.api.models.extension;
003
004import java.util.*;
005
006import io.vrap.rmf.base.client.Builder;
007import io.vrap.rmf.base.client.utils.Generated;
008
009/**
010 * AWSLambdaDestinationBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     AWSLambdaDestination aWSLambdaDestination = AWSLambdaDestination.builder()
016 *             .arn("{arn}")
017 *             .accessKey("{accessKey}")
018 *             .accessSecret("{accessSecret}")
019 *             .build()
020 * </code></pre>
021 * </div>
022 */
023@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
024public class AWSLambdaDestinationBuilder implements Builder<AWSLambdaDestination> {
025
026    private String arn;
027
028    private String accessKey;
029
030    private String accessSecret;
031
032    /**
033     *  <p>Amazon Resource Name (ARN) of the Lambda function in the format <code>arn:aws:lambda:&lt;region&gt;:&lt;accountid&gt;:function:&lt;functionName&gt;</code>. Use the format <code>arn:aws:lambda:&lt;region&gt;:&lt;accountid&gt;:function:&lt;functionName&gt;:&lt;functionAlias/version&gt;</code> to point to a specific version of the function.</p>
034     * @param arn value to be set
035     * @return Builder
036     */
037
038    public AWSLambdaDestinationBuilder arn(final String arn) {
039        this.arn = arn;
040        return this;
041    }
042
043    /**
044     *  <p>Partially hidden on retrieval for security reasons.</p>
045     * @param accessKey value to be set
046     * @return Builder
047     */
048
049    public AWSLambdaDestinationBuilder accessKey(final String accessKey) {
050        this.accessKey = accessKey;
051        return this;
052    }
053
054    /**
055     *  <p>Partially hidden on retrieval for security reasons.</p>
056     * @param accessSecret value to be set
057     * @return Builder
058     */
059
060    public AWSLambdaDestinationBuilder accessSecret(final String accessSecret) {
061        this.accessSecret = accessSecret;
062        return this;
063    }
064
065    /**
066     *  <p>Amazon Resource Name (ARN) of the Lambda function in the format <code>arn:aws:lambda:&lt;region&gt;:&lt;accountid&gt;:function:&lt;functionName&gt;</code>. Use the format <code>arn:aws:lambda:&lt;region&gt;:&lt;accountid&gt;:function:&lt;functionName&gt;:&lt;functionAlias/version&gt;</code> to point to a specific version of the function.</p>
067     * @return arn
068     */
069
070    public String getArn() {
071        return this.arn;
072    }
073
074    /**
075     *  <p>Partially hidden on retrieval for security reasons.</p>
076     * @return accessKey
077     */
078
079    public String getAccessKey() {
080        return this.accessKey;
081    }
082
083    /**
084     *  <p>Partially hidden on retrieval for security reasons.</p>
085     * @return accessSecret
086     */
087
088    public String getAccessSecret() {
089        return this.accessSecret;
090    }
091
092    /**
093     * builds AWSLambdaDestination with checking for non-null required values
094     * @return AWSLambdaDestination
095     */
096    public AWSLambdaDestination build() {
097        Objects.requireNonNull(arn, AWSLambdaDestination.class + ": arn is missing");
098        Objects.requireNonNull(accessKey, AWSLambdaDestination.class + ": accessKey is missing");
099        Objects.requireNonNull(accessSecret, AWSLambdaDestination.class + ": accessSecret is missing");
100        return new AWSLambdaDestinationImpl(arn, accessKey, accessSecret);
101    }
102
103    /**
104     * builds AWSLambdaDestination without checking for non-null required values
105     * @return AWSLambdaDestination
106     */
107    public AWSLambdaDestination buildUnchecked() {
108        return new AWSLambdaDestinationImpl(arn, accessKey, accessSecret);
109    }
110
111    /**
112     * factory method for an instance of AWSLambdaDestinationBuilder
113     * @return builder
114     */
115    public static AWSLambdaDestinationBuilder of() {
116        return new AWSLambdaDestinationBuilder();
117    }
118
119    /**
120     * create builder for AWSLambdaDestination instance
121     * @param template instance with prefilled values for the builder
122     * @return builder
123     */
124    public static AWSLambdaDestinationBuilder of(final AWSLambdaDestination template) {
125        AWSLambdaDestinationBuilder builder = new AWSLambdaDestinationBuilder();
126        builder.arn = template.getArn();
127        builder.accessKey = template.getAccessKey();
128        builder.accessSecret = template.getAccessSecret();
129        return builder;
130    }
131
132}