001
002package com.commercetools.api.models.extension;
003
004import java.time.*;
005import java.util.*;
006import java.util.function.Function;
007
008import javax.annotation.Nullable;
009import javax.validation.constraints.NotNull;
010
011import com.fasterxml.jackson.annotation.*;
012import com.fasterxml.jackson.databind.annotation.*;
013
014import io.vrap.rmf.base.client.utils.Generated;
015
016/**
017 *  <p>We recommend creating an Identify and Access Management (IAM) user with an <code>accessKey</code> and <code>accessSecret</code> pair, specifically for each Extension that only has the <code>lambda:InvokeFunction</code> permission on this function.</p>
018 *
019 * <hr>
020 * Example to create an instance using the builder pattern
021 * <div class=code-example>
022 * <pre><code class='java'>
023 *     AWSLambdaDestination aWSLambdaDestination = AWSLambdaDestination.builder()
024 *             .arn("{arn}")
025 *             .accessKey("{accessKey}")
026 *             .accessSecret("{accessSecret}")
027 *             .build()
028 * </code></pre>
029 * </div>
030 */
031@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
032@JsonDeserialize(as = AWSLambdaDestinationImpl.class)
033public interface AWSLambdaDestination extends ExtensionDestination {
034
035    /**
036     * discriminator value for AWSLambdaDestination
037     */
038    String AWS_LAMBDA = "AWSLambda";
039
040    /**
041     *  <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>
042     * @return arn
043     */
044    @NotNull
045    @JsonProperty("arn")
046    public String getArn();
047
048    /**
049     *  <p>Partially hidden on retrieval for security reasons.</p>
050     * @return accessKey
051     */
052    @NotNull
053    @JsonProperty("accessKey")
054    public String getAccessKey();
055
056    /**
057     *  <p>Partially hidden on retrieval for security reasons.</p>
058     * @return accessSecret
059     */
060    @NotNull
061    @JsonProperty("accessSecret")
062    public String getAccessSecret();
063
064    /**
065     *  <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>
066     * @param arn value to be set
067     */
068
069    public void setArn(final String arn);
070
071    /**
072     *  <p>Partially hidden on retrieval for security reasons.</p>
073     * @param accessKey value to be set
074     */
075
076    public void setAccessKey(final String accessKey);
077
078    /**
079     *  <p>Partially hidden on retrieval for security reasons.</p>
080     * @param accessSecret value to be set
081     */
082
083    public void setAccessSecret(final String accessSecret);
084
085    /**
086     * factory method
087     * @return instance of AWSLambdaDestination
088     */
089    public static AWSLambdaDestination of() {
090        return new AWSLambdaDestinationImpl();
091    }
092
093    /**
094     * factory method to create a shallow copy AWSLambdaDestination
095     * @param template instance to be copied
096     * @return copy instance
097     */
098    public static AWSLambdaDestination of(final AWSLambdaDestination template) {
099        AWSLambdaDestinationImpl instance = new AWSLambdaDestinationImpl();
100        instance.setArn(template.getArn());
101        instance.setAccessKey(template.getAccessKey());
102        instance.setAccessSecret(template.getAccessSecret());
103        return instance;
104    }
105
106    /**
107     * factory method to create a deep copy of AWSLambdaDestination
108     * @param template instance to be copied
109     * @return copy instance
110     */
111    @Nullable
112    public static AWSLambdaDestination deepCopy(@Nullable final AWSLambdaDestination template) {
113        if (template == null) {
114            return null;
115        }
116        AWSLambdaDestinationImpl instance = new AWSLambdaDestinationImpl();
117        instance.setArn(template.getArn());
118        instance.setAccessKey(template.getAccessKey());
119        instance.setAccessSecret(template.getAccessSecret());
120        return instance;
121    }
122
123    /**
124     * builder factory method for AWSLambdaDestination
125     * @return builder
126     */
127    public static AWSLambdaDestinationBuilder builder() {
128        return AWSLambdaDestinationBuilder.of();
129    }
130
131    /**
132     * create builder for AWSLambdaDestination instance
133     * @param template instance with prefilled values for the builder
134     * @return builder
135     */
136    public static AWSLambdaDestinationBuilder builder(final AWSLambdaDestination template) {
137        return AWSLambdaDestinationBuilder.of(template);
138    }
139
140    /**
141     * accessor map function
142     * @param <T> mapped type
143     * @param helper function to map the object
144     * @return mapped value
145     */
146    default <T> T withAWSLambdaDestination(Function<AWSLambdaDestination, T> helper) {
147        return helper.apply(this);
148    }
149
150    /**
151     * gives a TypeReference for usage with Jackson DataBind
152     * @return TypeReference
153     */
154    public static com.fasterxml.jackson.core.type.TypeReference<AWSLambdaDestination> typeReference() {
155        return new com.fasterxml.jackson.core.type.TypeReference<AWSLambdaDestination>() {
156            @Override
157            public String toString() {
158                return "TypeReference<AWSLambdaDestination>";
159            }
160        };
161    }
162}