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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.models.Kind;
import com.azure.resourcemanager.securityinsights.models.MetadataAuthor;
import com.azure.resourcemanager.securityinsights.models.MetadataCategories;
import com.azure.resourcemanager.securityinsights.models.MetadataDependencies;
import com.azure.resourcemanager.securityinsights.models.MetadataSource;
import com.azure.resourcemanager.securityinsights.models.MetadataSupport;
import com.azure.resourcemanager.securityinsights.models.ResourceWithEtag;
import java.io.IOException;
import java.time.LocalDate;
import java.util.List;

/**
 * Metadata resource definition.
 */
@Fluent
public final class MetadataModelInner extends ResourceWithEtag {
    /*
     * Metadata properties
     */
    private MetadataProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    private SystemData systemData;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the innerProperties property: Metadata properties.
     * 
     * @return the innerProperties value.
     */
    private MetadataProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     * 
     * @return the systemData value.
     */
    @Override
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the type property: The type of the resource.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public MetadataModelInner withEtag(String etag) {
        super.withEtag(etag);
        return this;
    }

    /**
     * Get the contentId property: Static ID for the content. Used to identify dependencies and content from solutions
     * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the
     * resource name.
     * 
     * @return the contentId value.
     */
    public String contentId() {
        return this.innerProperties() == null ? null : this.innerProperties().contentId();
    }

    /**
     * Set the contentId property: Static ID for the content. Used to identify dependencies and content from solutions
     * or community. Hard-coded/static for out of the box content and solutions. Dynamic for user-created. This is the
     * resource name.
     * 
     * @param contentId the contentId value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withContentId(String contentId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withContentId(contentId);
        return this;
    }

    /**
     * Get the parentId property: Full parent resource ID of the content item the metadata is for. This is the full
     * resource ID including the scope (subscription and resource group).
     * 
     * @return the parentId value.
     */
    public String parentId() {
        return this.innerProperties() == null ? null : this.innerProperties().parentId();
    }

    /**
     * Set the parentId property: Full parent resource ID of the content item the metadata is for. This is the full
     * resource ID including the scope (subscription and resource group).
     * 
     * @param parentId the parentId value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withParentId(String parentId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withParentId(parentId);
        return this;
    }

    /**
     * Get the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0,
     * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version
     * checks.
     * 
     * @return the version value.
     */
    public String version() {
        return this.innerProperties() == null ? null : this.innerProperties().version();
    }

    /**
     * Set the version property: Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0,
     * 1.0.0.0), following ARM template best practices. Can also be any string, but then we cannot guarantee any version
     * checks.
     * 
     * @param version the version value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withVersion(String version) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withVersion(version);
        return this;
    }

    /**
     * Get the kind property: The kind of content the metadata is for.
     * 
     * @return the kind value.
     */
    public Kind kind() {
        return this.innerProperties() == null ? null : this.innerProperties().kind();
    }

    /**
     * Set the kind property: The kind of content the metadata is for.
     * 
     * @param kind the kind value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withKind(Kind kind) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withKind(kind);
        return this;
    }

    /**
     * Get the source property: Source of the content. This is where/how it was created.
     * 
     * @return the source value.
     */
    public MetadataSource source() {
        return this.innerProperties() == null ? null : this.innerProperties().source();
    }

    /**
     * Set the source property: Source of the content. This is where/how it was created.
     * 
     * @param source the source value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withSource(MetadataSource source) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withSource(source);
        return this;
    }

    /**
     * Get the author property: The creator of the content item.
     * 
     * @return the author value.
     */
    public MetadataAuthor author() {
        return this.innerProperties() == null ? null : this.innerProperties().author();
    }

    /**
     * Set the author property: The creator of the content item.
     * 
     * @param author the author value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withAuthor(MetadataAuthor author) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withAuthor(author);
        return this;
    }

    /**
     * Get the support property: Support information for the metadata - type, name, contact information.
     * 
     * @return the support value.
     */
    public MetadataSupport support() {
        return this.innerProperties() == null ? null : this.innerProperties().support();
    }

    /**
     * Set the support property: Support information for the metadata - type, name, contact information.
     * 
     * @param support the support value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withSupport(MetadataSupport support) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withSupport(support);
        return this;
    }

    /**
     * Get the dependencies property: Dependencies for the content item, what other content items it requires to work.
     * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an
     * id/kind/version can be supplied or operator/criteria for complex formats.
     * 
     * @return the dependencies value.
     */
    public MetadataDependencies dependencies() {
        return this.innerProperties() == null ? null : this.innerProperties().dependencies();
    }

    /**
     * Set the dependencies property: Dependencies for the content item, what other content items it requires to work.
     * Can describe more complex dependencies using a recursive/nested structure. For a single dependency an
     * id/kind/version can be supplied or operator/criteria for complex formats.
     * 
     * @param dependencies the dependencies value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withDependencies(MetadataDependencies dependencies) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withDependencies(dependencies);
        return this;
    }

    /**
     * Get the categories property: Categories for the solution content item.
     * 
     * @return the categories value.
     */
    public MetadataCategories categories() {
        return this.innerProperties() == null ? null : this.innerProperties().categories();
    }

    /**
     * Set the categories property: Categories for the solution content item.
     * 
     * @param categories the categories value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withCategories(MetadataCategories categories) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withCategories(categories);
        return this;
    }

    /**
     * Get the providers property: Providers for the solution content item.
     * 
     * @return the providers value.
     */
    public List providers() {
        return this.innerProperties() == null ? null : this.innerProperties().providers();
    }

