// 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.ApplicationGroupType;
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.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Represents a ApplicationGroup definition. */
@Fluent
public final class ApplicationGroupInner 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 ApplicationGroup
     */
    @JsonProperty(value = "properties", required = true)
    private ApplicationGroupProperties innerProperties = new ApplicationGroupProperties();

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

    /**
     * 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 ApplicationGroup.
     *
     * @return the innerProperties value.
     */
    private ApplicationGroupProperties innerProperties() {
        return this.innerProperties;
    }

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

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

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

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

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

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

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

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

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

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

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

    /**
     * Set the friendlyName property: Friendly name of ApplicationGroup.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the ApplicationGroupInner object itself.
     */
    public ApplicationGroupInner withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationGroupProperties();
        }
        this.innerProperties().withFriendlyName(friendlyName);
        return this;
    }

    /**
     * Get the hostPoolArmPath property: HostPool arm path of ApplicationGroup.
     *
     * @return the hostPoolArmPath value.
     */
    public String hostPoolArmPath() {
        return this.innerProperties() == null ? null : this.innerProperties().hostPoolArmPath();
    }

    /**
     * Set the hostPoolArmPath property: HostPool arm path of ApplicationGroup.
     *
     * @param hostPoolArmPath the hostPoolArmPath value to set.
     * @return the ApplicationGroupInner object itself.
     */
    public ApplicationGroupInner withHostPoolArmPath(String hostPoolArmPath) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationGroupProperties();
        }
        this.innerProperties().withHostPoolArmPath(hostPoolArmPath);
        return this;
    }

    /**
     * Get the workspaceArmPath property: Workspace arm path of ApplicationGroup.
     *
     * @return the workspaceArmPath value.
     */
    public String workspaceArmPath() {
        return this.innerProperties() == null ? null : this.innerProperties().workspaceArmPath();
    }

    /**
     * Get the applicationGroupType property: Resource Type of ApplicationGroup.
     *
     * @return the applicationGroupType value.
     */
    public ApplicationGroupType applicationGroupType() {
        return this.innerProperties() == null ? null : this.innerProperties().applicationGroupType();
    }

    /**
     * Set the applicationGroupType property: Resource Type of ApplicationGroup.
     *
     * @param applicationGroupType the applicationGroupType value to set.
     * @return the ApplicationGroupInner object itself.
     */
    public ApplicationGroupInner withApplicationGroupType(ApplicationGroupType applicationGroupType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ApplicationGroupProperties();
        }
        this.innerProperties().withApplicationGroupType(applicationGroupType);
        return this;
    }

    /**
     * Get the cloudPcResource property: Is cloud pc resource.
     *
     * @return the cloudPcResource value.
     */
    public Boolean cloudPcResource() {
        return this.innerProperties() == null ? null : this.innerProperties().cloudPcResource();
    }

    /**
     * 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 ApplicationGroupInner"));
        } else {
            innerProperties().validate();
        }
    }

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