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

package com.azure.resourcemanager.mediaservices.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.mediaservices.models.AssetContainerPermission;
import com.azure.resourcemanager.mediaservices.models.ListContainerSasInput;
import java.time.OffsetDateTime;
import org.junit.jupiter.api.Assertions;

public final class ListContainerSasInputTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ListContainerSasInput model =
            BinaryData
                .fromString("{\"permissions\":\"Read\",\"expiryTime\":\"2021-06-03T10:31:17Z\"}")
                .toObject(ListContainerSasInput.class);
        Assertions.assertEquals(AssetContainerPermission.READ, model.permissions());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T10:31:17Z"), model.expiryTime());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ListContainerSasInput model =
            new ListContainerSasInput()
                .withPermissions(AssetContainerPermission.READ)
                .withExpiryTime(OffsetDateTime.parse("2021-06-03T10:31:17Z"));
        model = BinaryData.fromObject(model).toObject(ListContainerSasInput.class);
        Assertions.assertEquals(AssetContainerPermission.READ, model.permissions());
        Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T10:31:17Z"), model.expiryTime());
    }
}
