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

package com.azure.resourcemanager.orbital.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.orbital.models.AutoTrackingConfiguration;
import com.azure.resourcemanager.orbital.models.ContactProfileLink;
import com.azure.resourcemanager.orbital.models.ContactProfileThirdPartyConfiguration;
import com.azure.resourcemanager.orbital.models.ContactProfilesProperties;
import com.azure.resourcemanager.orbital.models.ContactProfilesPropertiesNetworkConfiguration;
import com.azure.resourcemanager.orbital.models.ContactProfilesPropertiesProvisioningState;
import com.azure.resourcemanager.orbital.models.Direction;
import com.azure.resourcemanager.orbital.models.Polarization;
import java.util.Arrays;
import org.junit.jupiter.api.Assertions;

public final class ContactProfilesPropertiesTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ContactProfilesProperties model =
            BinaryData
                .fromString(
                    "{\"provisioningState\":\"canceled\",\"minimumViableContactDuration\":\"pnqbqqwxrjfe\",\"minimumElevationDegrees\":51.42286,\"autoTrackingConfiguration\":\"xBand\",\"eventHubUri\":\"ubisnjampmng\",\"networkConfiguration\":{\"subnetId\":\"zscxaqwo\"},\"thirdPartyConfigurations\":[{\"providerName\":\"cbonqvpk\",\"missionConfiguration\":\"lrxnjeaseiphe\"},{\"providerName\":\"f\",\"missionConfiguration\":\"okeyyienj\"},{\"providerName\":\"dlwtgrhpdj\",\"missionConfiguration\":\"jumasx\"}],\"links\":[{\"name\":\"jpqyegu\",\"polarization\":\"linearHorizontal\",\"direction\":\"Uplink\",\"gainOverTemperature\":62.193584,\"eirpdBW\":27.095669,\"channels\":[]}]}")
                .toObject(ContactProfilesProperties.class);
        Assertions.assertEquals(ContactProfilesPropertiesProvisioningState.CANCELED, model.provisioningState());
        Assertions.assertEquals("pnqbqqwxrjfe", model.minimumViableContactDuration());
        Assertions.assertEquals(51.42286F, model.minimumElevationDegrees());
        Assertions.assertEquals(AutoTrackingConfiguration.X_BAND, model.autoTrackingConfiguration());
        Assertions.assertEquals("ubisnjampmng", model.eventHubUri());
        Assertions.assertEquals("zscxaqwo", model.networkConfiguration().subnetId());
        Assertions.assertEquals("cbonqvpk", model.thirdPartyConfigurations().get(0).providerName());
        Assertions.assertEquals("lrxnjeaseiphe", model.thirdPartyConfigurations().get(0).missionConfiguration());
        Assertions.assertEquals("jpqyegu", model.links().get(0).name());
        Assertions.assertEquals(Polarization.LINEAR_HORIZONTAL, model.links().get(0).polarization());
        Assertions.assertEquals(Direction.UPLINK, model.links().get(0).direction());
        Assertions.assertEquals(62.193584F, model.links().get(0).gainOverTemperature());
        Assertions.assertEquals(27.095669F, model.links().get(0).eirpdBW());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ContactProfilesProperties model =
            new ContactProfilesProperties()
                .withProvisioningState(ContactProfilesPropertiesProvisioningState.CANCELED)
                .withMinimumViableContactDuration("pnqbqqwxrjfe")
                .withMinimumElevationDegrees(51.42286F)
                .withAutoTrackingConfiguration(AutoTrackingConfiguration.X_BAND)
                .withEventHubUri("ubisnjampmng")
                .withNetworkConfiguration(new ContactProfilesPropertiesNetworkConfiguration().withSubnetId("zscxaqwo"))
                .withThirdPartyConfigurations(
                    Arrays
                        .asList(
                            new ContactProfileThirdPartyConfiguration()
                                .withProviderName("cbonqvpk")
                                .withMissionConfiguration("lrxnjeaseiphe"),
                            new ContactProfileThirdPartyConfiguration()
                                .withProviderName("f")
                                .withMissionConfiguration("okeyyienj"),
                            new ContactProfileThirdPartyConfiguration()
                                .withProviderName("dlwtgrhpdj")
                                .withMissionConfiguration("jumasx")))
                .withLinks(
                    Arrays
                        .asList(
                            new ContactProfileLink()
                                .withName("jpqyegu")
                                .withPolarization(Polarization.LINEAR_HORIZONTAL)
                                .withDirection(Direction.UPLINK)
                                .withGainOverTemperature(62.193584F)
                                .withEirpdBW(27.095669F)
                                .withChannels(Arrays.asList())));
        model = BinaryData.fromObject(model).toObject(ContactProfilesProperties.class);
        Assertions.assertEquals(ContactProfilesPropertiesProvisioningState.CANCELED, model.provisioningState());
        Assertions.assertEquals("pnqbqqwxrjfe", model.minimumViableContactDuration());
        Assertions.assertEquals(51.42286F, model.minimumElevationDegrees());
        Assertions.assertEquals(AutoTrackingConfiguration.X_BAND, model.autoTrackingConfiguration());
        Assertions.assertEquals("ubisnjampmng", model.eventHubUri());
        Assertions.assertEquals("zscxaqwo", model.networkConfiguration().subnetId());
        Assertions.assertEquals("cbonqvpk", model.thirdPartyConfigurations().get(0).providerName());
        Assertions.assertEquals("lrxnjeaseiphe", model.thirdPartyConfigurations().get(0).missionConfiguration());
        Assertions.assertEquals("jpqyegu", model.links().get(0).name());
        Assertions.assertEquals(Polarization.LINEAR_HORIZONTAL, model.links().get(0).polarization());
        Assertions.assertEquals(Direction.UPLINK, model.links().get(0).direction());
        Assertions.assertEquals(62.193584F, model.links().get(0).gainOverTemperature());
        Assertions.assertEquals(27.095669F, model.links().get(0).eirpdBW());
    }
}
