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

package com.azure.resourcemanager.datadog.generated;

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

public final class MonitoringTagRulesListResponseTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        MonitoringTagRulesListResponse model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"yifqrvkdvjsllrmv\",\"name\":\"d\",\"type\":\"watkpnpulexxb\"},{\"properties\":{\"provisioningState\":\"Succeeded\"},\"id\":\"iqzbq\",\"name\":\"vsovmyokac\",\"type\":\"pkwlhz\"},{\"properties\":{\"provisioningState\":\"Deleting\"},\"id\":\"flbvvnchrkcciwwz\",\"name\":\"uqkhrsajiwku\",\"type\":\"foskghsauuimj\"},{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"ugidyjrr\",\"name\":\"byao\",\"type\":\"v\"}],\"nextLink\":\"csonpclhoco\"}")
                .toObject(MonitoringTagRulesListResponse.class);
        Assertions.assertEquals("csonpclhoco", model.nextLink());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        MonitoringTagRulesListResponse model =
            new MonitoringTagRulesListResponse()
                .withValue(
                    Arrays
                        .asList(
                            new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()),
                            new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()),
                            new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties()),
                            new MonitoringTagRulesInner().withProperties(new MonitoringTagRulesProperties())))
                .withNextLink("csonpclhoco");
        model = BinaryData.fromObject(model).toObject(MonitoringTagRulesListResponse.class);
        Assertions.assertEquals("csonpclhoco", model.nextLink());
    }
}
