// 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.VirtualMachineTemplateInner;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.VirtualNicInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDisk;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualDiskController;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualMachineTemplate;
import com.azure.resourcemanager.vmwarecloudsimple.models.VirtualNic;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public final class VirtualMachineTemplateImpl implements VirtualMachineTemplate {
    private VirtualMachineTemplateInner innerObject;

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

    VirtualMachineTemplateImpl(
        VirtualMachineTemplateInner 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 String type() {
        return this.innerModel().type();
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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