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

package com.azure.resourcemanager.newrelicobservability.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.newrelicobservability.fluent.models.MonitoredResourceInner;
import com.azure.resourcemanager.newrelicobservability.models.SendingLogsStatus;
import com.azure.resourcemanager.newrelicobservability.models.SendingMetricsStatus;
import org.junit.jupiter.api.Assertions;

public final class MonitoredResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MonitoredResourceInner model =
            BinaryData
                .fromString(
                    "{\"id\":\"uqkhrsajiwku\",\"sendingMetrics\":\"Enabled\",\"reasonForMetricsStatus\":\"kg\",\"sendingLogs\":\"Enabled\",\"reasonForLogsStatus\":\"uimjmvx\"}")
                .toObject(MonitoredResourceInner.class);
        Assertions.assertEquals("uqkhrsajiwku", model.id());
        Assertions.assertEquals(SendingMetricsStatus.ENABLED, model.sendingMetrics());
        Assertions.assertEquals("kg", model.reasonForMetricsStatus());
        Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs());
        Assertions.assertEquals("uimjmvx", model.reasonForLogsStatus());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MonitoredResourceInner model =
            new MonitoredResourceInner()
                .withId("uqkhrsajiwku")
                .withSendingMetrics(SendingMetricsStatus.ENABLED)
                .withReasonForMetricsStatus("kg")
                .withSendingLogs(SendingLogsStatus.ENABLED)
                .withReasonForLogsStatus("uimjmvx");
        model = BinaryData.fromObject(model).toObject(MonitoredResourceInner.class);
        Assertions.assertEquals("uqkhrsajiwku", model.id());
        Assertions.assertEquals(SendingMetricsStatus.ENABLED, model.sendingMetrics());
        Assertions.assertEquals("kg", model.reasonForMetricsStatus());
        Assertions.assertEquals(SendingLogsStatus.ENABLED, model.sendingLogs());
        Assertions.assertEquals("uimjmvx", model.reasonForLogsStatus());
    }
}
