// *** 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.azure.iot.outputs.IoTHubCloudToDeviceFeedback;
import com.pulumi.core.annotations.CustomType;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class IoTHubCloudToDevice {
    /**
     * @return The default time to live for cloud-to-device messages, specified as an [ISO 8601 timespan duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). This value must be between 1 minute and 48 hours. Defaults to `PT1H`.
     * 
     */
    private @Nullable String defaultTtl;
    /**
     * @return A `feedback` block as defined below.
     * 
     */
    private @Nullable List<IoTHubCloudToDeviceFeedback> feedbacks;
    /**
     * @return The maximum delivery count for cloud-to-device per-device queues. This value must be between `1` and `100`. Defaults to `10`.
     * 
     */
    private @Nullable Integer maxDeliveryCount;

    private IoTHubCloudToDevice() {}
    /**
     * @return The default time to live for cloud-to-device messages, specified as an [ISO 8601 timespan duration](https://en.wikipedia.org/wiki/ISO_8601#Durations). This value must be between 1 minute and 48 hours. Defaults to `PT1H`.
     * 
     */
    public Optional<String> defaultTtl() {
        return Optional.ofNullable(this.defaultTtl);
    }
    /**
     * @return A `feedback` block as defined below.
     * 
     */
    public List<IoTHubCloudToDeviceFeedback> feedbacks() {
        return this.feedbacks == null ? List.of() : this.feedbacks;
    }
    /**
     * @return The maximum delivery count for cloud-to-device per-device queues. This value must be between `1` and `100`. Defaults to `10`.
     * 
     */
    public Optional<Integer> maxDeliveryCount() {
        return Optional.ofNullable(this.maxDeliveryCount);
    }

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

    public static Builder builder(IoTHubCloudToDevice defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String defaultTtl;
        private @Nullable List<IoTHubCloudToDeviceFeedback> feedbacks;
        private @Nullable Integer maxDeliveryCount;
        public Builder() {}
        public Builder(IoTHubCloudToDevice defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.defaultTtl = defaults.defaultTtl;
    	      this.feedbacks = defaults.feedbacks;
    	      this.maxDeliveryCount = defaults.maxDeliveryCount;
        }

        @CustomType.Setter
        public Builder defaultTtl(@Nullable String defaultTtl) {
            this.defaultTtl = defaultTtl;
            return this;
        }
        @CustomType.Setter
        public Builder feedbacks(@Nullable List<IoTHubCloudToDeviceFeedback> feedbacks) {
            this.feedbacks = feedbacks;
            return this;
        }
        public Builder feedbacks(IoTHubCloudToDeviceFeedback... feedbacks) {
            return feedbacks(List.of(feedbacks));
        }
        @CustomType.Setter
        public Builder maxDeliveryCount(@Nullable Integer maxDeliveryCount) {
            this.maxDeliveryCount = maxDeliveryCount;
            return this;
        }
        public IoTHubCloudToDevice build() {
            final var o = new IoTHubCloudToDevice();
            o.defaultTtl = defaultTtl;
            o.feedbacks = feedbacks;
            o.maxDeliveryCount = maxDeliveryCount;
            return o;
        }
    }
}
