com.azure.resourcemanager.securityinsights.models.MetadataPatch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
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.management.SystemData;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.securityinsights.fluent.models.MetadataPropertiesPatch;
import java.io.IOException;
import java.time.LocalDate;
import java.util.List;
/**
* Metadata patch request body.
*/
@Fluent
public final class MetadataPatch extends ResourceWithEtag {
/*
* Metadata patch request body
*/
private MetadataPropertiesPatch 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 MetadataPatch class.
*/
public MetadataPatch() {
}
/**
* Get the innerProperties property: Metadata patch request body.
*
* @return the innerProperties value.
*/
private MetadataPropertiesPatch 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 MetadataPatch 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 MetadataPatch object itself.
*/
public MetadataPatch withContentId(String contentId) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withParentId(String parentId) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withVersion(String version) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withKind(Kind kind) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withSource(MetadataSource source) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withAuthor(MetadataAuthor author) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withSupport(MetadataSupport support) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withDependencies(MetadataDependencies dependencies) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withCategories(MetadataCategories categories) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withProviders(List providers) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withFirstPublishDate(LocalDate firstPublishDate) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withLastPublishDate(LocalDate lastPublishDate) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withCustomVersion(String customVersion) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withContentSchemaVersion(String contentSchemaVersion) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withIcon(String icon) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withThreatAnalysisTactics(List threatAnalysisTactics) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withThreatAnalysisTechniques(List threatAnalysisTechniques) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withPreviewImages(List previewImages) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch object itself.
*/
public MetadataPatch withPreviewImagesDark(List previewImagesDark) {
if (this.innerProperties() == null) {
this.innerProperties = new MetadataPropertiesPatch();
}
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 MetadataPatch from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MetadataPatch 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 MetadataPatch.
*/
public static MetadataPatch fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MetadataPatch deserializedMetadataPatch = new MetadataPatch();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedMetadataPatch.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedMetadataPatch.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedMetadataPatch.type = reader.getString();
} else if ("etag".equals(fieldName)) {
deserializedMetadataPatch.withEtag(reader.getString());
} else if ("systemData".equals(fieldName)) {
deserializedMetadataPatch.systemData = SystemData.fromJson(reader);
} else if ("properties".equals(fieldName)) {
deserializedMetadataPatch.innerProperties = MetadataPropertiesPatch.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedMetadataPatch;
});
}
}