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

package com.azure.resourcemanager.vmwarecloudsimple.implementation;

import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.PrivateCloudInner;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.ResourcePoolInner;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.VirtualMachineTemplateInner;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.VirtualNetworkInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.PrivateCloud;
import com.azure.resourcemanager.vmwarecloudsimple.models.PrivateCloudResourceType;
import com.azure.resourcemanager.vmwarecloudsimple.models.ResourcePool;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualMachineTemplate;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualNetwork;
import java.time.OffsetDateTime;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;

public final class PrivateCloudImpl implements PrivateCloud {
    private PrivateCloudInner innerObject;

    private final com.azure.resourcemanager.vmwarecloudsimple.VMwareCloudSimpleManager serviceManager;

    PrivateCloudImpl(
        PrivateCloudInner innerObject,
        com.azure.resourcemanager.vmwarecloudsimple.VMwareCloudSimpleManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public String id() {
        return this.innerModel().id();
    }

    public String location() {
        return this.innerModel().location();
    }

    public String name() {
        return this.innerModel().name();
    }

    public PrivateCloudResourceType type() {
        return this.innerModel().type();
    }

    public String availabilityZoneId() {
        return this.innerModel().availabilityZoneId();
    }

    public String availabilityZoneName() {
        return this.innerModel().availabilityZoneName();
    }

    public Integer clustersNumber() {
        return this.innerModel().clustersNumber();
    }

    public String createdBy() {
        return this.innerModel().createdBy();
    }

    public OffsetDateTime createdOn() {
        return this.innerModel().createdOn();
    }

    public List<String> dnsServers() {
        List<String> inner = this.innerModel().dnsServers();
        if (inner != null) {
            return Collections.unmodifiableList(inner);
        } else {
            return Collections.emptyList();
        }
    }

    public String expires() {
        return this.innerModel().expires();
    }

    public String nsxType() {
        return this.innerModel().nsxType();
    }

    public String placementGroupId() {
        return this.innerModel().placementGroupId();
    }

    public String placementGroupName() {
        return this.innerModel().placementGroupName();
    }

    public UUID privateCloudId() {
        return this.innerModel().privateCloudId();
    }

    public List<ResourcePool> resourcePools() {
        List<ResourcePoolInner> inner = this.innerModel().resourcePools();
        if (inner != null) {
            return Collections
                .unmodifiableList(
                    inner
                        .stream()
                        .map(inner1 -> new ResourcePoolImpl(inner1, this.manager()))
                        .collect(Collectors.toList()));
        } else {
            return Collections.emptyList();
        }
    }

    public String state() {
        return this.innerModel().state();
    }

    public Integer totalCpuCores() {
        return this.innerModel().totalCpuCores();
    }

    public Integer totalNodes() {
        return this.innerModel().totalNodes();
    }

    public Integer totalRam() {
        return this.innerModel().totalRam();
    }

    public Float totalStorage() {
        return this.innerModel().totalStorage();
    }

    public String typePropertiesType() {
        return this.innerModel().typePropertiesType();
    }

    public String vSphereVersion() {
        return this.innerModel().vSphereVersion();
    }

    public String vcenterFqdn() {
        return this.innerModel().vcenterFqdn();
    }

    public String vcenterRefid() {
        return this.innerModel().vcenterRefid();
    }

    public List<VirtualMachineTemplate> virtualMachineTemplates() {
        List<VirtualMachineTemplateInner> inner = this.innerModel().virtualMachineTemplates();
        if (inner != null) {
            return Collections
                .unmodifiableList(
                    inner
                        .stream()
                        .map(inner1 -> new VirtualMachineTemplateImpl(inner1, this.manager()))
                        .collect(Collectors.toList()));
        } else {
            return Collections.emptyList();
        }
    }

    public List<VirtualNetwork> virtualNetworks() {
        List<VirtualNetworkInner> inner = this.innerModel().virtualNetworks();
        if (inner != null) {
            return Collections
                .unmodifiableList(
                    inner
                        .stream()
                        .map(inner1 -> new VirtualNetworkImpl(inner1, this.manager()))
                        .collect(Collectors.toList()));
        } else {
            return Collections.emptyList();
        }
    }

    public Boolean vrOpsEnabled() {
        return this.innerModel().vrOpsEnabled();
    }

    public PrivateCloudInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.vmwarecloudsimple.VMwareCloudSimpleManager manager() {
        return this.serviceManager;
    }
}
