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

package com.azure.resourcemanager.dataprotection.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.dataprotection.fluent.models.ResourceGuardProxyBaseResourceInner;
import com.azure.resourcemanager.dataprotection.models.ResourceGuardOperationDetail;
import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ResourceGuardProxyBaseResourceInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ResourceGuardProxyBaseResourceInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"resourceGuardResourceId\":\"gjltdtbnnhado\",\"resourceGuardOperationDetails\":[{\"vaultCriticalOperation\":\"vcikhnvpamqgx\",\"defaultResourceRequest\":\"u\"},{\"vaultCriticalOperation\":\"ik\",\"defaultResourceRequest\":\"ggxkallatmelwuip\"},{\"vaultCriticalOperation\":\"cjzkzivgvvcna\",\"defaultResourceRequest\":\"hyrnxxmu\"}],\"lastUpdatedTime\":\"dndrdvstkwqqtche\",\"description\":\"mfmtdaaygdvw\"},\"id\":\"piohgwxrtfu\",\"name\":\"xepxgyqagvrvmn\",\"type\":\"k\"}")
                .toObject(ResourceGuardProxyBaseResourceInner.class);
        Assertions.assertEquals("gjltdtbnnhado", model.properties().resourceGuardResourceId());
        Assertions
            .assertEquals(
                "vcikhnvpamqgx", model.properties().resourceGuardOperationDetails().get(0).vaultCriticalOperation());
        Assertions
            .assertEquals("u", model.properties().resourceGuardOperationDetails().get(0).defaultResourceRequest());
        Assertions.assertEquals("dndrdvstkwqqtche", model.properties().lastUpdatedTime());
        Assertions.assertEquals("mfmtdaaygdvw", model.properties().description());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ResourceGuardProxyBaseResourceInner model =
            new ResourceGuardProxyBaseResourceInner()
                .withProperties(
                    new ResourceGuardProxyBase()
                        .withResourceGuardResourceId("gjltdtbnnhado")
                        .withResourceGuardOperationDetails(
                            Arrays
                                .asList(
                                    new ResourceGuardOperationDetail()
                                        .withVaultCriticalOperation("vcikhnvpamqgx")
                                        .withDefaultResourceRequest("u"),
                                    new ResourceGuardOperationDetail()
                                        .withVaultCriticalOperation("ik")
                                        .withDefaultResourceRequest("ggxkallatmelwuip"),
                                    new ResourceGuardOperationDetail()
                                        .withVaultCriticalOperation("cjzkzivgvvcna")
                                        .withDefaultResourceRequest("hyrnxxmu")))
                        .withLastUpdatedTime("dndrdvstkwqqtche")
                        .withDescription("mfmtdaaygdvw"));
        model = BinaryData.fromObject(model).toObject(ResourceGuardProxyBaseResourceInner.class);
        Assertions.assertEquals("gjltdtbnnhado", model.properties().resourceGuardResourceId());
        Assertions
            .assertEquals(
                "vcikhnvpamqgx", model.properties().resourceGuardOperationDetails().get(0).vaultCriticalOperation());
        Assertions
            .assertEquals("u", model.properties().resourceGuardOperationDetails().get(0).defaultResourceRequest());
        Assertions.assertEquals("dndrdvstkwqqtche", model.properties().lastUpdatedTime());
        Assertions.assertEquals("mfmtdaaygdvw", model.properties().description());
    }
}
