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

/** Describes the properties of a SAP monitor. */
@Fluent
public final class MonitorProperties {
    /*
     * State of provisioning of the SAP monitor.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private WorkloadMonitorProvisioningState provisioningState;

    /*
     * Defines the SAP monitor errors.
     */
    @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY)
    private MonitorPropertiesErrors errors;

    /*
     * The SAP monitor resources will be deployed in the SAP monitoring region. The subnet region should be same as the
     * SAP monitoring region.
     */
    @JsonProperty(value = "appLocation")
    private String appLocation;

    /*
     * Sets the routing preference of the SAP monitor. By default only RFC1918 traffic is routed to the customer VNET.
     */
    @JsonProperty(value = "routingPreference")
    private RoutingPreference routingPreference;

    /*
     * 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.
     */
    @JsonProperty(value = "zoneRedundancyPreference")
    private String zoneRedundancyPreference;

    /*
     * Managed resource group configuration
     */
    @JsonProperty(value = "managedResourceGroupConfiguration")
    private ManagedRGConfiguration managedResourceGroupConfiguration;

    /*
     * The ARM ID of the Log Analytics Workspace that is used for SAP monitoring.
     */
    @JsonProperty(value = "logAnalyticsWorkspaceArmId")
    private String logAnalyticsWorkspaceArmId;

    /*
     * The subnet which the SAP monitor will be deployed in
     */
    @JsonProperty(value = "monitorSubnet")
    private String monitorSubnet;

    /*
     * The ARM ID of the MSI used for SAP monitoring.
     */
    @JsonProperty(value = "msiArmId", access = JsonProperty.Access.WRITE_ONLY)
    private String msiArmId;

    /*
     * The ARM ID of the Storage account used for SAP monitoring.
     */
    @JsonProperty(value = "storageAccountArmId", access = JsonProperty.Access.WRITE_ONLY)
    private String storageAccountArmId;

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

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

    /**
     * Get the errors property: Defines the SAP monitor errors.
     *
     * @return the errors value.
     */
    public MonitorPropertiesErrors errors() {
        return this.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.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 MonitorProperties object itself.
     */
    public MonitorProperties withAppLocation(String appLocation) {
        this.appLocation = 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.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 MonitorProperties object itself.
     */
    public MonitorProperties withRoutingPreference(RoutingPreference routingPreference) {
        this.routingPreference = 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.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 MonitorProperties object itself.
     */
    public MonitorProperties withZoneRedundancyPreference(String zoneRedundancyPreference) {
        this.zoneRedundancyPreference = zoneRedundancyPreference;
        return this;
    }

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

    /**
     * Set the managedResourceGroupConfiguration property: Managed resource group configuration.
     *
     * @param managedResourceGroupConfiguration the managedResourceGroupConfiguration value to set.
     * @return the MonitorProperties object itself.
     */
    public MonitorProperties withManagedResourceGroupConfiguration(
        ManagedRGConfiguration managedResourceGroupConfiguration) {
        this.managedResourceGroupConfiguration = 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.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 MonitorProperties object itself.
     */
    public MonitorProperties withLogAnalyticsWorkspaceArmId(String logAnalyticsWorkspaceArmId) {
        this.logAnalyticsWorkspaceArmId = 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.monitorSubnet;
    }

    /**
     * Set the monitorSubnet property: The subnet which the SAP monitor will be deployed in.
     *
     * @param monitorSubnet the monitorSubnet value to set.
     * @return the MonitorProperties object itself.
     */
    public MonitorProperties withMonitorSubnet(String monitorSubnet) {
        this.monitorSubnet = 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.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.storageAccountArmId;
    }

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