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

package com.azure.resourcemanager.azurestack.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.azurestack.fluent.models.ProductNestedProperties;
import com.azure.resourcemanager.azurestack.models.Compatibility;
import com.azure.resourcemanager.azurestack.models.CompatibilityIssue;
import com.azure.resourcemanager.azurestack.models.IconUris;
import com.azure.resourcemanager.azurestack.models.ProductLink;
import com.azure.resourcemanager.azurestack.models.ProductProperties;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ProductNestedPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ProductNestedProperties model =
            BinaryData
                .fromString(
                    "{\"displayName\":\"jpgd\",\"description\":\"ocjjxhvpmouexh\",\"publisherDisplayName\":\"xibqeojnx\",\"publisherIdentifier\":\"zvddntwndeicbtwn\",\"offer\":\"aoqvuh\",\"offerVersion\":\"cffcyddglmj\",\"sku\":\"jqkwpyeicx\",\"billingPartNumber\":\"ciwqvhk\",\"vmExtensionType\":\"xuigdtopbobj\",\"galleryItemIdentity\":\"hm\",\"iconUris\":{\"large\":\"a\",\"wide\":\"uhrzayvvt\",\"medium\":\"vdfgiotk\",\"small\":\"utqxlngx\",\"hero\":\"fgugnxkrxdqmid\"},\"links\":[{\"displayName\":\"rvqdra\",\"uri\":\"jybige\"},{\"displayName\":\"qfbow\",\"uri\":\"anyktzlcuiywg\"}],\"legalTerms\":\"wgndrvynhzgpp\",\"privacyPolicy\":\"cgyncocpecf\",\"payloadLength\":3972915979218676808,\"productKind\":\"ofsx\",\"productProperties\":{\"version\":\"v\"},\"compatibility\":{\"isCompatible\":true,\"message\":\"qabcypm\",\"description\":\"kwlzuvccfwnfn\",\"issues\":[\"ADFSIdentitySystemRequired\",\"LowerDeviceVersionRequired\"]}}")
                .toObject(ProductNestedProperties.class);
        Assertions.assertEquals("jpgd", model.displayName());
        Assertions.assertEquals("ocjjxhvpmouexh", model.description());
        Assertions.assertEquals("xibqeojnx", model.publisherDisplayName());
        Assertions.assertEquals("zvddntwndeicbtwn", model.publisherIdentifier());
        Assertions.assertEquals("aoqvuh", model.offer());
        Assertions.assertEquals("cffcyddglmj", model.offerVersion());
        Assertions.assertEquals("jqkwpyeicx", model.sku());
        Assertions.assertEquals("ciwqvhk", model.billingPartNumber());
        Assertions.assertEquals("xuigdtopbobj", model.vmExtensionType());
        Assertions.assertEquals("hm", model.galleryItemIdentity());
        Assertions.assertEquals("a", model.iconUris().large());
        Assertions.assertEquals("uhrzayvvt", model.iconUris().wide());
        Assertions.assertEquals("vdfgiotk", model.iconUris().medium());
        Assertions.assertEquals("utqxlngx", model.iconUris().small());
        Assertions.assertEquals("fgugnxkrxdqmid", model.iconUris().hero());
        Assertions.assertEquals("rvqdra", model.links().get(0).displayName());
        Assertions.assertEquals("jybige", model.links().get(0).uri());
        Assertions.assertEquals("wgndrvynhzgpp", model.legalTerms());
        Assertions.assertEquals("cgyncocpecf", model.privacyPolicy());
        Assertions.assertEquals(3972915979218676808L, model.payloadLength());
        Assertions.assertEquals("ofsx", model.productKind());
        Assertions.assertEquals("v", model.productProperties().version());
        Assertions.assertEquals(true, model.compatibility().isCompatible());
        Assertions.assertEquals("qabcypm", model.compatibility().message());
        Assertions.assertEquals("kwlzuvccfwnfn", model.compatibility().description());
        Assertions.assertEquals(CompatibilityIssue.ADFSIDENTITY_SYSTEM_REQUIRED, model.compatibility().issues().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ProductNestedProperties model =
            new ProductNestedProperties()
                .withDisplayName("jpgd")
                .withDescription("ocjjxhvpmouexh")
                .withPublisherDisplayName("xibqeojnx")
                .withPublisherIdentifier("zvddntwndeicbtwn")
                .withOffer("aoqvuh")
                .withOfferVersion("cffcyddglmj")
                .withSku("jqkwpyeicx")
                .withBillingPartNumber("ciwqvhk")
                .withVmExtensionType("xuigdtopbobj")
                .withGalleryItemIdentity("hm")
                .withIconUris(
                    new IconUris()
                        .withLarge("a")
                        .withWide("uhrzayvvt")
                        .withMedium("vdfgiotk")
                        .withSmall("utqxlngx")
                        .withHero("fgugnxkrxdqmid"))
                .withLinks(
                    Arrays
                        .asList(
                            new ProductLink().withDisplayName("rvqdra").withUri("jybige"),
                            new ProductLink().withDisplayName("qfbow").withUri("anyktzlcuiywg")))
                .withLegalTerms("wgndrvynhzgpp")
                .withPrivacyPolicy("cgyncocpecf")
                .withPayloadLength(3972915979218676808L)
                .withProductKind("ofsx")
                .withProductProperties(new ProductProperties().withVersion("v"))
                .withCompatibility(
                    new Compatibility()
                        .withIsCompatible(true)
                        .withMessage("qabcypm")
                        .withDescription("kwlzuvccfwnfn")
                        .withIssues(
                            Arrays
                                .asList(
                                    CompatibilityIssue.ADFSIDENTITY_SYSTEM_REQUIRED,
                                    CompatibilityIssue.LOWER_DEVICE_VERSION_REQUIRED)));
        model = BinaryData.fromObject(model).toObject(ProductNestedProperties.class);
        Assertions.assertEquals("jpgd", model.displayName());
        Assertions.assertEquals("ocjjxhvpmouexh", model.description());
        Assertions.assertEquals("xibqeojnx", model.publisherDisplayName());
        Assertions.assertEquals("zvddntwndeicbtwn", model.publisherIdentifier());
        Assertions.assertEquals("aoqvuh", model.offer());
        Assertions.assertEquals("cffcyddglmj", model.offerVersion());
        Assertions.assertEquals("jqkwpyeicx", model.sku());
        Assertions.assertEquals("ciwqvhk", model.billingPartNumber());
        Assertions.assertEquals("xuigdtopbobj", model.vmExtensionType());
        Assertions.assertEquals("hm", model.galleryItemIdentity());
        Assertions.assertEquals("a", model.iconUris().large());
        Assertions.assertEquals("uhrzayvvt", model.iconUris().wide());
        Assertions.assertEquals("vdfgiotk", model.iconUris().medium());
        Assertions.assertEquals("utqxlngx", model.iconUris().small());
        Assertions.assertEquals("fgugnxkrxdqmid", model.iconUris().hero());
        Assertions.assertEquals("rvqdra", model.links().get(0).displayName());
        Assertions.assertEquals("jybige", model.links().get(0).uri());
        Assertions.assertEquals("wgndrvynhzgpp", model.legalTerms());
        Assertions.assertEquals("cgyncocpecf", model.privacyPolicy());
        Assertions.assertEquals(3972915979218676808L, model.payloadLength());
        Assertions.assertEquals("ofsx", model.productKind());
        Assertions.assertEquals("v", model.productProperties().version());
        Assertions.assertEquals(true, model.compatibility().isCompatible());
        Assertions.assertEquals("qabcypm", model.compatibility().message());
        Assertions.assertEquals("kwlzuvccfwnfn", model.compatibility().description());
        Assertions.assertEquals(CompatibilityIssue.ADFSIDENTITY_SYSTEM_REQUIRED, model.compatibility().issues().get(0));
    }
}
