// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.deploymentmanager.models.StepProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The resource representation of a rollout step. */
@Fluent
public final class StepResourceInner extends Resource {
    /*
     * The properties that define the step.
     */
    @JsonProperty(value = "properties", required = true)
    private StepProperties properties;

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

    /**
     * Get the properties property: The properties that define the step.
     *
     * @return the properties value.
     */
    public StepProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The properties that define the step.
     *
     * @param properties the properties value to set.
     * @return the StepResourceInner object itself.
     */
    public StepResourceInner withProperties(StepProperties properties) {
        this.properties = properties;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public StepResourceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public StepResourceInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

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

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