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>To protect your Azure Function, set its <code>authLevel</code> to <code>function</code> and provide the function's key to be used inside the <code>x-functions-key</code> header. For more information, see the Azure Functions documentation.</p>
019 *  <p>To protect the secret key from being exposed, remove the code parameter and secret key from the URL. For example, use <code>https://foo.azurewebsites.net/api/bar</code> instead of <code>https://foo.azurewebsites.net/api/bar?code=secret</code>.</p>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class AzureFunctionsAuthenticationImpl implements AzureFunctionsAuthentication, ModelBase {
023
024    private String type;
025
026    private String key;
027
028    /**
029     * create instance with all properties
030     */
031    @JsonCreator
032    AzureFunctionsAuthenticationImpl(@JsonProperty("key") final String key) {
033        this.key = key;
034        this.type = AZURE_FUNCTIONS;
035    }
036
037    /**
038     * create empty instance
039     */
040    public AzureFunctionsAuthenticationImpl() {
041        this.type = AZURE_FUNCTIONS;
042    }
043
044    /**
045     *
046     */
047
048    public String getType() {
049        return this.type;
050    }
051
052    /**
053     *  <p>Partially hidden on retrieval for security reasons.</p>
054     */
055
056    public String getKey() {
057        return this.key;
058    }
059
060    public void setKey(final String key) {
061        this.key = key;
062    }
063
064    @Override
065    public boolean equals(Object o) {
066        if (this == o)
067            return true;
068
069        if (o == null || getClass() != o.getClass())
070            return false;
071
072        AzureFunctionsAuthenticationImpl that = (AzureFunctionsAuthenticationImpl) o;
073
074        return new EqualsBuilder().append(type, that.type)
075                .append(key, that.key)
076                .append(type, that.type)
077                .append(key, that.key)
078                .isEquals();
079    }
080
081    @Override
082    public int hashCode() {
083        return new HashCodeBuilder(17, 37).append(type).append(key).toHashCode();
084    }
085
086}