    /**
     * Set the providers property: Providers for the solution content item.
     * 
     * @param providers the providers value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withProviders(List providers) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withProviders(providers);
        return this;
    }

    /**
     * Get the firstPublishDate property: first publish date solution content item.
     * 
     * @return the firstPublishDate value.
     */
    public LocalDate firstPublishDate() {
        return this.innerProperties() == null ? null : this.innerProperties().firstPublishDate();
    }

    /**
     * Set the firstPublishDate property: first publish date solution content item.
     * 
     * @param firstPublishDate the firstPublishDate value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withFirstPublishDate(LocalDate firstPublishDate) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withFirstPublishDate(firstPublishDate);
        return this;
    }

    /**
     * Get the lastPublishDate property: last publish date for the solution content item.
     * 
     * @return the lastPublishDate value.
     */
    public LocalDate lastPublishDate() {
        return this.innerProperties() == null ? null : this.innerProperties().lastPublishDate();
    }

    /**
     * Set the lastPublishDate property: last publish date for the solution content item.
     * 
     * @param lastPublishDate the lastPublishDate value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withLastPublishDate(LocalDate lastPublishDate) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withLastPublishDate(lastPublishDate);
        return this;
    }

    /**
     * Get the customVersion property: The custom version of the content. A optional free text.
     * 
     * @return the customVersion value.
     */
    public String customVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().customVersion();
    }

    /**
     * Set the customVersion property: The custom version of the content. A optional free text.
     * 
     * @param customVersion the customVersion value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withCustomVersion(String customVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withCustomVersion(customVersion);
        return this;
    }

    /**
     * Get the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between
     * different flow based on the schema version.
     * 
     * @return the contentSchemaVersion value.
     */
    public String contentSchemaVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().contentSchemaVersion();
    }

    /**
     * Set the contentSchemaVersion property: Schema version of the content. Can be used to distinguish between
     * different flow based on the schema version.
     * 
     * @param contentSchemaVersion the contentSchemaVersion value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withContentSchemaVersion(String contentSchemaVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withContentSchemaVersion(contentSchemaVersion);
        return this;
    }

    /**
     * Get the icon property: the icon identifier. this id can later be fetched from the solution template.
     * 
     * @return the icon value.
     */
    public String icon() {
        return this.innerProperties() == null ? null : this.innerProperties().icon();
    }

    /**
     * Set the icon property: the icon identifier. this id can later be fetched from the solution template.
     * 
     * @param icon the icon value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withIcon(String icon) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withIcon(icon);
        return this;
    }

    /**
     * Get the threatAnalysisTactics property: the tactics the resource covers.
     * 
     * @return the threatAnalysisTactics value.
     */
    public List threatAnalysisTactics() {
        return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTactics();
    }

    /**
     * Set the threatAnalysisTactics property: the tactics the resource covers.
     * 
     * @param threatAnalysisTactics the threatAnalysisTactics value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withThreatAnalysisTactics(List threatAnalysisTactics) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withThreatAnalysisTactics(threatAnalysisTactics);
        return this;
    }

    /**
     * Get the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the
     * tactics being used.
     * 
     * @return the threatAnalysisTechniques value.
     */
    public List threatAnalysisTechniques() {
        return this.innerProperties() == null ? null : this.innerProperties().threatAnalysisTechniques();
    }

    /**
     * Set the threatAnalysisTechniques property: the techniques the resource covers, these have to be aligned with the
     * tactics being used.
     * 
     * @param threatAnalysisTechniques the threatAnalysisTechniques value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withThreatAnalysisTechniques(List threatAnalysisTechniques) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withThreatAnalysisTechniques(threatAnalysisTechniques);
        return this;
    }

    /**
     * Get the previewImages property: preview image file names. These will be taken from the solution artifacts.
     * 
     * @return the previewImages value.
     */
    public List previewImages() {
        return this.innerProperties() == null ? null : this.innerProperties().previewImages();
    }

    /**
     * Set the previewImages property: preview image file names. These will be taken from the solution artifacts.
     * 
     * @param previewImages the previewImages value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withPreviewImages(List previewImages) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withPreviewImages(previewImages);
        return this;
    }

    /**
     * Get the previewImagesDark property: preview image file names. These will be taken from the solution artifacts.
     * used for dark theme support.
     * 
     * @return the previewImagesDark value.
     */
    public List previewImagesDark() {
        return this.innerProperties() == null ? null : this.innerProperties().previewImagesDark();
    }

    /**
     * Set the previewImagesDark property: preview image file names. These will be taken from the solution artifacts.
     * used for dark theme support.
     * 
     * @param previewImagesDark the previewImagesDark value to set.
     * @return the MetadataModelInner object itself.
     */
    public MetadataModelInner withPreviewImagesDark(List previewImagesDark) {
        if (this.innerProperties() == null) {
            this.innerProperties = new MetadataProperties();
        }
        this.innerProperties().withPreviewImagesDark(previewImagesDark);
        return this;
    }

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

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

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

                if ("id".equals(fieldName)) {
                    deserializedMetadataModelInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedMetadataModelInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedMetadataModelInner.type = reader.getString();
                } else if ("etag".equals(fieldName)) {
                    deserializedMetadataModelInner.withEtag(reader.getString());
                } else if ("systemData".equals(fieldName)) {
                    deserializedMetadataModelInner.systemData = SystemData.fromJson(reader);
                } else if ("properties".equals(fieldName)) {
                    deserializedMetadataModelInner.innerProperties = MetadataProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMetadataModelInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy