All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.containerregistry.inputs.AuthInfoArgs Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.containerregistry.inputs;

import com.pulumi.azurenative.containerregistry.enums.TokenType;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Integer;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * The authorization properties for accessing the source code repository.
 * 
 */
public final class AuthInfoArgs extends com.pulumi.resources.ResourceArgs {

    public static final AuthInfoArgs Empty = new AuthInfoArgs();

    /**
     * Time in seconds that the token remains valid
     * 
     */
    @Import(name="expiresIn")
    private @Nullable Output expiresIn;

    /**
     * @return Time in seconds that the token remains valid
     * 
     */
    public Optional> expiresIn() {
        return Optional.ofNullable(this.expiresIn);
    }

    /**
     * The refresh token used to refresh the access token.
     * 
     */
    @Import(name="refreshToken")
    private @Nullable Output refreshToken;

    /**
     * @return The refresh token used to refresh the access token.
     * 
     */
    public Optional> refreshToken() {
        return Optional.ofNullable(this.refreshToken);
    }

    /**
     * The scope of the access token.
     * 
     */
    @Import(name="scope")
    private @Nullable Output scope;

    /**
     * @return The scope of the access token.
     * 
     */
    public Optional> scope() {
        return Optional.ofNullable(this.scope);
    }

    /**
     * The access token used to access the source control provider.
     * 
     */
    @Import(name="token", required=true)
    private Output token;

    /**
     * @return The access token used to access the source control provider.
     * 
     */
    public Output token() {
        return this.token;
    }

    /**
     * The type of Auth token.
     * 
     */
    @Import(name="tokenType", required=true)
    private Output> tokenType;

    /**
     * @return The type of Auth token.
     * 
     */
    public Output> tokenType() {
        return this.tokenType;
    }

    private AuthInfoArgs() {}

    private AuthInfoArgs(AuthInfoArgs $) {
        this.expiresIn = $.expiresIn;
        this.refreshToken = $.refreshToken;
        this.scope = $.scope;
        this.token = $.token;
        this.tokenType = $.tokenType;
    }

    public static Builder builder() {
        return new Builder();
    }
    public static Builder builder(AuthInfoArgs defaults) {
        return new Builder(defaults);
    }

    public static final class Builder {
        private AuthInfoArgs $;

        public Builder() {
            $ = new AuthInfoArgs();
        }

        public Builder(AuthInfoArgs defaults) {
            $ = new AuthInfoArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param expiresIn Time in seconds that the token remains valid
         * 
         * @return builder
         * 
         */
        public Builder expiresIn(@Nullable Output expiresIn) {
            $.expiresIn = expiresIn;
            return this;
        }

        /**
         * @param expiresIn Time in seconds that the token remains valid
         * 
         * @return builder
         * 
         */
        public Builder expiresIn(Integer expiresIn) {
            return expiresIn(Output.of(expiresIn));
        }

        /**
         * @param refreshToken The refresh token used to refresh the access token.
         * 
         * @return builder
         * 
         */
        public Builder refreshToken(@Nullable Output refreshToken) {
            $.refreshToken = refreshToken;
            return this;
        }

        /**
         * @param refreshToken The refresh token used to refresh the access token.
         * 
         * @return builder
         * 
         */
        public Builder refreshToken(String refreshToken) {
            return refreshToken(Output.of(refreshToken));
        }

        /**
         * @param scope The scope of the access token.
         * 
         * @return builder
         * 
         */
        public Builder scope(@Nullable Output scope) {
            $.scope = scope;
            return this;
        }

        /**
         * @param scope The scope of the access token.
         * 
         * @return builder
         * 
         */
        public Builder scope(String scope) {
            return scope(Output.of(scope));
        }

        /**
         * @param token The access token used to access the source control provider.
         * 
         * @return builder
         * 
         */
        public Builder token(Output token) {
            $.token = token;
            return this;
        }

        /**
         * @param token The access token used to access the source control provider.
         * 
         * @return builder
         * 
         */
        public Builder token(String token) {
            return token(Output.of(token));
        }

        /**
         * @param tokenType The type of Auth token.
         * 
         * @return builder
         * 
         */
        public Builder tokenType(Output> tokenType) {
            $.tokenType = tokenType;
            return this;
        }

        /**
         * @param tokenType The type of Auth token.
         * 
         * @return builder
         * 
         */
        public Builder tokenType(Either tokenType) {
            return tokenType(Output.of(tokenType));
        }

        /**
         * @param tokenType The type of Auth token.
         * 
         * @return builder
         * 
         */
        public Builder tokenType(String tokenType) {
            return tokenType(Either.ofLeft(tokenType));
        }

        /**
         * @param tokenType The type of Auth token.
         * 
         * @return builder
         * 
         */
        public Builder tokenType(TokenType tokenType) {
            return tokenType(Either.ofRight(tokenType));
        }

        public AuthInfoArgs build() {
            if ($.token == null) {
                throw new MissingRequiredPropertyException("AuthInfoArgs", "token");
            }
            if ($.tokenType == null) {
                throw new MissingRequiredPropertyException("AuthInfoArgs", "tokenType");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy