// 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.ManagedRGConfiguration;
import com.azure.resourcemanager.workloads.models.MonitorPropertiesErrors;
import com.azure.resourcemanager.workloads.models.RoutingPreference;
import com.azure.resourcemanager.workloads.models.UserAssignedServiceIdentity;
import com.azure.resourcemanager.workloads.models.WorkloadMonitorProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** SAP monitor info on Azure (ARM properties and SAP monitor properties). */
@Fluent
public final class MonitorInner extends Resource {
    /*
     * [currently not in use] Managed service identity(user assigned identities)
     */
    @JsonProperty(value = "identity")
    private UserAssignedServiceIdentity identity;

    /*
     * SAP monitor properties
     */
    @JsonProperty(value = "properties")
    private MonitorProperties 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 MonitorInner class. */
    public MonitorInner() {
    }

    /**
     * Get the identity property: [currently not in use] Managed service identity(user assigned identities).
     *
     * @return the identity value.
     */
    public UserAssignedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: [currently not in use] Managed service identity(user assigned identities).
     *
     * @param identity the identity value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withIdentity(UserAssignedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the innerProperties property: SAP monitor properties.
     *
     * @return the innerProperties value.
     */
    private MonitorProperties 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 MonitorInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

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

    /**
     * Get the provisioningState property: State of provisioning of the SAP monitor.
     *
     * @return the provisioningState value.
     */
    public WorkloadMonitorProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the errors property: Defines the SAP monitor errors.
     *
     * @return the errors value.
     */
    public MonitorPropertiesErrors errors() {
        return this.innerProperties() == null ? null : this.innerProperties().errors();
    }

    /**
     * Get the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet
     * region should be same as the SAP monitoring region.
     *
     * @return the appLocation value.
     */
    public String appLocation() {
        return this.innerProperties() == null ? null : this.innerProperties().appLocation();
    }

    /**
     * Set the appLocation property: The SAP monitor resources will be deployed in the SAP monitoring region. The subnet
     * region should be same as the SAP monitoring region.
     *
     * @param appLocation the appLocation value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withAppLocation(String appLocation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MonitorProperties();
        }
        this.innerProperties().withAppLocation(appLocation);
        return this;
    }

    /**
     * Get the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918
     * traffic is routed to the customer VNET.
     *
     * @return the routingPreference value.
     */
    public RoutingPreference routingPreference() {
        return this.innerProperties() == null ? null : this.innerProperties().routingPreference();
    }

    /**
     * Set the routingPreference property: Sets the routing preference of the SAP monitor. By default only RFC1918
     * traffic is routed to the customer VNET.
     *
     * @param routingPreference the routingPreference value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withRoutingPreference(RoutingPreference routingPreference) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MonitorProperties();
        }
        this.innerProperties().withRoutingPreference(routingPreference);
        return this;
    }

    /**
     * Get the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the
     * SAP monitor. By default resources will be created which do not support zone redundancy.
     *
     * @return the zoneRedundancyPreference value.
     */
    public String zoneRedundancyPreference() {
        return this.innerProperties() == null ? null : this.innerProperties().zoneRedundancyPreference();
    }

    /**
     * Set the zoneRedundancyPreference property: Sets the preference for zone redundancy on resources created for the
     * SAP monitor. By default resources will be created which do not support zone redundancy.
     *
     * @param zoneRedundancyPreference the zoneRedundancyPreference value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withZoneRedundancyPreference(String zoneRedundancyPreference) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MonitorProperties();
        }
        this.innerProperties().withZoneRedundancyPreference(zoneRedundancyPreference);
        return this;
    }

    /**
     * Get the managedResourceGroupConfiguration property: Managed resource group configuration.
     *
     * @return the managedResourceGroupConfiguration value.
     */
    public ManagedRGConfiguration managedResourceGroupConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().managedResourceGroupConfiguration();
    }

    /**
     * Set the managedResourceGroupConfiguration property: Managed resource group configuration.
     *
     * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withManagedResourceGroupConfiguration(
        ManagedRGConfiguration managedResourceGroupConfiguration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MonitorProperties();
        }
        this.innerProperties().withManagedResourceGroupConfiguration(managedResourceGroupConfiguration);
        return this;
    }

    /**
     * Get the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP
     * monitoring.
     *
     * @return the logAnalyticsWorkspaceArmId value.
     */
    public String logAnalyticsWorkspaceArmId() {
        return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsWorkspaceArmId();
    }

    /**
     * Set the logAnalyticsWorkspaceArmId property: The ARM ID of the Log Analytics Workspace that is used for SAP
     * monitoring.
     *
     * @param logAnalyticsWorkspaceArmId the logAnalyticsWorkspaceArmId value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MonitorProperties();
        }
        this.innerProperties().withLogAnalyticsWorkspaceArmId(logAnalyticsWorkspaceArmId);
        return this;
    }

    /**
     * Get the monitorSubnet property: The subnet which the SAP monitor will be deployed in.
     *
     * @return the monitorSubnet value.
     */
    public String monitorSubnet() {
        return this.innerProperties() == null ? null : this.innerProperties().monitorSubnet();
    }

    /**
     * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in.
     *
     * @param monitorSubnet the monitorSubnet value to set.
     * @return the MonitorInner object itself.
     */
    public MonitorInner withMonitorSubnet(String monitorSubnet) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MonitorProperties();
        }
        this.innerProperties().withMonitorSubnet(monitorSubnet);
        return this;
    }

    /**
     * Get the msiArmId property: The ARM ID of the MSI used for SAP monitoring.
     *
     * @return the msiArmId value.
     */
    public String msiArmId() {
        return this.innerProperties() == null ? null : this.innerProperties().msiArmId();
    }

    /**
     * Get the storageAccountArmId property: The ARM ID of the Storage account used for SAP monitoring.
     *
     * @return the storageAccountArmId value.
     */
    public String storageAccountArmId() {
        return this.innerProperties() == null ? null : this.innerProperties().storageAccountArmId();
    }

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