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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.logz.models.IdentityProperties;
import com.azure.resourcemanager.logz.models.MonitorProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The LogzMonitorResource model. */
@Fluent
public final class LogzMonitorResourceInner extends Resource {
    /*
     * The system metadata relating to this resource
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Properties specific to the monitor resource.
     */
    @JsonProperty(value = "properties")
    private MonitorProperties properties;

    /*
     * The identity property.
     */
    @JsonProperty(value = "identity")
    private IdentityProperties identity;

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

    /**
     * Get the systemData property: The system metadata relating to this resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the properties property: Properties specific to the monitor resource.
     *
     * @return the properties value.
     */
    public MonitorProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: Properties specific to the monitor resource.
     *
     * @param properties the properties value to set.
     * @return the LogzMonitorResourceInner object itself.
     */
    public LogzMonitorResourceInner withProperties(MonitorProperties properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the identity property: The identity property.
     *
     * @return the identity value.
     */
    public IdentityProperties identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The identity property.
     *
     * @param identity the identity value to set.
     * @return the LogzMonitorResourceInner object itself.
     */
    public LogzMonitorResourceInner withIdentity(IdentityProperties identity) {
        this.identity = identity;
        return this;
    }

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

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

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