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

package com.azure.resourcemanager.storagepool.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.storagepool.models.Disk;
import com.azure.resourcemanager.storagepool.models.OperationalStatus;
import com.azure.resourcemanager.storagepool.models.ProvisioningStates;
import com.azure.resourcemanager.storagepool.models.SystemMetadata;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Response for Disk Pool request. */
@Fluent
public final class DiskPoolInner extends Resource {
    /*
     * Determines the SKU of the Disk pool
     */
    @JsonProperty(value = "sku")
    private Sku innerSku;

    /*
     * Properties of Disk Pool.
     */
    @JsonProperty(value = "properties", required = true)
    private DiskPoolProperties innerProperties = new DiskPoolProperties();

    /*
     * Azure resource id. Indicates if this resource is managed by another Azure resource.
     */
    @JsonProperty(value = "managedBy", access = JsonProperty.Access.WRITE_ONLY)
    private String managedBy;

    /*
     * List of Azure resource ids that manage this resource.
     */
    @JsonProperty(value = "managedByExtended", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> managedByExtended;

    /*
     * Resource metadata required by ARM RPC
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemMetadata systemData;

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

    /**
     * Get the innerSku property: Determines the SKU of the Disk pool.
     *
     * @return the innerSku value.
     */
    private Sku innerSku() {
        return this.innerSku;
    }

    /**
     * Get the innerProperties property: Properties of Disk Pool.
     *
     * @return the innerProperties value.
     */
    private DiskPoolProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the managedBy property: Azure resource id. Indicates if this resource is managed by another Azure resource.
     *
     * @return the managedBy value.
     */
    public String managedBy() {
        return this.managedBy;
    }

    /**
     * Get the managedByExtended property: List of Azure resource ids that manage this resource.
     *
     * @return the managedByExtended value.
     */
    public List<String> managedByExtended() {
        return this.managedByExtended;
    }

    /**
     * Get the systemData property: Resource metadata required by ARM RPC.
     *
     * @return the systemData value.
     */
    public SystemMetadata systemData() {
        return this.systemData;
    }

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

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

    /**
     * Get the name property: Sku name.
     *
     * @return the name value.
     */
    public String nameSkuName() {
        return this.innerSku() == null ? null : this.innerSku().name();
    }

    /**
     * Set the name property: Sku name.
     *
     * @param name the name value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withNameSkuName(String name) {
        if (this.innerSku() == null) {
            this.innerSku = new Sku();
        }
        this.innerSku().withName(name);
        return this;
    }

    /**
     * Get the tier property: Sku tier.
     *
     * @return the tier value.
     */
    public String tier() {
        return this.innerSku() == null ? null : this.innerSku().tier();
    }

    /**
     * Set the tier property: Sku tier.
     *
     * @param tier the tier value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withTier(String tier) {
        if (this.innerSku() == null) {
            this.innerSku = new Sku();
        }
        this.innerSku().withTier(tier);
        return this;
    }

    /**
     * Get the provisioningState property: State of the operation on the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningStates provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"].
     *
     * @return the availabilityZones value.
     */
    public List<String> availabilityZones() {
        return this.innerProperties() == null ? null : this.innerProperties().availabilityZones();
    }

    /**
     * Set the availabilityZones property: Logical zone for Disk Pool resource; example: ["1"].
     *
     * @param availabilityZones the availabilityZones value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withAvailabilityZones(List<String> availabilityZones) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DiskPoolProperties();
        }
        this.innerProperties().withAvailabilityZones(availabilityZones);
        return this;
    }

    /**
     * Get the status property: Operational status of the Disk Pool.
     *
     * @return the status value.
     */
    public OperationalStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Set the status property: Operational status of the Disk Pool.
     *
     * @param status the status value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withStatus(OperationalStatus status) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DiskPoolProperties();
        }
        this.innerProperties().withStatus(status);
        return this;
    }

    /**
     * Get the disks property: List of Azure Managed Disks to attach to a Disk Pool.
     *
     * @return the disks value.
     */
    public List<Disk> disks() {
        return this.innerProperties() == null ? null : this.innerProperties().disks();
    }

    /**
     * Set the disks property: List of Azure Managed Disks to attach to a Disk Pool.
     *
     * @param disks the disks value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withDisks(List<Disk> disks) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DiskPoolProperties();
        }
        this.innerProperties().withDisks(disks);
        return this;
    }

    /**
     * Get the subnetId property: Azure Resource ID of a Subnet for the Disk Pool.
     *
     * @return the subnetId value.
     */
    public String subnetId() {
        return this.innerProperties() == null ? null : this.innerProperties().subnetId();
    }

    /**
     * Set the subnetId property: Azure Resource ID of a Subnet for the Disk Pool.
     *
     * @param subnetId the subnetId value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withSubnetId(String subnetId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DiskPoolProperties();
        }
        this.innerProperties().withSubnetId(subnetId);
        return this;
    }

    /**
     * Get the additionalCapabilities property: List of additional capabilities for Disk Pool.
     *
     * @return the additionalCapabilities value.
     */
    public List<String> additionalCapabilities() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalCapabilities();
    }

    /**
     * Set the additionalCapabilities property: List of additional capabilities for Disk Pool.
     *
     * @param additionalCapabilities the additionalCapabilities value to set.
     * @return the DiskPoolInner object itself.
     */
    public DiskPoolInner withAdditionalCapabilities(List<String> additionalCapabilities) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DiskPoolProperties();
        }
        this.innerProperties().withAdditionalCapabilities(additionalCapabilities);
        return this;
    }

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

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