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

package com.azure.resourcemanager.reservations.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.reservations.models.ReservationSummary;
import com.azure.resourcemanager.reservations.models.ReservationsListResult;

public final class ReservationsListResultTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ReservationsListResult model =
            BinaryData
                .fromString(
                    "{\"value\":[{\"location\":\"sdyhtozfikdowwq\",\"etag\":180318621,\"sku\":{\"name\":\"xclvit\"},\"properties\":{\"reservedResourceType\":\"PostgreSql\",\"instanceFlexibility\":\"Off\",\"displayName\":\"sg\",\"appliedScopes\":[],\"appliedScopeType\":\"Shared\",\"archived\":true,\"capabilities\":\"wdsjnkalju\",\"quantity\":1151274297,\"provisioningState\":\"Created\",\"effectiveDateTime\":\"2020-12-21T01:44:52Z\",\"benefitStartTime\":\"2021-01-31T14:58:09Z\",\"lastUpdatedDateTime\":\"2021-02-03T13:27:34Z\",\"expiryDateTime\":\"2021-08-03T21:42:41Z\",\"reviewDateTime\":\"2021-09-01T23:23:38Z\",\"skuDescription\":\"fvhqc\",\"billingPlan\":\"Upfront\",\"displayProvisioningState\":\"pnppfuf\",\"provisioningSubState\":\"wdmhdlxyjrxs\",\"purchaseDateTime\":\"2021-06-03T10:11:42Z\",\"billingScopeId\":\"wqapnedgfbcvk\",\"renew\":false,\"renewSource\":\"pkeqdcvdrhvoo\",\"renewDestination\":\"otbobzdopcj\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"ld\",\"userFriendlyRenewState\":\"gx\"},\"kind\":\"Microsoft.Compute\",\"id\":\"pmutwuo\",\"name\":\"grpkhjwniyqs\",\"type\":\"uicpd\"},{\"location\":\"kzzlvmbmpaxmodf\",\"etag\":843823748,\"sku\":{\"name\":\"wsbpfvm\"},\"properties\":{\"reservedResourceType\":\"RedHatOsa\",\"instanceFlexibility\":\"Off\",\"displayName\":\"yftaakcpw\",\"appliedScopes\":[],\"appliedScopeType\":\"Shared\",\"archived\":true,\"capabilities\":\"nubexk\",\"quantity\":1583015875,\"provisioningState\":\"Created\",\"effectiveDateTime\":\"2021-10-14T06:39:18Z\",\"benefitStartTime\":\"2021-08-27T04:53:59Z\",\"lastUpdatedDateTime\":\"2021-04-01T23:21:50Z\",\"expiryDateTime\":\"2021-06-21T21:58:07Z\",\"reviewDateTime\":\"2021-02-28T11:46:10Z\",\"skuDescription\":\"mg\",\"billingPlan\":\"Monthly\",\"displayProvisioningState\":\"hojvpajqgxysmocm\",\"provisioningSubState\":\"fqvm\",\"purchaseDateTime\":\"2020-12-29T20:52:17Z\",\"billingScopeId\":\"elxprglyatddck\",\"renew\":true,\"renewSource\":\"ejrjxgciqibrho\",\"renewDestination\":\"sdqrhzoymibmrq\",\"term\":\"P5Y\",\"userFriendlyAppliedScopeType\":\"wfluszdt\",\"userFriendlyRenewState\":\"rkwofyyvoqa\"},\"kind\":\"Microsoft.Compute\",\"id\":\"pbtg\",\"name\":\"wbwo\",\"type\":\"nwashrtd\"}],\"nextLink\":\"cnqxwbpokulpi\",\"summary\":{\"succeededCount\":41.262604,\"failedCount\":32.788704,\"expiringCount\":56.51915,\"expiredCount\":4.018074,\"pendingCount\":24.116928,\"cancelledCount\":15.7264595,\"processingCount\":62.802547,\"warningCount\":28.490322,\"noBenefitCount\":59.630554}}")
                .toObject(ReservationsListResult.class);
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ReservationsListResult model = new ReservationsListResult().withSummary(new ReservationSummary());
        model = BinaryData.fromObject(model).toObject(ReservationsListResult.class);
    }
}
