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

package com.azure.resourcemanager.workloads.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.workloads.models.DiskDetails;
import com.azure.resourcemanager.workloads.models.DiskSku;
import com.azure.resourcemanager.workloads.models.DiskSkuName;
import com.azure.resourcemanager.workloads.models.DiskVolumeConfiguration;
import com.azure.resourcemanager.workloads.models.SapDiskConfiguration;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class SapDiskConfigurationTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        SapDiskConfiguration model =
            BinaryData
                .fromString(
                    "{\"recommendedConfiguration\":{\"count\":7163568356518394603,\"sizeGB\":938163857275784583,\"sku\":{\"name\":\"PremiumV2_LRS\"}},\"supportedConfigurations\":[{\"sku\":{\"name\":\"UltraSSD_LRS\"},\"sizeGB\":6890840342903312019,\"minimumSupportedDiskCount\":6098942127121377639,\"maximumSupportedDiskCount\":7308436367150824433,\"iopsReadWrite\":1567678821277851010,\"mbpsReadWrite\":8302954057449968569,\"diskTier\":\"psqucmpoyf\"},{\"sku\":{\"name\":\"Premium_LRS\"},\"sizeGB\":4012686120572147528,\"minimumSupportedDiskCount\":6712516105005203400,\"maximumSupportedDiskCount\":7418697868899624743,\"iopsReadWrite\":4127897612120681391,\"mbpsReadWrite\":973731230377529737,\"diskTier\":\"eupewnwreitjz\"},{\"sku\":{\"name\":\"StandardSSD_LRS\"},\"sizeGB\":3686137269539867377,\"minimumSupportedDiskCount\":5128252551550278404,\"maximumSupportedDiskCount\":5048423606513513533,\"iopsReadWrite\":2535253353420695473,\"mbpsReadWrite\":8218653315746121665,\"diskTier\":\"dtmlxhekuksjt\"},{\"sku\":{\"name\":\"UltraSSD_LRS\"},\"sizeGB\":3684362268080006128,\"minimumSupportedDiskCount\":8311837114638823243,\"maximumSupportedDiskCount\":743663973345531285,\"iopsReadWrite\":7105688458172828807,\"mbpsReadWrite\":8444265625651342832,\"diskTier\":\"dxtayrlhm\"}]}")
                .toObject(SapDiskConfiguration.class);
        Assertions.assertEquals(7163568356518394603L, model.recommendedConfiguration().count());
        Assertions.assertEquals(938163857275784583L, model.recommendedConfiguration().sizeGB());
        Assertions.assertEquals(DiskSkuName.PREMIUM_V2_LRS, model.recommendedConfiguration().sku().name());
        Assertions.assertEquals(DiskSkuName.ULTRA_SSD_LRS, model.supportedConfigurations().get(0).sku().name());
        Assertions.assertEquals(6890840342903312019L, model.supportedConfigurations().get(0).sizeGB());
        Assertions
            .assertEquals(6098942127121377639L, model.supportedConfigurations().get(0).minimumSupportedDiskCount());
        Assertions
            .assertEquals(7308436367150824433L, model.supportedConfigurations().get(0).maximumSupportedDiskCount());
        Assertions.assertEquals(1567678821277851010L, model.supportedConfigurations().get(0).iopsReadWrite());
        Assertions.assertEquals(8302954057449968569L, model.supportedConfigurations().get(0).mbpsReadWrite());
        Assertions.assertEquals("psqucmpoyf", model.supportedConfigurations().get(0).diskTier());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        SapDiskConfiguration model =
            new SapDiskConfiguration()
                .withRecommendedConfiguration(
                    new DiskVolumeConfiguration()
                        .withCount(7163568356518394603L)
                        .withSizeGB(938163857275784583L)
                        .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_V2_LRS)))
                .withSupportedConfigurations(
                    Arrays
                        .asList(
                            new DiskDetails()
                                .withSku(new DiskSku().withName(DiskSkuName.ULTRA_SSD_LRS))
                                .withSizeGB(6890840342903312019L)
                                .withMinimumSupportedDiskCount(6098942127121377639L)
                                .withMaximumSupportedDiskCount(7308436367150824433L)
                                .withIopsReadWrite(1567678821277851010L)
                                .withMbpsReadWrite(8302954057449968569L)
                                .withDiskTier("psqucmpoyf"),
                            new DiskDetails()
                                .withSku(new DiskSku().withName(DiskSkuName.PREMIUM_LRS))
                                .withSizeGB(4012686120572147528L)
                                .withMinimumSupportedDiskCount(6712516105005203400L)
                                .withMaximumSupportedDiskCount(7418697868899624743L)
                                .withIopsReadWrite(4127897612120681391L)
                                .withMbpsReadWrite(973731230377529737L)
                                .withDiskTier("eupewnwreitjz"),
                            new DiskDetails()
                                .withSku(new DiskSku().withName(DiskSkuName.STANDARD_SSD_LRS))
                                .withSizeGB(3686137269539867377L)
                                .withMinimumSupportedDiskCount(5128252551550278404L)
                                .withMaximumSupportedDiskCount(5048423606513513533L)
                                .withIopsReadWrite(2535253353420695473L)
                                .withMbpsReadWrite(8218653315746121665L)
                                .withDiskTier("dtmlxhekuksjt"),
                            new DiskDetails()
                                .withSku(new DiskSku().withName(DiskSkuName.ULTRA_SSD_LRS))
                                .withSizeGB(3684362268080006128L)
                                .withMinimumSupportedDiskCount(8311837114638823243L)
                                .withMaximumSupportedDiskCount(743663973345531285L)
                                .withIopsReadWrite(7105688458172828807L)
                                .withMbpsReadWrite(8444265625651342832L)
                                .withDiskTier("dxtayrlhm")));
        model = BinaryData.fromObject(model).toObject(SapDiskConfiguration.class);
        Assertions.assertEquals(7163568356518394603L, model.recommendedConfiguration().count());
        Assertions.assertEquals(938163857275784583L, model.recommendedConfiguration().sizeGB());
        Assertions.assertEquals(DiskSkuName.PREMIUM_V2_LRS, model.recommendedConfiguration().sku().name());
        Assertions.assertEquals(DiskSkuName.ULTRA_SSD_LRS, model.supportedConfigurations().get(0).sku().name());
        Assertions.assertEquals(6890840342903312019L, model.supportedConfigurations().get(0).sizeGB());
        Assertions
            .assertEquals(6098942127121377639L, model.supportedConfigurations().get(0).minimumSupportedDiskCount());
        Assertions
            .assertEquals(7308436367150824433L, model.supportedConfigurations().get(0).maximumSupportedDiskCount());
        Assertions.assertEquals(1567678821277851010L, model.supportedConfigurations().get(0).iopsReadWrite());
        Assertions.assertEquals(8302954057449968569L, model.supportedConfigurations().get(0).mbpsReadWrite());
        Assertions.assertEquals("psqucmpoyf", model.supportedConfigurations().get(0).diskTier());
    }
}
