// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.providerhub.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.providerhub.fluent.models.ResourceTypeRegistrationInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The DefaultRolloutSpecification model. */
@Fluent
public class DefaultRolloutSpecification {
    /*
     * The canary property.
     */
    @JsonProperty(value = "canary")
    private DefaultRolloutSpecificationCanary canary;

    /*
     * The lowTraffic property.
     */
    @JsonProperty(value = "lowTraffic")
    private DefaultRolloutSpecificationLowTraffic lowTraffic;

    /*
     * The mediumTraffic property.
     */
    @JsonProperty(value = "mediumTraffic")
    private DefaultRolloutSpecificationMediumTraffic mediumTraffic;

    /*
     * The highTraffic property.
     */
    @JsonProperty(value = "highTraffic")
    private DefaultRolloutSpecificationHighTraffic highTraffic;

    /*
     * The restOfTheWorldGroupOne property.
     */
    @JsonProperty(value = "restOfTheWorldGroupOne")
    private DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne;

    /*
     * The restOfTheWorldGroupTwo property.
     */
    @JsonProperty(value = "restOfTheWorldGroupTwo")
    private DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo;

    /*
     * The providerRegistration property.
     */
    @JsonProperty(value = "providerRegistration")
    private DefaultRolloutSpecificationProviderRegistration providerRegistration;

    /*
     * The resourceTypeRegistrations property.
     */
    @JsonProperty(value = "resourceTypeRegistrations")
    private List<ResourceTypeRegistrationInner> resourceTypeRegistrations;

    /** Creates an instance of DefaultRolloutSpecification class. */
    public DefaultRolloutSpecification() {
    }

    /**
     * Get the canary property: The canary property.
     *
     * @return the canary value.
     */
    public DefaultRolloutSpecificationCanary canary() {
        return this.canary;
    }

    /**
     * Set the canary property: The canary property.
     *
     * @param canary the canary value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withCanary(DefaultRolloutSpecificationCanary canary) {
        this.canary = canary;
        return this;
    }

    /**
     * Get the lowTraffic property: The lowTraffic property.
     *
     * @return the lowTraffic value.
     */
    public DefaultRolloutSpecificationLowTraffic lowTraffic() {
        return this.lowTraffic;
    }

    /**
     * Set the lowTraffic property: The lowTraffic property.
     *
     * @param lowTraffic the lowTraffic value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withLowTraffic(DefaultRolloutSpecificationLowTraffic lowTraffic) {
        this.lowTraffic = lowTraffic;
        return this;
    }

    /**
     * Get the mediumTraffic property: The mediumTraffic property.
     *
     * @return the mediumTraffic value.
     */
    public DefaultRolloutSpecificationMediumTraffic mediumTraffic() {
        return this.mediumTraffic;
    }

    /**
     * Set the mediumTraffic property: The mediumTraffic property.
     *
     * @param mediumTraffic the mediumTraffic value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withMediumTraffic(DefaultRolloutSpecificationMediumTraffic mediumTraffic) {
        this.mediumTraffic = mediumTraffic;
        return this;
    }

    /**
     * Get the highTraffic property: The highTraffic property.
     *
     * @return the highTraffic value.
     */
    public DefaultRolloutSpecificationHighTraffic highTraffic() {
        return this.highTraffic;
    }

    /**
     * Set the highTraffic property: The highTraffic property.
     *
     * @param highTraffic the highTraffic value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withHighTraffic(DefaultRolloutSpecificationHighTraffic highTraffic) {
        this.highTraffic = highTraffic;
        return this;
    }

    /**
     * Get the restOfTheWorldGroupOne property: The restOfTheWorldGroupOne property.
     *
     * @return the restOfTheWorldGroupOne value.
     */
    public DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne() {
        return this.restOfTheWorldGroupOne;
    }

    /**
     * Set the restOfTheWorldGroupOne property: The restOfTheWorldGroupOne property.
     *
     * @param restOfTheWorldGroupOne the restOfTheWorldGroupOne value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withRestOfTheWorldGroupOne(
        DefaultRolloutSpecificationRestOfTheWorldGroupOne restOfTheWorldGroupOne) {
        this.restOfTheWorldGroupOne = restOfTheWorldGroupOne;
        return this;
    }

    /**
     * Get the restOfTheWorldGroupTwo property: The restOfTheWorldGroupTwo property.
     *
     * @return the restOfTheWorldGroupTwo value.
     */
    public DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo() {
        return this.restOfTheWorldGroupTwo;
    }

    /**
     * Set the restOfTheWorldGroupTwo property: The restOfTheWorldGroupTwo property.
     *
     * @param restOfTheWorldGroupTwo the restOfTheWorldGroupTwo value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withRestOfTheWorldGroupTwo(
        DefaultRolloutSpecificationRestOfTheWorldGroupTwo restOfTheWorldGroupTwo) {
        this.restOfTheWorldGroupTwo = restOfTheWorldGroupTwo;
        return this;
    }

    /**
     * Get the providerRegistration property: The providerRegistration property.
     *
     * @return the providerRegistration value.
     */
    public DefaultRolloutSpecificationProviderRegistration providerRegistration() {
        return this.providerRegistration;
    }

    /**
     * Set the providerRegistration property: The providerRegistration property.
     *
     * @param providerRegistration the providerRegistration value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withProviderRegistration(
        DefaultRolloutSpecificationProviderRegistration providerRegistration) {
        this.providerRegistration = providerRegistration;
        return this;
    }

    /**
     * Get the resourceTypeRegistrations property: The resourceTypeRegistrations property.
     *
     * @return the resourceTypeRegistrations value.
     */
    public List<ResourceTypeRegistrationInner> resourceTypeRegistrations() {
        return this.resourceTypeRegistrations;
    }

    /**
     * Set the resourceTypeRegistrations property: The resourceTypeRegistrations property.
     *
     * @param resourceTypeRegistrations the resourceTypeRegistrations value to set.
     * @return the DefaultRolloutSpecification object itself.
     */
    public DefaultRolloutSpecification withResourceTypeRegistrations(
        List<ResourceTypeRegistrationInner> resourceTypeRegistrations) {
        this.resourceTypeRegistrations = resourceTypeRegistrations;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (canary() != null) {
            canary().validate();
        }
        if (lowTraffic() != null) {
            lowTraffic().validate();
        }
        if (mediumTraffic() != null) {
            mediumTraffic().validate();
        }
        if (highTraffic() != null) {
            highTraffic().validate();
        }
        if (restOfTheWorldGroupOne() != null) {
            restOfTheWorldGroupOne().validate();
        }
        if (restOfTheWorldGroupTwo() != null) {
            restOfTheWorldGroupTwo().validate();
        }
        if (providerRegistration() != null) {
            providerRegistration().validate();
        }
        if (resourceTypeRegistrations() != null) {
            resourceTypeRegistrations().forEach(e -> e.validate());
        }
    }
}
