001
002package com.commercetools.api.models.extension;
003
004import java.time.*;
005import java.util.*;
006
007import com.fasterxml.jackson.annotation.JsonCreator;
008import com.fasterxml.jackson.annotation.JsonProperty;
009import com.fasterxml.jackson.databind.annotation.*;
010
011import io.vrap.rmf.base.client.ModelBase;
012import io.vrap.rmf.base.client.utils.Generated;
013
014import org.apache.commons.lang3.builder.EqualsBuilder;
015import org.apache.commons.lang3.builder.HashCodeBuilder;
016
017/**
018 *  <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>
019 */
020@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
021public class AWSLambdaDestinationImpl implements AWSLambdaDestination, ModelBase {
022
023    private String type;
024
025    private String arn;
026
027    private String accessKey;
028
029    private String accessSecret;
030
031    /**
032     * create instance with all properties
033     */
034    @JsonCreator
035    AWSLambdaDestinationImpl(@JsonProperty("arn") final String arn, @JsonProperty("accessKey") final String accessKey,
036            @JsonProperty("accessSecret") final String accessSecret) {
037        this.arn = arn;
038        this.accessKey = accessKey;
039        this.accessSecret = accessSecret;
040        this.type = AWS_LAMBDA;
041    }
042
043    /**
044     * create empty instance
045     */
046    public AWSLambdaDestinationImpl() {
047        this.type = AWS_LAMBDA;
048    }
049
050    /**
051     *
052     */
053
054    public String getType() {
055        return this.type;
056    }
057
058    /**
059     *  <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>
060     */
061
062    public String getArn() {
063        return this.arn;
064    }
065
066    /**
067     *  <p>Partially hidden on retrieval for security reasons.</p>
068     */
069
070    public String getAccessKey() {
071        return this.accessKey;
072    }
073
074    /**
075     *  <p>Partially hidden on retrieval for security reasons.</p>
076     */
077
078    public String getAccessSecret() {
079        return this.accessSecret;
080    }
081
082    public void setArn(final String arn) {
083        this.arn = arn;
084    }
085
086    public void setAccessKey(final String accessKey) {
087        this.accessKey = accessKey;
088    }
089
090    public void setAccessSecret(final String accessSecret) {
091        this.accessSecret = accessSecret;
092    }
093
094    @Override
095    public boolean equals(Object o) {
096        if (this == o)
097            return true;
098
099        if (o == null || getClass() != o.getClass())
100            return false;
101
102        AWSLambdaDestinationImpl that = (AWSLambdaDestinationImpl) o;
103
104        return new EqualsBuilder().append(type, that.type)
105                .append(arn, that.arn)
106                .append(accessKey, that.accessKey)
107                .append(accessSecret, that.accessSecret)
108                .isEquals();
109    }
110
111    @Override
112    public int hashCode() {
113        return new HashCodeBuilder(17, 37).append(type).append(arn).append(accessKey).append(accessSecret).toHashCode();
114    }
115
116}