All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.security.models.DefenderCspmGcpOffering Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Security Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3.

There is a newer version: 1.0.0
Show newest version
// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The CSPM P1 for GCP offering.
 */
@Fluent
public final class DefenderCspmGcpOffering extends CloudOffering {
    /*
     * The type of the security offering.
     */
    private OfferingType offeringType = OfferingType.DEFENDER_CSPM_GCP;

    /*
     * GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection configurations
     */
    private DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery;

    /*
     * The Microsoft Defender for CSPM VM scanning configuration
     */
    private DefenderCspmGcpOfferingVmScanners vmScanners;

    /*
     * The Microsoft Defender Data Sensitivity discovery configuration
     */
    private DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery;

    /*
     * The Microsoft Defender Container image assessment configuration
     */
    private DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment;

    /*
     * The Microsoft Defender Container agentless discovery configuration
     */
    private DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S;

    /**
     * Creates an instance of DefenderCspmGcpOffering class.
     */
    public DefenderCspmGcpOffering() {
    }

    /**
     * Get the offeringType property: The type of the security offering.
     * 
     * @return the offeringType value.
     */
    @Override
    public OfferingType offeringType() {
        return this.offeringType;
    }

    /**
     * Get the ciemDiscovery property: GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection
     * configurations.
     * 
     * @return the ciemDiscovery value.
     */
    public DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery() {
        return this.ciemDiscovery;
    }

    /**
     * Set the ciemDiscovery property: GCP Defenders CSPM Permissions Management OIDC (Open ID connect) connection
     * configurations.
     * 
     * @param ciemDiscovery the ciemDiscovery value to set.
     * @return the DefenderCspmGcpOffering object itself.
     */
    public DefenderCspmGcpOffering withCiemDiscovery(DefenderCspmGcpOfferingCiemDiscovery ciemDiscovery) {
        this.ciemDiscovery = ciemDiscovery;
        return this;
    }

    /**
     * Get the vmScanners property: The Microsoft Defender for CSPM VM scanning configuration.
     * 
     * @return the vmScanners value.
     */
    public DefenderCspmGcpOfferingVmScanners vmScanners() {
        return this.vmScanners;
    }

    /**
     * Set the vmScanners property: The Microsoft Defender for CSPM VM scanning configuration.
     * 
     * @param vmScanners the vmScanners value to set.
     * @return the DefenderCspmGcpOffering object itself.
     */
    public DefenderCspmGcpOffering withVmScanners(DefenderCspmGcpOfferingVmScanners vmScanners) {
        this.vmScanners = vmScanners;
        return this;
    }

    /**
     * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration.
     * 
     * @return the dataSensitivityDiscovery value.
     */
    public DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery() {
        return this.dataSensitivityDiscovery;
    }

    /**
     * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration.
     * 
     * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set.
     * @return the DefenderCspmGcpOffering object itself.
     */
    public DefenderCspmGcpOffering
        withDataSensitivityDiscovery(DefenderCspmGcpOfferingDataSensitivityDiscovery dataSensitivityDiscovery) {
        this.dataSensitivityDiscovery = dataSensitivityDiscovery;
        return this;
    }

    /**
     * Get the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration.
     * 
     * @return the mdcContainersImageAssessment value.
     */
    public DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment() {
        return this.mdcContainersImageAssessment;
    }

    /**
     * Set the mdcContainersImageAssessment property: The Microsoft Defender Container image assessment configuration.
     * 
     * @param mdcContainersImageAssessment the mdcContainersImageAssessment value to set.
     * @return the DefenderCspmGcpOffering object itself.
     */
    public DefenderCspmGcpOffering withMdcContainersImageAssessment(
        DefenderCspmGcpOfferingMdcContainersImageAssessment mdcContainersImageAssessment) {
        this.mdcContainersImageAssessment = mdcContainersImageAssessment;
        return this;
    }

    /**
     * Get the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery
     * configuration.
     * 
     * @return the mdcContainersAgentlessDiscoveryK8S value.
     */
    public DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S() {
        return this.mdcContainersAgentlessDiscoveryK8S;
    }

    /**
     * Set the mdcContainersAgentlessDiscoveryK8S property: The Microsoft Defender Container agentless discovery
     * configuration.
     * 
     * @param mdcContainersAgentlessDiscoveryK8S the mdcContainersAgentlessDiscoveryK8S value to set.
     * @return the DefenderCspmGcpOffering object itself.
     */
    public DefenderCspmGcpOffering withMdcContainersAgentlessDiscoveryK8S(
        DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S mdcContainersAgentlessDiscoveryK8S) {
        this.mdcContainersAgentlessDiscoveryK8S = mdcContainersAgentlessDiscoveryK8S;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        if (ciemDiscovery() != null) {
            ciemDiscovery().validate();
        }
        if (vmScanners() != null) {
            vmScanners().validate();
        }
        if (dataSensitivityDiscovery() != null) {
            dataSensitivityDiscovery().validate();
        }
        if (mdcContainersImageAssessment() != null) {
            mdcContainersImageAssessment().validate();
        }
        if (mdcContainersAgentlessDiscoveryK8S() != null) {
            mdcContainersAgentlessDiscoveryK8S().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("offeringType", this.offeringType == null ? null : this.offeringType.toString());
        jsonWriter.writeJsonField("ciemDiscovery", this.ciemDiscovery);
        jsonWriter.writeJsonField("vmScanners", this.vmScanners);
        jsonWriter.writeJsonField("dataSensitivityDiscovery", this.dataSensitivityDiscovery);
        jsonWriter.writeJsonField("mdcContainersImageAssessment", this.mdcContainersImageAssessment);
        jsonWriter.writeJsonField("mdcContainersAgentlessDiscoveryK8s", this.mdcContainersAgentlessDiscoveryK8S);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DefenderCspmGcpOffering from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DefenderCspmGcpOffering if the JsonReader was pointing to an instance of it, or null if it
     * was pointing to JSON null.
     * @throws IOException If an error occurs while reading the DefenderCspmGcpOffering.
     */
    public static DefenderCspmGcpOffering fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DefenderCspmGcpOffering deserializedDefenderCspmGcpOffering = new DefenderCspmGcpOffering();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("description".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.withDescription(reader.getString());
                } else if ("offeringType".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.offeringType = OfferingType.fromString(reader.getString());
                } else if ("ciemDiscovery".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.ciemDiscovery
                        = DefenderCspmGcpOfferingCiemDiscovery.fromJson(reader);
                } else if ("vmScanners".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.vmScanners = DefenderCspmGcpOfferingVmScanners.fromJson(reader);
                } else if ("dataSensitivityDiscovery".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.dataSensitivityDiscovery
                        = DefenderCspmGcpOfferingDataSensitivityDiscovery.fromJson(reader);
                } else if ("mdcContainersImageAssessment".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.mdcContainersImageAssessment
                        = DefenderCspmGcpOfferingMdcContainersImageAssessment.fromJson(reader);
                } else if ("mdcContainersAgentlessDiscoveryK8s".equals(fieldName)) {
                    deserializedDefenderCspmGcpOffering.mdcContainersAgentlessDiscoveryK8S
                        = DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDefenderCspmGcpOffering;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy