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

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

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