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

package tsptest.armresourceprovider.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import tsptest.armresourceprovider.models.CustomTemplateResourcePropertiesAnonymousEmptyModel;
import tsptest.armresourceprovider.models.Dog;
import tsptest.armresourceprovider.models.EmptyModel;
import tsptest.armresourceprovider.models.PriorityModel;
import tsptest.armresourceprovider.models.ProvisioningState;

/**
 * Top Level Arm Resource Properties.
 */
@Fluent
public final class CustomTemplateResourceProperties {
    /*
     * The status of the last operation.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * The dog property.
     */
    @JsonProperty(value = "dog", required = true)
    private Dog dog;

    /*
     * The namedEmptyModel property.
     */
    @JsonProperty(value = "namedEmptyModel", required = true)
    private EmptyModel namedEmptyModel;

    /*
     * The anonymousEmptyModel property.
     */
    @JsonProperty(value = "anonymousEmptyModel", required = true)
    private CustomTemplateResourcePropertiesAnonymousEmptyModel anonymousEmptyModel;

    /*
     * The priority property.
     */
    @JsonProperty(value = "priority", required = true)
    private PriorityModel priority;

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

    /**
     * Get the provisioningState property: The status of the last operation.
     * 
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

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

    /**
     * Set the dog property: The dog property.
     * 
     * @param dog the dog value to set.
     * @return the CustomTemplateResourceProperties object itself.
     */
    public CustomTemplateResourceProperties withDog(Dog dog) {
        this.dog = dog;
        return this;
    }

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

    /**
     * Set the namedEmptyModel property: The namedEmptyModel property.
     * 
     * @param namedEmptyModel the namedEmptyModel value to set.
     * @return the CustomTemplateResourceProperties object itself.
     */
    public CustomTemplateResourceProperties withNamedEmptyModel(EmptyModel namedEmptyModel) {
        this.namedEmptyModel = namedEmptyModel;
        return this;
    }

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

    /**
     * Set the anonymousEmptyModel property: The anonymousEmptyModel property.
     * 
     * @param anonymousEmptyModel the anonymousEmptyModel value to set.
     * @return the CustomTemplateResourceProperties object itself.
     */
    public CustomTemplateResourceProperties
        withAnonymousEmptyModel(CustomTemplateResourcePropertiesAnonymousEmptyModel anonymousEmptyModel) {
        this.anonymousEmptyModel = anonymousEmptyModel;
        return this;
    }

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

    /**
     * Set the priority property: The priority property.
     * 
     * @param priority the priority value to set.
     * @return the CustomTemplateResourceProperties object itself.
     */
    public CustomTemplateResourceProperties withPriority(PriorityModel priority) {
        this.priority = priority;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (dog() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property dog in model CustomTemplateResourceProperties"));
        } else {
            dog().validate();
        }
        if (namedEmptyModel() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property namedEmptyModel in model CustomTemplateResourceProperties"));
        } else {
            namedEmptyModel().validate();
        }
        if (anonymousEmptyModel() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property anonymousEmptyModel in model CustomTemplateResourceProperties"));
        } else {
            anonymousEmptyModel().validate();
        }
        if (priority() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property priority in model CustomTemplateResourceProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(CustomTemplateResourceProperties.class);
}
