// *** 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.azure.containerservice.outputs;

import com.pulumi.azure.containerservice.outputs.RegistryTaskSourceTriggerAuthentication;
import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class RegistryTaskSourceTrigger {
    /**
     * @return A `authentication` block as defined above.
     * 
     */
    private @Nullable RegistryTaskSourceTriggerAuthentication authentication;
    /**
     * @return The branch name of the source code.
     * 
     */
    private @Nullable String branch;
    /**
     * @return Should the trigger be enabled? Defaults to `true`.
     * 
     */
    private @Nullable Boolean enabled;
    /**
     * @return Specifies a list of source events corresponding to the trigger. Possible values are `commit` and `pullrequest`.
     * 
     */
    private List<String> events;
    /**
     * @return The name which should be used for this trigger.
     * 
     */
    private String name;
    /**
     * @return The full URL to the source code repository.
     * 
     */
    private String repositoryUrl;
    /**
     * @return The type of the source control service. Possible values are `Github` and `VisualStudioTeamService`.
     * 
     */
    private String sourceType;

    private RegistryTaskSourceTrigger() {}
    /**
     * @return A `authentication` block as defined above.
     * 
     */
    public Optional<RegistryTaskSourceTriggerAuthentication> authentication() {
        return Optional.ofNullable(this.authentication);
    }
    /**
     * @return The branch name of the source code.
     * 
     */
    public Optional<String> branch() {
        return Optional.ofNullable(this.branch);
    }
    /**
     * @return Should the trigger be enabled? Defaults to `true`.
     * 
     */
    public Optional<Boolean> enabled() {
        return Optional.ofNullable(this.enabled);
    }
    /**
     * @return Specifies a list of source events corresponding to the trigger. Possible values are `commit` and `pullrequest`.
     * 
     */
    public List<String> events() {
        return this.events;
    }
    /**
     * @return The name which should be used for this trigger.
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return The full URL to the source code repository.
     * 
     */
    public String repositoryUrl() {
        return this.repositoryUrl;
    }
    /**
     * @return The type of the source control service. Possible values are `Github` and `VisualStudioTeamService`.
     * 
     */
    public String sourceType() {
        return this.sourceType;
    }

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

    public static Builder builder(RegistryTaskSourceTrigger defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable RegistryTaskSourceTriggerAuthentication authentication;
        private @Nullable String branch;
        private @Nullable Boolean enabled;
        private List<String> events;
        private String name;
        private String repositoryUrl;
        private String sourceType;
        public Builder() {}
        public Builder(RegistryTaskSourceTrigger defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.authentication = defaults.authentication;
    	      this.branch = defaults.branch;
    	      this.enabled = defaults.enabled;
    	      this.events = defaults.events;
    	      this.name = defaults.name;
    	      this.repositoryUrl = defaults.repositoryUrl;
    	      this.sourceType = defaults.sourceType;
        }

        @CustomType.Setter
        public Builder authentication(@Nullable RegistryTaskSourceTriggerAuthentication authentication) {
            this.authentication = authentication;
            return this;
        }
        @CustomType.Setter
        public Builder branch(@Nullable String branch) {
            this.branch = branch;
            return this;
        }
        @CustomType.Setter
        public Builder enabled(@Nullable Boolean enabled) {
            this.enabled = enabled;
            return this;
        }
        @CustomType.Setter
        public Builder events(List<String> events) {
            this.events = Objects.requireNonNull(events);
            return this;
        }
        public Builder events(String... events) {
            return events(List.of(events));
        }
        @CustomType.Setter
        public Builder name(String name) {
            this.name = Objects.requireNonNull(name);
            return this;
        }
        @CustomType.Setter
        public Builder repositoryUrl(String repositoryUrl) {
            this.repositoryUrl = Objects.requireNonNull(repositoryUrl);
            return this;
        }
        @CustomType.Setter
        public Builder sourceType(String sourceType) {
            this.sourceType = Objects.requireNonNull(sourceType);
            return this;
        }
        public RegistryTaskSourceTrigger build() {
            final var o = new RegistryTaskSourceTrigger();
            o.authentication = authentication;
            o.branch = branch;
            o.enabled = enabled;
            o.events = events;
            o.name = name;
            o.repositoryUrl = repositoryUrl;
            o.sourceType = sourceType;
            return o;
        }
    }
}
