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

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 IoTHubRoute {
    /**
     * @return The condition that is evaluated to apply the routing rule. Defaults to `true`. For grammar, see: &lt;https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language&gt;.
     * 
     */
    private @Nullable String condition;
    /**
     * @return Used to specify whether a route is enabled.
     * 
     */
    private Boolean enabled;
    /**
     * @return The list of endpoints to which messages that satisfy the condition are routed.
     * 
     */
    private List<String> endpointNames;
    /**
     * @return The name of the route.
     * 
     */
    private String name;
    /**
     * @return The source that the routing rule is to be applied to, such as `DeviceMessages`. Possible values include: `Invalid`, `DeviceMessages`, `TwinChangeEvents`, `DeviceLifecycleEvents`, `DeviceConnectionStateEvents`, `DeviceJobLifecycleEvents` and `DigitalTwinChangeEvents`.
     * 
     */
    private String source;

    private IoTHubRoute() {}
    /**
     * @return The condition that is evaluated to apply the routing rule. Defaults to `true`. For grammar, see: &lt;https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language&gt;.
     * 
     */
    public Optional<String> condition() {
        return Optional.ofNullable(this.condition);
    }
    /**
     * @return Used to specify whether a route is enabled.
     * 
     */
    public Boolean enabled() {
        return this.enabled;
    }
    /**
     * @return The list of endpoints to which messages that satisfy the condition are routed.
     * 
     */
    public List<String> endpointNames() {
        return this.endpointNames;
    }
    /**
     * @return The name of the route.
     * 
     */
    public String name() {
        return this.name;
    }
    /**
     * @return The source that the routing rule is to be applied to, such as `DeviceMessages`. Possible values include: `Invalid`, `DeviceMessages`, `TwinChangeEvents`, `DeviceLifecycleEvents`, `DeviceConnectionStateEvents`, `DeviceJobLifecycleEvents` and `DigitalTwinChangeEvents`.
     * 
     */
    public String source() {
        return this.source;
    }

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

    public static Builder builder(IoTHubRoute defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String condition;
        private Boolean enabled;
        private List<String> endpointNames;
        private String name;
        private String source;
        public Builder() {}
        public Builder(IoTHubRoute defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.condition = defaults.condition;
    	      this.enabled = defaults.enabled;
    	      this.endpointNames = defaults.endpointNames;
    	      this.name = defaults.name;
    	      this.source = defaults.source;
        }

        @CustomType.Setter
        public Builder condition(@Nullable String condition) {
            this.condition = condition;
            return this;
        }
        @CustomType.Setter
        public Builder enabled(Boolean enabled) {
            this.enabled = Objects.requireNonNull(enabled);
            return this;
        }
        @CustomType.Setter
        public Builder endpointNames(List<String> endpointNames) {
            this.endpointNames = Objects.requireNonNull(endpointNames);
            return this;
        }
        public Builder endpointNames(String... endpointNames) {
            return endpointNames(List.of(endpointNames));
        }
        @CustomType.Setter
        public Builder name(String name) {
            this.name = Objects.requireNonNull(name);
            return this;
        }
        @CustomType.Setter
        public Builder source(String source) {
            this.source = Objects.requireNonNull(source);
            return this;
        }
        public IoTHubRoute build() {
            final var o = new IoTHubRoute();
            o.condition = condition;
            o.enabled = enabled;
            o.endpointNames = endpointNames;
            o.name = name;
            o.source = source;
            return o;
        }
    }
}
