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

package com.azure.resourcemanager.elastic.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.elastic.fluent.models.MonitoringTagRulesInner;
import com.azure.resourcemanager.elastic.models.LogRules;
import com.azure.resourcemanager.elastic.models.MonitoringTagRulesProperties;
import com.azure.resourcemanager.elastic.models.ProvisioningState;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class MonitoringTagRulesInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MonitoringTagRulesInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"provisioningState\":\"Accepted\",\"logRules\":{\"sendAadLogs\":false,\"sendSubscriptionLogs\":false,\"sendActivityLogs\":false,\"filteringTags\":[]}},\"id\":\"cjxvsnbyxqab\",\"name\":\"mocpc\",\"type\":\"shurzafbljjgpbto\"}")
                .toObject(MonitoringTagRulesInner.class);
        Assertions.assertEquals(ProvisioningState.ACCEPTED, model.properties().provisioningState());
        Assertions.assertEquals(false, model.properties().logRules().sendAadLogs());
        Assertions.assertEquals(false, model.properties().logRules().sendSubscriptionLogs());
        Assertions.assertEquals(false, model.properties().logRules().sendActivityLogs());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MonitoringTagRulesInner model =
            new MonitoringTagRulesInner()
                .withProperties(
                    new MonitoringTagRulesProperties()
                        .withProvisioningState(ProvisioningState.ACCEPTED)
                        .withLogRules(
                            new LogRules()
                                .withSendAadLogs(false)
                                .withSendSubscriptionLogs(false)
                                .withSendActivityLogs(false)
                                .withFilteringTags(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(MonitoringTagRulesInner.class);
        Assertions.assertEquals(ProvisioningState.ACCEPTED, model.properties().provisioningState());
        Assertions.assertEquals(false, model.properties().logRules().sendAadLogs());
        Assertions.assertEquals(false, model.properties().logRules().sendSubscriptionLogs());
        Assertions.assertEquals(false, model.properties().logRules().sendActivityLogs());
    }
}
