// 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.ProductInner;
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 ProductInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ProductInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"displayName\":\"tbzsgfyccs\",\"description\":\"wmdwzjeiachboo\",\"publisherDisplayName\":\"lnrosfqp\",\"publisherIdentifier\":\"ehzzvypyqrim\",\"offer\":\"npvswjdkirso\",\"offerVersion\":\"qxhcrmn\",\"sku\":\"jtckwhdso\",\"billingPartNumber\":\"iy\",\"vmExtensionType\":\"jxsqwpgrjbz\",\"galleryItemIdentity\":\"rcjxvsnbyxqabn\",\"iconUris\":{\"large\":\"pcyshu\",\"wide\":\"afbljjgpbtoqcjmk\",\"medium\":\"a\",\"small\":\"qidtqajzyu\",\"hero\":\"kudjkrlkhb\"},\"links\":[{\"displayName\":\"pgzgq\",\"uri\":\"zloc\"},{\"displayName\":\"c\",\"uri\":\"ierhhbcsglummaj\"}],\"legalTerms\":\"aodxo\",\"privacyPolicy\":\"bdxkqpxokaj\",\"payloadLength\":4793683131243890643,\"productKind\":\"mexgstxgcp\",\"productProperties\":{\"version\":\"maajrmvdjwzrlo\"},\"compatibility\":{\"isCompatible\":true,\"message\":\"hijco\",\"description\":\"ctbzaq\",\"issues\":[\"DevelopmentBillingModelRequired\",\"HigherDeviceVersionRequired\"]}},\"etag\":\"kbfkg\",\"id\":\"kdkexxp\",\"name\":\"ofmx\",\"type\":\"x\"}")
                .toObject(ProductInner.class);
        Assertions.assertEquals("kbfkg", model.etag());
        Assertions.assertEquals("tbzsgfyccs", model.displayName());
        Assertions.assertEquals("wmdwzjeiachboo", model.description());
        Assertions.assertEquals("lnrosfqp", model.publisherDisplayName());
        Assertions.assertEquals("ehzzvypyqrim", model.publisherIdentifier());
        Assertions.assertEquals("npvswjdkirso", model.offer());
        Assertions.assertEquals("qxhcrmn", model.offerVersion());
        Assertions.assertEquals("jtckwhdso", model.sku());
        Assertions.assertEquals("iy", model.billingPartNumber());
        Assertions.assertEquals("jxsqwpgrjbz", model.vmExtensionType());
        Assertions.assertEquals("rcjxvsnbyxqabn", model.galleryItemIdentity());
        Assertions.assertEquals("pcyshu", model.iconUris().large());
        Assertions.assertEquals("afbljjgpbtoqcjmk", model.iconUris().wide());
        Assertions.assertEquals("a", model.iconUris().medium());
        Assertions.assertEquals("qidtqajzyu", model.iconUris().small());
        Assertions.assertEquals("kudjkrlkhb", model.iconUris().hero());
        Assertions.assertEquals("pgzgq", model.links().get(0).displayName());
        Assertions.assertEquals("zloc", model.links().get(0).uri());
        Assertions.assertEquals("aodxo", model.legalTerms());
        Assertions.assertEquals("bdxkqpxokaj", model.privacyPolicy());
        Assertions.assertEquals(4793683131243890643L, model.payloadLength());
        Assertions.assertEquals("mexgstxgcp", model.productKind());
        Assertions.assertEquals("maajrmvdjwzrlo", model.productProperties().version());
        Assertions.assertEquals(true, model.compatibility().isCompatible());
        Assertions.assertEquals("hijco", model.compatibility().message());
        Assertions.assertEquals("ctbzaq", model.compatibility().description());
        Assertions
            .assertEquals(CompatibilityIssue.DEVELOPMENT_BILLING_MODEL_REQUIRED, model.compatibility().issues().get(0));
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ProductInner model =
            new ProductInner()
                .withEtag("kbfkg")
                .withDisplayName("tbzsgfyccs")
                .withDescription("wmdwzjeiachboo")
                .withPublisherDisplayName("lnrosfqp")
                .withPublisherIdentifier("ehzzvypyqrim")
                .withOffer("npvswjdkirso")
                .withOfferVersion("qxhcrmn")
                .withSku("jtckwhdso")
                .withBillingPartNumber("iy")
                .withVmExtensionType("jxsqwpgrjbz")
                .withGalleryItemIdentity("rcjxvsnbyxqabn")
                .withIconUris(
                    new IconUris()
                        .withLarge("pcyshu")
                        .withWide("afbljjgpbtoqcjmk")
                        .withMedium("a")
                        .withSmall("qidtqajzyu")
                        .withHero("kudjkrlkhb"))
                .withLinks(
                    Arrays
                        .asList(
                            new ProductLink().withDisplayName("pgzgq").withUri("zloc"),
                            new ProductLink().withDisplayName("c").withUri("ierhhbcsglummaj")))
                .withLegalTerms("aodxo")
                .withPrivacyPolicy("bdxkqpxokaj")
                .withPayloadLength(4793683131243890643L)
                .withProductKind("mexgstxgcp")
                .withProductProperties(new ProductProperties().withVersion("maajrmvdjwzrlo"))
                .withCompatibility(
                    new Compatibility()
                        .withIsCompatible(true)
                        .withMessage("hijco")
                        .withDescription("ctbzaq")
                        .withIssues(
                            Arrays
                                .asList(
                                    CompatibilityIssue.DEVELOPMENT_BILLING_MODEL_REQUIRED,
                                    CompatibilityIssue.HIGHER_DEVICE_VERSION_REQUIRED)));
        model = BinaryData.fromObject(model).toObject(ProductInner.class);
        Assertions.assertEquals("kbfkg", model.etag());
        Assertions.assertEquals("tbzsgfyccs", model.displayName());
        Assertions.assertEquals("wmdwzjeiachboo", model.description());
        Assertions.assertEquals("lnrosfqp", model.publisherDisplayName());
        Assertions.assertEquals("ehzzvypyqrim", model.publisherIdentifier());
        Assertions.assertEquals("npvswjdkirso", model.offer());
        Assertions.assertEquals("qxhcrmn", model.offerVersion());
        Assertions.assertEquals("jtckwhdso", model.sku());
        Assertions.assertEquals("iy", model.billingPartNumber());
        Assertions.assertEquals("jxsqwpgrjbz", model.vmExtensionType());
        Assertions.assertEquals("rcjxvsnbyxqabn", model.galleryItemIdentity());
        Assertions.assertEquals("pcyshu", model.iconUris().large());
        Assertions.assertEquals("afbljjgpbtoqcjmk", model.iconUris().wide());
        Assertions.assertEquals("a", model.iconUris().medium());
        Assertions.assertEquals("qidtqajzyu", model.iconUris().small());
        Assertions.assertEquals("kudjkrlkhb", model.iconUris().hero());
        Assertions.assertEquals("pgzgq", model.links().get(0).displayName());
        Assertions.assertEquals("zloc", model.links().get(0).uri());
        Assertions.assertEquals("aodxo", model.legalTerms());
        Assertions.assertEquals("bdxkqpxokaj", model.privacyPolicy());
        Assertions.assertEquals(4793683131243890643L, model.payloadLength());
        Assertions.assertEquals("mexgstxgcp", model.productKind());
        Assertions.assertEquals("maajrmvdjwzrlo", model.productProperties().version());
        Assertions.assertEquals(true, model.compatibility().isCompatible());
        Assertions.assertEquals("hijco", model.compatibility().message());
        Assertions.assertEquals("ctbzaq", model.compatibility().description());
        Assertions
            .assertEquals(CompatibilityIssue.DEVELOPMENT_BILLING_MODEL_REQUIRED, model.compatibility().issues().get(0));
    }
}
