// 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.models.DefenderForContainersAwsOffering;
import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingCloudWatchToKinesis;
import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessment;
import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask;
import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKinesisToS3;
import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesScubaReader;
import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesService;
import org.junit.jupiter.api.Assertions;

public final class DefenderForContainersAwsOfferingTests {
    @org.junit.jupiter.api.Test
    public void testDeserialize() throws Exception {
        DefenderForContainersAwsOffering model =
            BinaryData
                .fromString(
                    "{\"offeringType\":\"DefenderForContainersAws\",\"kubernetesService\":{\"cloudRoleArn\":\"tkbtnqlrngl\"},\"kubernetesScubaReader\":{\"cloudRoleArn\":\"iipsnawwlqkz\"},\"cloudWatchToKinesis\":{\"cloudRoleArn\":\"hllxricctkw\"},\"kinesisToS3\":{\"cloudRoleArn\":\"qoajxeiyglesrwva\"},\"containerVulnerabilityAssessment\":{\"cloudRoleArn\":\"dctrceqnkbrupobe\"},\"containerVulnerabilityAssessmentTask\":{\"cloudRoleArn\":\"lj\"},\"enableContainerVulnerabilityAssessment\":true,\"autoProvisioning\":true,\"kubeAuditRetentionTime\":2313519110456203073,\"scubaExternalId\":\"pbibn\",\"description\":\"phepifexleqirc\"}")
                .toObject(DefenderForContainersAwsOffering.class);
        Assertions.assertEquals("tkbtnqlrngl", model.kubernetesService().cloudRoleArn());
        Assertions.assertEquals("iipsnawwlqkz", model.kubernetesScubaReader().cloudRoleArn());
        Assertions.assertEquals("hllxricctkw", model.cloudWatchToKinesis().cloudRoleArn());
        Assertions.assertEquals("qoajxeiyglesrwva", model.kinesisToS3().cloudRoleArn());
        Assertions.assertEquals("dctrceqnkbrupobe", model.containerVulnerabilityAssessment().cloudRoleArn());
        Assertions.assertEquals("lj", model.containerVulnerabilityAssessmentTask().cloudRoleArn());
        Assertions.assertEquals(true, model.enableContainerVulnerabilityAssessment());
        Assertions.assertEquals(true, model.autoProvisioning());
        Assertions.assertEquals(2313519110456203073L, model.kubeAuditRetentionTime());
        Assertions.assertEquals("pbibn", model.scubaExternalId());
    }

    @org.junit.jupiter.api.Test
    public void testSerialize() throws Exception {
        DefenderForContainersAwsOffering model =
            new DefenderForContainersAwsOffering()
                .withKubernetesService(
                    new DefenderForContainersAwsOfferingKubernetesService().withCloudRoleArn("tkbtnqlrngl"))
                .withKubernetesScubaReader(
                    new DefenderForContainersAwsOfferingKubernetesScubaReader().withCloudRoleArn("iipsnawwlqkz"))
                .withCloudWatchToKinesis(
                    new DefenderForContainersAwsOfferingCloudWatchToKinesis().withCloudRoleArn("hllxricctkw"))
                .withKinesisToS3(new DefenderForContainersAwsOfferingKinesisToS3().withCloudRoleArn("qoajxeiyglesrwva"))
                .withContainerVulnerabilityAssessment(
                    new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment()
                        .withCloudRoleArn("dctrceqnkbrupobe"))
                .withContainerVulnerabilityAssessmentTask(
                    new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask().withCloudRoleArn("lj"))
                .withEnableContainerVulnerabilityAssessment(true)
                .withAutoProvisioning(true)
                .withKubeAuditRetentionTime(2313519110456203073L)
                .withScubaExternalId("pbibn");
        model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOffering.class);
        Assertions.assertEquals("tkbtnqlrngl", model.kubernetesService().cloudRoleArn());
        Assertions.assertEquals("iipsnawwlqkz", model.kubernetesScubaReader().cloudRoleArn());
        Assertions.assertEquals("hllxricctkw", model.cloudWatchToKinesis().cloudRoleArn());
        Assertions.assertEquals("qoajxeiyglesrwva", model.kinesisToS3().cloudRoleArn());
        Assertions.assertEquals("dctrceqnkbrupobe", model.containerVulnerabilityAssessment().cloudRoleArn());
        Assertions.assertEquals("lj", model.containerVulnerabilityAssessmentTask().cloudRoleArn());
        Assertions.assertEquals(true, model.enableContainerVulnerabilityAssessment());
        Assertions.assertEquals(true, model.autoProvisioning());
        Assertions.assertEquals(2313519110456203073L, model.kubeAuditRetentionTime());
        Assertions.assertEquals("pbibn", model.scubaExternalId());
    }
}
