// 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.DatabaseVmDetails;
import com.azure.resourcemanager.workloads.models.LoadBalancerDetails;
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 Database resource. */
@Fluent
public final class SapDatabaseInstanceInner extends Resource {
    /*
     * Defines the Database properties.
     */
    @JsonProperty(value = "properties")
    private SapDatabaseProperties 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 SapDatabaseInstanceInner class. */
    public SapDatabaseInstanceInner() {
    }

    /**
     * Get the innerProperties property: Defines the Database properties.
     *
     * @return the innerProperties value.
     */
    private SapDatabaseProperties 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 SapDatabaseInstanceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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

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

    /**
     * Get the databaseSid property: Database SID name.
     *
     * @return the databaseSid value.
     */
    public String databaseSid() {
        return this.innerProperties() == null ? null : this.innerProperties().databaseSid();
    }

    /**
     * Get the databaseType property: Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL
     * Server.
     *
     * @return the databaseType value.
     */
    public String databaseType() {
        return this.innerProperties() == null ? null : this.innerProperties().databaseType();
    }

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

    /**
     * Get the loadBalancerDetails property: The Load Balancer details such as LoadBalancer ID attached to Database
     * 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 corresponding to the Database resource.
     *
     * @return the vmDetails value.
     */
    public List<DatabaseVmDetails> 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 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 errors related to Database resource.
     *
     * @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();
        }
    }
}
