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

package com.azure.resourcemanager.support.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.support.models.PreferredContactMethod;
import com.azure.resourcemanager.support.models.SeverityLevel;
import com.azure.resourcemanager.support.models.Status;
import com.azure.resourcemanager.support.models.UpdateContactProfile;
import com.azure.resourcemanager.support.models.UpdateSupportTicket;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class UpdateSupportTicketTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        UpdateSupportTicket model =
            BinaryData
                .fromString(
                    "{\"severity\":\"minimal\",\"status\":\"open\",\"contactDetails\":{\"firstName\":\"b\",\"lastName\":\"hejjz\",\"preferredContactMethod\":\"phone\",\"primaryEmailAddress\":\"dgwdslfhot\",\"additionalEmailAddresses\":[\"ynpwlbj\",\"pgacftadehxnlty\",\"sop\"],\"phoneNumber\":\"suesnzw\",\"preferredTimeZone\":\"jbavorxzdm\",\"country\":\"ctbqvudwx\",\"preferredSupportLanguage\":\"dnvowg\"}}")
                .toObject(UpdateSupportTicket.class);
        Assertions.assertEquals(SeverityLevel.MINIMAL, model.severity());
        Assertions.assertEquals(Status.OPEN, model.status());
        Assertions.assertEquals("b", model.contactDetails().firstName());
        Assertions.assertEquals("hejjz", model.contactDetails().lastName());
        Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod());
        Assertions.assertEquals("dgwdslfhot", model.contactDetails().primaryEmailAddress());
        Assertions.assertEquals("ynpwlbj", model.contactDetails().additionalEmailAddresses().get(0));
        Assertions.assertEquals("suesnzw", model.contactDetails().phoneNumber());
        Assertions.assertEquals("jbavorxzdm", model.contactDetails().preferredTimeZone());
        Assertions.assertEquals("ctbqvudwx", model.contactDetails().country());
        Assertions.assertEquals("dnvowg", model.contactDetails().preferredSupportLanguage());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        UpdateSupportTicket model =
            new UpdateSupportTicket()
                .withSeverity(SeverityLevel.MINIMAL)
                .withStatus(Status.OPEN)
                .withContactDetails(
                    new UpdateContactProfile()
                        .withFirstName("b")
                        .withLastName("hejjz")
                        .withPreferredContactMethod(PreferredContactMethod.PHONE)
                        .withPrimaryEmailAddress("dgwdslfhot")
                        .withAdditionalEmailAddresses(Arrays.asList("ynpwlbj", "pgacftadehxnlty", "sop"))
                        .withPhoneNumber("suesnzw")
                        .withPreferredTimeZone("jbavorxzdm")
                        .withCountry("ctbqvudwx")
                        .withPreferredSupportLanguage("dnvowg"));
        model = BinaryData.fromObject(model).toObject(UpdateSupportTicket.class);
        Assertions.assertEquals(SeverityLevel.MINIMAL, model.severity());
        Assertions.assertEquals(Status.OPEN, model.status());
        Assertions.assertEquals("b", model.contactDetails().firstName());
        Assertions.assertEquals("hejjz", model.contactDetails().lastName());
        Assertions.assertEquals(PreferredContactMethod.PHONE, model.contactDetails().preferredContactMethod());
        Assertions.assertEquals("dgwdslfhot", model.contactDetails().primaryEmailAddress());
        Assertions.assertEquals("ynpwlbj", model.contactDetails().additionalEmailAddresses().get(0));
        Assertions.assertEquals("suesnzw", model.contactDetails().phoneNumber());
        Assertions.assertEquals("jbavorxzdm", model.contactDetails().preferredTimeZone());
        Assertions.assertEquals("ctbqvudwx", model.contactDetails().country());
        Assertions.assertEquals("dnvowg", model.contactDetails().preferredSupportLanguage());
    }
}
