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

package com.azure.resourcemanager.devtestlabs.fluent.models;

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

/** Schedules applicable to a virtual machine. The schedules may have been defined on a VM or on lab level. */
@Fluent
public final class ApplicableScheduleInner extends Resource {
    /*
     * The properties of the resource.
     */
    @JsonProperty(value = "properties", required = true)
    private ApplicableSchedulePropertiesInner innerProperties = new ApplicableSchedulePropertiesInner();

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

    /**
     * Get the innerProperties property: The properties of the resource.
     *
     * @return the innerProperties value.
     */
    private ApplicableSchedulePropertiesInner innerProperties() {
        return this.innerProperties;
    }

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

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

    /**
     * Get the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource
     * level.
     *
     * @return the labVmsShutdown value.
     */
    public ScheduleInner labVmsShutdown() {
        return this.innerProperties() == null ? null : this.innerProperties().labVmsShutdown();
    }

    /**
     * Set the labVmsShutdown property: The auto-shutdown schedule, if one has been set at the lab or lab resource
     * level.
     *
     * @param labVmsShutdown the labVmsShutdown value to set.
     * @return the ApplicableScheduleInner object itself.
     */
    public ApplicableScheduleInner withLabVmsShutdown(ScheduleInner labVmsShutdown) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicableSchedulePropertiesInner();
        }
        this.innerProperties().withLabVmsShutdown(labVmsShutdown);
        return this;
    }

    /**
     * Get the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level.
     *
     * @return the labVmsStartup value.
     */
    public ScheduleInner labVmsStartup() {
        return this.innerProperties() == null ? null : this.innerProperties().labVmsStartup();
    }

    /**
     * Set the labVmsStartup property: The auto-startup schedule, if one has been set at the lab or lab resource level.
     *
     * @param labVmsStartup the labVmsStartup value to set.
     * @return the ApplicableScheduleInner object itself.
     */
    public ApplicableScheduleInner withLabVmsStartup(ScheduleInner labVmsStartup) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicableSchedulePropertiesInner();
        }
        this.innerProperties().withLabVmsStartup(labVmsStartup);
        return this;
    }

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

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