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

com.azure.resourcemanager.securityinsights.models.ThreatIntelligenceGranularMarkingModel 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.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;

/**
 * Describes threat granular marking model entity.
 */
@Fluent
public final class ThreatIntelligenceGranularMarkingModel
    implements JsonSerializable {
    /*
     * Language granular marking model
     */
    private String language;

    /*
     * marking reference granular marking model
     */
    private Integer markingRef;

    /*
     * granular marking model selectors
     */
    private List selectors;

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

    /**
     * Get the language property: Language granular marking model.
     * 
     * @return the language value.
     */
    public String language() {
        return this.language;
    }

    /**
     * Set the language property: Language granular marking model.
     * 
     * @param language the language value to set.
     * @return the ThreatIntelligenceGranularMarkingModel object itself.
     */
    public ThreatIntelligenceGranularMarkingModel withLanguage(String language) {
        this.language = language;
        return this;
    }

    /**
     * Get the markingRef property: marking reference granular marking model.
     * 
     * @return the markingRef value.
     */
    public Integer markingRef() {
        return this.markingRef;
    }

    /**
     * Set the markingRef property: marking reference granular marking model.
     * 
     * @param markingRef the markingRef value to set.
     * @return the ThreatIntelligenceGranularMarkingModel object itself.
     */
    public ThreatIntelligenceGranularMarkingModel withMarkingRef(Integer markingRef) {
        this.markingRef = markingRef;
        return this;
    }

    /**
     * Get the selectors property: granular marking model selectors.
     * 
     * @return the selectors value.
     */
    public List selectors() {
        return this.selectors;
    }

    /**
     * Set the selectors property: granular marking model selectors.
     * 
     * @param selectors the selectors value to set.
     * @return the ThreatIntelligenceGranularMarkingModel object itself.
     */
    public ThreatIntelligenceGranularMarkingModel withSelectors(List selectors) {
        this.selectors = selectors;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("language", this.language);
        jsonWriter.writeNumberField("markingRef", this.markingRef);
        jsonWriter.writeArrayField("selectors", this.selectors, (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("language".equals(fieldName)) {
                    deserializedThreatIntelligenceGranularMarkingModel.language = reader.getString();
                } else if ("markingRef".equals(fieldName)) {
                    deserializedThreatIntelligenceGranularMarkingModel.markingRef
                        = reader.getNullable(JsonReader::getInt);
                } else if ("selectors".equals(fieldName)) {
                    List selectors = reader.readArray(reader1 -> reader1.getString());
                    deserializedThreatIntelligenceGranularMarkingModel.selectors = selectors;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedThreatIntelligenceGranularMarkingModel;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy