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

com.azure.resourcemanager.security.models.ExternalSecuritySolutionProperties 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;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * The solution properties (correspond to the solution kind).
 */
@Fluent
public class ExternalSecuritySolutionProperties implements JsonSerializable {
    /*
     * The deviceVendor property.
     */
    private String deviceVendor;

    /*
     * The deviceType property.
     */
    private String deviceType;

    /*
     * Represents an OMS workspace to which the solution is connected
     */
    private ConnectedWorkspace workspace;

    /*
     * The solution properties (correspond to the solution kind)
     */
    private Map additionalProperties;

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

    /**
     * Get the deviceVendor property: The deviceVendor property.
     * 
     * @return the deviceVendor value.
     */
    public String deviceVendor() {
        return this.deviceVendor;
    }

    /**
     * Set the deviceVendor property: The deviceVendor property.
     * 
     * @param deviceVendor the deviceVendor value to set.
     * @return the ExternalSecuritySolutionProperties object itself.
     */
    public ExternalSecuritySolutionProperties withDeviceVendor(String deviceVendor) {
        this.deviceVendor = deviceVendor;
        return this;
    }

    /**
     * Get the deviceType property: The deviceType property.
     * 
     * @return the deviceType value.
     */
    public String deviceType() {
        return this.deviceType;
    }

    /**
     * Set the deviceType property: The deviceType property.
     * 
     * @param deviceType the deviceType value to set.
     * @return the ExternalSecuritySolutionProperties object itself.
     */
    public ExternalSecuritySolutionProperties withDeviceType(String deviceType) {
        this.deviceType = deviceType;
        return this;
    }

    /**
     * Get the workspace property: Represents an OMS workspace to which the solution is connected.
     * 
     * @return the workspace value.
     */
    public ConnectedWorkspace workspace() {
        return this.workspace;
    }

    /**
     * Set the workspace property: Represents an OMS workspace to which the solution is connected.
     * 
     * @param workspace the workspace value to set.
     * @return the ExternalSecuritySolutionProperties object itself.
     */
    public ExternalSecuritySolutionProperties withWorkspace(ConnectedWorkspace workspace) {
        this.workspace = workspace;
        return this;
    }

    /**
     * Get the additionalProperties property: The solution properties (correspond to the solution kind).
     * 
     * @return the additionalProperties value.
     */
    public Map additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: The solution properties (correspond to the solution kind).
     * 
     * @param additionalProperties the additionalProperties value to set.
     * @return the ExternalSecuritySolutionProperties object itself.
     */
    public ExternalSecuritySolutionProperties withAdditionalProperties(Map additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("deviceVendor", this.deviceVendor);
        jsonWriter.writeStringField("deviceType", this.deviceType);
        jsonWriter.writeJsonField("workspace", this.workspace);
        if (additionalProperties != null) {
            for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

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

                if ("deviceVendor".equals(fieldName)) {
                    deserializedExternalSecuritySolutionProperties.deviceVendor = reader.getString();
                } else if ("deviceType".equals(fieldName)) {
                    deserializedExternalSecuritySolutionProperties.deviceType = reader.getString();
                } else if ("workspace".equals(fieldName)) {
                    deserializedExternalSecuritySolutionProperties.workspace = ConnectedWorkspace.fromJson(reader);
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

                    additionalProperties.put(fieldName, reader.readUntyped());
                }
            }
            deserializedExternalSecuritySolutionProperties.additionalProperties = additionalProperties;

            return deserializedExternalSecuritySolutionProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy