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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySet;
import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetIdentity;
import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetPlan;
import com.azure.resourcemanager.desktopvirtualization.models.ResourceModelWithAllowedPropertySetSku;
import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolReference;
import com.azure.resourcemanager.desktopvirtualization.models.ScalingHostPoolType;
import com.azure.resourcemanager.desktopvirtualization.models.ScalingSchedule;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/**
 * ScalingPlan
 *
 * <p>Represents a scaling plan definition.
 */
@Fluent
public final class ScalingPlanInner extends ResourceModelWithAllowedPropertySet {
    /*
     * Metadata pertaining to creation and last modification of the resource.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Detailed properties for scaling plan.
     */
    @JsonProperty(value = "properties", required = true)
    private ScalingPlanProperties innerProperties = new ScalingPlanProperties();

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

    /**
     * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the innerProperties property: Detailed properties for scaling plan.
     *
     * @return the innerProperties value.
     */
    private ScalingPlanProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public ScalingPlanInner withManagedBy(String managedBy) {
        super.withManagedBy(managedBy);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ScalingPlanInner withKind(String kind) {
        super.withKind(kind);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ScalingPlanInner withIdentity(ResourceModelWithAllowedPropertySetIdentity identity) {
        super.withIdentity(identity);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ScalingPlanInner withSku(ResourceModelWithAllowedPropertySetSku sku) {
        super.withSku(sku);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ScalingPlanInner withPlan(ResourceModelWithAllowedPropertySetPlan plan) {
        super.withPlan(plan);
        return this;
    }

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

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

    /**
     * Get the objectId property: ObjectId of scaling plan. (internal use).
     *
     * @return the objectId value.
     */
    public String objectId() {
        return this.innerProperties() == null ? null : this.innerProperties().objectId();
    }

    /**
     * Get the description property: Description of scaling plan.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Description of scaling plan.
     *
     * @param description the description value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the friendlyName property: User friendly name of scaling plan.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

    /**
     * Set the friendlyName property: User friendly name of scaling plan.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withFriendlyName(friendlyName);
        return this;
    }

    /**
     * Get the timeZone property: Timezone of the scaling plan.
     *
     * @return the timeZone value.
     */
    public String timeZone() {
        return this.innerProperties() == null ? null : this.innerProperties().timeZone();
    }

    /**
     * Set the timeZone property: Timezone of the scaling plan.
     *
     * @param timeZone the timeZone value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withTimeZone(String timeZone) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withTimeZone(timeZone);
        return this;
    }

    /**
     * Get the hostPoolType property: HostPool type for desktop.
     *
     * @return the hostPoolType value.
     */
    public ScalingHostPoolType hostPoolType() {
        return this.innerProperties() == null ? null : this.innerProperties().hostPoolType();
    }

    /**
     * Set the hostPoolType property: HostPool type for desktop.
     *
     * @param hostPoolType the hostPoolType value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withHostPoolType(ScalingHostPoolType hostPoolType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withHostPoolType(hostPoolType);
        return this;
    }

    /**
     * Get the exclusionTag property: Exclusion tag for scaling plan.
     *
     * @return the exclusionTag value.
     */
    public String exclusionTag() {
        return this.innerProperties() == null ? null : this.innerProperties().exclusionTag();
    }

    /**
     * Set the exclusionTag property: Exclusion tag for scaling plan.
     *
     * @param exclusionTag the exclusionTag value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withExclusionTag(String exclusionTag) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withExclusionTag(exclusionTag);
        return this;
    }

    /**
     * Get the schedules property: List of ScalingPlanPooledSchedule definitions.
     *
     * @return the schedules value.
     */
    public List<ScalingSchedule> schedules() {
        return this.innerProperties() == null ? null : this.innerProperties().schedules();
    }

    /**
     * Set the schedules property: List of ScalingPlanPooledSchedule definitions.
     *
     * @param schedules the schedules value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withSchedules(List<ScalingSchedule> schedules) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withSchedules(schedules);
        return this;
    }

    /**
     * Get the hostPoolReferences property: List of ScalingHostPoolReference definitions.
     *
     * @return the hostPoolReferences value.
     */
    public List<ScalingHostPoolReference> hostPoolReferences() {
        return this.innerProperties() == null ? null : this.innerProperties().hostPoolReferences();
    }

    /**
     * Set the hostPoolReferences property: List of ScalingHostPoolReference definitions.
     *
     * @param hostPoolReferences the hostPoolReferences value to set.
     * @return the ScalingPlanInner object itself.
     */
    public ScalingPlanInner withHostPoolReferences(List<ScalingHostPoolReference> hostPoolReferences) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScalingPlanProperties();
        }
        this.innerProperties().withHostPoolReferences(hostPoolReferences);
        return this;
    }

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

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