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

com.azure.resourcemanager.security.models.MalwareScanningProperties 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.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Properties of Malware Scanning.
 */
@Fluent
public final class MalwareScanningProperties implements JsonSerializable {
    /*
     * Properties of On Upload malware scanning.
     */
    private OnUploadProperties onUpload;

    /*
     * Optional. Resource id of an Event Grid Topic to send scan results to.
     */
    private String scanResultsEventGridTopicResourceId;

    /*
     * Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation.
     */
    private OperationStatus operationStatus;

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

    /**
     * Get the onUpload property: Properties of On Upload malware scanning.
     * 
     * @return the onUpload value.
     */
    public OnUploadProperties onUpload() {
        return this.onUpload;
    }

    /**
     * Set the onUpload property: Properties of On Upload malware scanning.
     * 
     * @param onUpload the onUpload value to set.
     * @return the MalwareScanningProperties object itself.
     */
    public MalwareScanningProperties withOnUpload(OnUploadProperties onUpload) {
        this.onUpload = onUpload;
        return this;
    }

    /**
     * Get the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan
     * results to.
     * 
     * @return the scanResultsEventGridTopicResourceId value.
     */
    public String scanResultsEventGridTopicResourceId() {
        return this.scanResultsEventGridTopicResourceId;
    }

    /**
     * Set the scanResultsEventGridTopicResourceId property: Optional. Resource id of an Event Grid Topic to send scan
     * results to.
     * 
     * @param scanResultsEventGridTopicResourceId the scanResultsEventGridTopicResourceId value to set.
     * @return the MalwareScanningProperties object itself.
     */
    public MalwareScanningProperties
        withScanResultsEventGridTopicResourceId(String scanResultsEventGridTopicResourceId) {
        this.scanResultsEventGridTopicResourceId = scanResultsEventGridTopicResourceId;
        return this;
    }

    /**
     * Get the operationStatus property: Upon failure or partial success. Additional data describing Malware Scanning
     * enable/disable operation.
     * 
     * @return the operationStatus value.
     */
    public OperationStatus operationStatus() {
        return this.operationStatus;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (onUpload() != null) {
            onUpload().validate();
        }
        if (operationStatus() != null) {
            operationStatus().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("onUpload", this.onUpload);
        jsonWriter.writeStringField("scanResultsEventGridTopicResourceId", this.scanResultsEventGridTopicResourceId);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of MalwareScanningProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of MalwareScanningProperties 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 MalwareScanningProperties.
     */
    public static MalwareScanningProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            MalwareScanningProperties deserializedMalwareScanningProperties = new MalwareScanningProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("onUpload".equals(fieldName)) {
                    deserializedMalwareScanningProperties.onUpload = OnUploadProperties.fromJson(reader);
                } else if ("scanResultsEventGridTopicResourceId".equals(fieldName)) {
                    deserializedMalwareScanningProperties.scanResultsEventGridTopicResourceId = reader.getString();
                } else if ("operationStatus".equals(fieldName)) {
                    deserializedMalwareScanningProperties.operationStatus = OperationStatus.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMalwareScanningProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy