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 * AzureFunctionsAuthenticationBuilder
011 * <hr>
012 * Example to create an instance using the builder pattern
013 * <div class=code-example>
014 * <pre><code class='java'>
015 *     AzureFunctionsAuthentication azureFunctionsAuthentication = AzureFunctionsAuthentication.builder()
016 *             .key("{key}")
017 *             .build()
018 * </code></pre>
019 * </div>
020 */
021@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
022public class AzureFunctionsAuthenticationBuilder implements Builder<AzureFunctionsAuthentication> {
023
024    private String key;
025
026    /**
027     *  <p>Partially hidden on retrieval for security reasons.</p>
028     * @param key value to be set
029     * @return Builder
030     */
031
032    public AzureFunctionsAuthenticationBuilder key(final String key) {
033        this.key = key;
034        return this;
035    }
036
037    /**
038     *  <p>Partially hidden on retrieval for security reasons.</p>
039     * @return key
040     */
041
042    public String getKey() {
043        return this.key;
044    }
045
046    /**
047     * builds AzureFunctionsAuthentication with checking for non-null required values
048     * @return AzureFunctionsAuthentication
049     */
050    public AzureFunctionsAuthentication build() {
051        Objects.requireNonNull(key, AzureFunctionsAuthentication.class + ": key is missing");
052        return new AzureFunctionsAuthenticationImpl(key);
053    }
054
055    /**
056     * builds AzureFunctionsAuthentication without checking for non-null required values
057     * @return AzureFunctionsAuthentication
058     */
059    public AzureFunctionsAuthentication buildUnchecked() {
060        return new AzureFunctionsAuthenticationImpl(key);
061    }
062
063    /**
064     * factory method for an instance of AzureFunctionsAuthenticationBuilder
065     * @return builder
066     */
067    public static AzureFunctionsAuthenticationBuilder of() {
068        return new AzureFunctionsAuthenticationBuilder();
069    }
070
071    /**
072     * create builder for AzureFunctionsAuthentication instance
073     * @param template instance with prefilled values for the builder
074     * @return builder
075     */
076    public static AzureFunctionsAuthenticationBuilder of(final AzureFunctionsAuthentication template) {
077        AzureFunctionsAuthenticationBuilder builder = new AzureFunctionsAuthenticationBuilder();
078        builder.key = template.getKey();
079        return builder;
080    }
081
082}