// 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.ClipTime;
import com.azure.resourcemanager.mediaservices.models.JobInputClip;
import com.azure.resourcemanager.mediaservices.models.JobInputSequence;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class JobInputSequenceTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        JobInputSequence model =
            BinaryData
                .fromString(
                    "{\"@odata.type\":\"#Microsoft.Media.JobInputSequence\",\"inputs\":[{\"@odata.type\":\"#Microsoft.Media.JobInputClip\",\"files\":[\"cfxwmdbox\"],\"start\":{\"@odata.type\":\"ClipTime\"},\"end\":{\"@odata.type\":\"ClipTime\"},\"label\":\"ft\",\"inputDefinitions\":[]}]}")
                .toObject(JobInputSequence.class);
        Assertions.assertEquals("cfxwmdbox", model.inputs().get(0).files().get(0));
        Assertions.assertEquals("ft", model.inputs().get(0).label());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        JobInputSequence model =
            new JobInputSequence()
                .withInputs(
                    Arrays
                        .asList(
                            new JobInputClip()
                                .withFiles(Arrays.asList("cfxwmdbox"))
                                .withStart(new ClipTime())
                                .withEnd(new ClipTime())
                                .withLabel("ft")
                                .withInputDefinitions(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(JobInputSequence.class);
        Assertions.assertEquals("cfxwmdbox", model.inputs().get(0).files().get(0));
        Assertions.assertEquals("ft", model.inputs().get(0).label());
    }
}
