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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.workloads.models.ApplicationServerVmDetails;
import com.azure.resourcemanager.workloads.models.LoadBalancerDetails;
import com.azure.resourcemanager.workloads.models.SapHealthState;
import com.azure.resourcemanager.workloads.models.SapVirtualInstanceError;
import com.azure.resourcemanager.workloads.models.SapVirtualInstanceProvisioningState;
import com.azure.resourcemanager.workloads.models.SapVirtualInstanceStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Define the SAP Application Server Instance resource. */
@Fluent
public final class SapApplicationServerInstanceInner extends Resource {
    /*
     * Defines the SAP Application Server instance properties.
     */
    @JsonProperty(value = "properties")
    private SapApplicationServerProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Defines the SAP Application Server instance properties.
     *
     * @return the innerProperties value.
     */
    private SapApplicationServerProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

    /**
     * Get the instanceNo property: Application server Instance Number.
     *
     * @return the instanceNo value.
     */
    public String instanceNo() {
        return this.innerProperties() == null ? null : this.innerProperties().instanceNo();
    }

    /**
     * Get the subnet property: Application server Subnet.
     *
     * @return the subnet value.
     */
    public String subnet() {
        return this.innerProperties() == null ? null : this.innerProperties().subnet();
    }

    /**
     * Get the hostname property: Application server instance SAP hostname.
     *
     * @return the hostname value.
     */
    public String hostname() {
        return this.innerProperties() == null ? null : this.innerProperties().hostname();
    }

    /**
     * Get the kernelVersion property: Application server instance SAP Kernel Version.
     *
     * @return the kernelVersion value.
     */
    public String kernelVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().kernelVersion();
    }

    /**
     * Get the kernelPatch property: Application server instance SAP Kernel Patch level.
     *
     * @return the kernelPatch value.
     */
    public String kernelPatch() {
        return this.innerProperties() == null ? null : this.innerProperties().kernelPatch();
    }

    /**
     * Get the ipAddress property: Application server instance SAP IP Address.
     *
     * @return the ipAddress value.
     */
    public String ipAddress() {
        return this.innerProperties() == null ? null : this.innerProperties().ipAddress();
    }

    /**
     * Get the gatewayPort property: Application server instance gateway Port.
     *
     * @return the gatewayPort value.
     */
    public Long gatewayPort() {
        return this.innerProperties() == null ? null : this.innerProperties().gatewayPort();
    }

    /**
     * Get the icmHttpPort property: Application server instance ICM HTTP Port.
     *
     * @return the icmHttpPort value.
     */
    public Long icmHttpPort() {
        return this.innerProperties() == null ? null : this.innerProperties().icmHttpPort();
    }

    /**
     * Get the icmHttpsPort property: Application server instance ICM HTTPS Port.
     *
     * @return the icmHttpsPort value.
     */
    public Long icmHttpsPort() {
        return this.innerProperties() == null ? null : this.innerProperties().icmHttpsPort();
    }

    /**
     * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Application
     * Server Virtual Machines.
     *
     * @return the loadBalancerDetails value.
     */
    public LoadBalancerDetails loadBalancerDetails() {
        return this.innerProperties() == null ? null : this.innerProperties().loadBalancerDetails();
    }

    /**
     * Get the vmDetails property: The list of virtual machines.
     *
     * @return the vmDetails value.
     */
    public List<ApplicationServerVmDetails> vmDetails() {
        return this.innerProperties() == null ? null : this.innerProperties().vmDetails();
    }

    /**
     * Get the status property: Defines the SAP Instance status.
     *
     * @return the status value.
     */
    public SapVirtualInstanceStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Get the health property: Defines the health of SAP Instances.
     *
     * @return the health value.
     */
    public SapHealthState health() {
        return this.innerProperties() == null ? null : this.innerProperties().health();
    }

    /**
     * Get the provisioningState property: Defines the provisioning states.
     *
     * @return the provisioningState value.
     */
    public SapVirtualInstanceProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the errors property: Defines the Application Instance errors.
     *
     * @return the errors value.
     */
    public SapVirtualInstanceError errors() {
        return this.innerProperties() == null ? null : this.innerProperties().errors();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
