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

com.azure.resourcemanager.securityinsights.models.CodelessUiConnectorConfigProperties Maven / Gradle / Ivy

Go to download

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

The 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.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
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.List;

/**
 * Config to describe the instructions blade.
 */
@Fluent
public final class CodelessUiConnectorConfigProperties
    implements JsonSerializable {
    /*
     * Connector blade title
     */
    private String title;

    /*
     * Connector publisher name
     */
    private String publisher;

    /*
     * Connector description
     */
    private String descriptionMarkdown;

    /*
     * An optional custom image to be used when displaying the connector within Azure Sentinel's connector's gallery
     */
    private String customImage;

    /*
     * Name of the table the connector will insert the data to
     */
    private String graphQueriesTableName;

    /*
     * The graph query to show the current data status
     */
    private List graphQueries;

    /*
     * The sample queries for the connector
     */
    private List sampleQueries;

    /*
     * Data types to check for last data received
     */
    private List dataTypes;

    /*
     * Define the way the connector check connectivity
     */
    private List connectivityCriteria;

    /*
     * Connector Availability Status
     */
    private Availability availability;

    /*
     * Permissions required for the connector
     */
    private Permissions permissions;

    /*
     * Instruction steps to enable the connector
     */
    private List instructionSteps;

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

    /**
     * Get the title property: Connector blade title.
     * 
     * @return the title value.
     */
    public String title() {
        return this.title;
    }

    /**
     * Set the title property: Connector blade title.
     * 
     * @param title the title value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withTitle(String title) {
        this.title = title;
        return this;
    }

    /**
     * Get the publisher property: Connector publisher name.
     * 
     * @return the publisher value.
     */
    public String publisher() {
        return this.publisher;
    }

    /**
     * Set the publisher property: Connector publisher name.
     * 
     * @param publisher the publisher value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withPublisher(String publisher) {
        this.publisher = publisher;
        return this;
    }

    /**
     * Get the descriptionMarkdown property: Connector description.
     * 
     * @return the descriptionMarkdown value.
     */
    public String descriptionMarkdown() {
        return this.descriptionMarkdown;
    }

    /**
     * Set the descriptionMarkdown property: Connector description.
     * 
     * @param descriptionMarkdown the descriptionMarkdown value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withDescriptionMarkdown(String descriptionMarkdown) {
        this.descriptionMarkdown = descriptionMarkdown;
        return this;
    }

    /**
     * Get the customImage property: An optional custom image to be used when displaying the connector within Azure
     * Sentinel's connector's gallery.
     * 
     * @return the customImage value.
     */
    public String customImage() {
        return this.customImage;
    }

    /**
     * Set the customImage property: An optional custom image to be used when displaying the connector within Azure
     * Sentinel's connector's gallery.
     * 
     * @param customImage the customImage value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withCustomImage(String customImage) {
        this.customImage = customImage;
        return this;
    }

    /**
     * Get the graphQueriesTableName property: Name of the table the connector will insert the data to.
     * 
     * @return the graphQueriesTableName value.
     */
    public String graphQueriesTableName() {
        return this.graphQueriesTableName;
    }

    /**
     * Set the graphQueriesTableName property: Name of the table the connector will insert the data to.
     * 
     * @param graphQueriesTableName the graphQueriesTableName value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withGraphQueriesTableName(String graphQueriesTableName) {
        this.graphQueriesTableName = graphQueriesTableName;
        return this;
    }

    /**
     * Get the graphQueries property: The graph query to show the current data status.
     * 
     * @return the graphQueries value.
     */
    public List graphQueries() {
        return this.graphQueries;
    }

    /**
     * Set the graphQueries property: The graph query to show the current data status.
     * 
     * @param graphQueries the graphQueries value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties
        withGraphQueries(List graphQueries) {
        this.graphQueries = graphQueries;
        return this;
    }

    /**
     * Get the sampleQueries property: The sample queries for the connector.
     * 
     * @return the sampleQueries value.
     */
    public List sampleQueries() {
        return this.sampleQueries;
    }

    /**
     * Set the sampleQueries property: The sample queries for the connector.
     * 
     * @param sampleQueries the sampleQueries value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties
        withSampleQueries(List sampleQueries) {
        this.sampleQueries = sampleQueries;
        return this;
    }

    /**
     * Get the dataTypes property: Data types to check for last data received.
     * 
     * @return the dataTypes value.
     */
    public List dataTypes() {
        return this.dataTypes;
    }

    /**
     * Set the dataTypes property: Data types to check for last data received.
     * 
     * @param dataTypes the dataTypes value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties
        withDataTypes(List dataTypes) {
        this.dataTypes = dataTypes;
        return this;
    }

    /**
     * Get the connectivityCriteria property: Define the way the connector check connectivity.
     * 
     * @return the connectivityCriteria value.
     */
    public List connectivityCriteria() {
        return this.connectivityCriteria;
    }

    /**
     * Set the connectivityCriteria property: Define the way the connector check connectivity.
     * 
     * @param connectivityCriteria the connectivityCriteria value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withConnectivityCriteria(
        List connectivityCriteria) {
        this.connectivityCriteria = connectivityCriteria;
        return this;
    }

    /**
     * Get the availability property: Connector Availability Status.
     * 
     * @return the availability value.
     */
    public Availability availability() {
        return this.availability;
    }

    /**
     * Set the availability property: Connector Availability Status.
     * 
     * @param availability the availability value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withAvailability(Availability availability) {
        this.availability = availability;
        return this;
    }

    /**
     * Get the permissions property: Permissions required for the connector.
     * 
     * @return the permissions value.
     */
    public Permissions permissions() {
        return this.permissions;
    }

    /**
     * Set the permissions property: Permissions required for the connector.
     * 
     * @param permissions the permissions value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withPermissions(Permissions permissions) {
        this.permissions = permissions;
        return this;
    }

    /**
     * Get the instructionSteps property: Instruction steps to enable the connector.
     * 
     * @return the instructionSteps value.
     */
    public List instructionSteps() {
        return this.instructionSteps;
    }

    /**
     * Set the instructionSteps property: Instruction steps to enable the connector.
     * 
     * @param instructionSteps the instructionSteps value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties
        withInstructionSteps(List instructionSteps) {
        this.instructionSteps = instructionSteps;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (title() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property title in model CodelessUiConnectorConfigProperties"));
        }
        if (publisher() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property publisher in model CodelessUiConnectorConfigProperties"));
        }
        if (descriptionMarkdown() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property descriptionMarkdown in model CodelessUiConnectorConfigProperties"));
        }
        if (graphQueriesTableName() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property graphQueriesTableName in model CodelessUiConnectorConfigProperties"));
        }
        if (graphQueries() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property graphQueries in model CodelessUiConnectorConfigProperties"));
        } else {
            graphQueries().forEach(e -> e.validate());
        }
        if (sampleQueries() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property sampleQueries in model CodelessUiConnectorConfigProperties"));
        } else {
            sampleQueries().forEach(e -> e.validate());
        }
        if (dataTypes() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property dataTypes in model CodelessUiConnectorConfigProperties"));
        } else {
            dataTypes().forEach(e -> e.validate());
        }
        if (connectivityCriteria() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property connectivityCriteria in model CodelessUiConnectorConfigProperties"));
        } else {
            connectivityCriteria().forEach(e -> e.validate());
        }
        if (availability() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property availability in model CodelessUiConnectorConfigProperties"));
        } else {
            availability().validate();
        }
        if (permissions() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property permissions in model CodelessUiConnectorConfigProperties"));
        } else {
            permissions().validate();
        }
        if (instructionSteps() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property instructionSteps in model CodelessUiConnectorConfigProperties"));
        } else {
            instructionSteps().forEach(e -> e.validate());
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(CodelessUiConnectorConfigProperties.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("title", this.title);
        jsonWriter.writeStringField("publisher", this.publisher);
        jsonWriter.writeStringField("descriptionMarkdown", this.descriptionMarkdown);
        jsonWriter.writeStringField("graphQueriesTableName", this.graphQueriesTableName);
        jsonWriter.writeArrayField("graphQueries", this.graphQueries, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("sampleQueries", this.sampleQueries, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("dataTypes", this.dataTypes, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("connectivityCriteria", this.connectivityCriteria,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeJsonField("availability", this.availability);
        jsonWriter.writeJsonField("permissions", this.permissions);
        jsonWriter.writeArrayField("instructionSteps", this.instructionSteps,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeStringField("customImage", this.customImage);
        return jsonWriter.writeEndObject();
    }

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

                if ("title".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.title = reader.getString();
                } else if ("publisher".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.publisher = reader.getString();
                } else if ("descriptionMarkdown".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.descriptionMarkdown = reader.getString();
                } else if ("graphQueriesTableName".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.graphQueriesTableName = reader.getString();
                } else if ("graphQueries".equals(fieldName)) {
                    List graphQueries = reader
                        .readArray(reader1 -> CodelessUiConnectorConfigPropertiesGraphQueriesItem.fromJson(reader1));
                    deserializedCodelessUiConnectorConfigProperties.graphQueries = graphQueries;
                } else if ("sampleQueries".equals(fieldName)) {
                    List sampleQueries = reader
                        .readArray(reader1 -> CodelessUiConnectorConfigPropertiesSampleQueriesItem.fromJson(reader1));
                    deserializedCodelessUiConnectorConfigProperties.sampleQueries = sampleQueries;
                } else if ("dataTypes".equals(fieldName)) {
                    List dataTypes = reader
                        .readArray(reader1 -> CodelessUiConnectorConfigPropertiesDataTypesItem.fromJson(reader1));
                    deserializedCodelessUiConnectorConfigProperties.dataTypes = dataTypes;
                } else if ("connectivityCriteria".equals(fieldName)) {
                    List connectivityCriteria
                        = reader.readArray(
                            reader1 -> CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.fromJson(reader1));
                    deserializedCodelessUiConnectorConfigProperties.connectivityCriteria = connectivityCriteria;
                } else if ("availability".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.availability = Availability.fromJson(reader);
                } else if ("permissions".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.permissions = Permissions.fromJson(reader);
                } else if ("instructionSteps".equals(fieldName)) {
                    List instructionSteps = reader.readArray(
                        reader1 -> CodelessUiConnectorConfigPropertiesInstructionStepsItem.fromJson(reader1));
                    deserializedCodelessUiConnectorConfigProperties.instructionSteps = instructionSteps;
                } else if ("customImage".equals(fieldName)) {
                    deserializedCodelessUiConnectorConfigProperties.customImage = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedCodelessUiConnectorConfigProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy