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

package com.azure.resourcemanager.security.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner;
import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties;
import com.azure.resourcemanager.security.models.AutoProvision;
import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties;
import org.junit.jupiter.api.Assertions;

public final class ConnectorSettingInnerTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        ConnectorSettingInner model =
            BinaryData
                .fromString(
                    "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"Off\",\"resourceGroupName\":\"enl\",\"region\":\"htkln\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::SecurityAudit\"]}},\"id\":\"ev\",\"name\":\"bo\",\"type\":\"lcqxypokk\"}")
                .toObject(ConnectorSettingInner.class);
        Assertions.assertEquals(AutoProvision.OFF, model.hybridComputeSettings().autoProvision());
        Assertions.assertEquals("enl", model.hybridComputeSettings().resourceGroupName());
        Assertions.assertEquals("htkln", model.hybridComputeSettings().region());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        ConnectorSettingInner model =
            new ConnectorSettingInner()
                .withHybridComputeSettings(
                    new HybridComputeSettingsProperties()
                        .withAutoProvision(AutoProvision.OFF)
                        .withResourceGroupName("enl")
                        .withRegion("htkln"))
                .withAuthenticationDetails(new AuthenticationDetailsProperties());
        model = BinaryData.fromObject(model).toObject(ConnectorSettingInner.class);
        Assertions.assertEquals(AutoProvision.OFF, model.hybridComputeSettings().autoProvision());
        Assertions.assertEquals("enl", model.hybridComputeSettings().resourceGroupName());
        Assertions.assertEquals("htkln", model.hybridComputeSettings().region());
    }
}
