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

package com.azure.resourcemanager.deploymentmanager.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** Defines the properties of a Wait step. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "stepType")
@JsonTypeName("Wait")
@Fluent
public final class WaitStepProperties extends StepProperties {
    /*
     * The Wait attributes
     */
    @JsonProperty(value = "attributes", required = true)
    private WaitStepAttributes attributes;

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

    /**
     * Get the attributes property: The Wait attributes.
     *
     * @return the attributes value.
     */
    public WaitStepAttributes attributes() {
        return this.attributes;
    }

    /**
     * Set the attributes property: The Wait attributes.
     *
     * @param attributes the attributes value to set.
     * @return the WaitStepProperties object itself.
     */
    public WaitStepProperties withAttributes(WaitStepAttributes attributes) {
        this.attributes = attributes;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (attributes() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property attributes in model WaitStepProperties"));
        } else {
            attributes().validate();
        }
    }

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