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

com.azure.resourcemanager.security.fluent.models.SecurityStandardInner 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.security.models.PartialAssessmentProperties;
import com.azure.resourcemanager.security.models.StandardMetadata;
import com.azure.resourcemanager.security.models.StandardSupportedCloud;
import com.azure.resourcemanager.security.models.StandardType;
import java.io.IOException;
import java.util.List;

/**
 * Security Standard on a resource.
 */
@Fluent
public final class SecurityStandardInner extends ProxyResource {
    /*
     * Properties of a security standard
     */
    private StandardProperties innerProperties;

    /*
     * 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 SecurityStandardInner class.
     */
    public SecurityStandardInner() {
    }

    /**
     * Get the innerProperties property: Properties of a security standard.
     * 
     * @return the innerProperties value.
     */
    private StandardProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * 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;
    }

    /**
     * Get the displayName property: Display name of the standard, equivalent to the standardId.
     * 
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: Display name of the standard, equivalent to the standardId.
     * 
     * @param displayName the displayName value to set.
     * @return the SecurityStandardInner object itself.
     */
    public SecurityStandardInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StandardProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the standardType property: Standard type (Custom or Default or Compliance only currently).
     * 
     * @return the standardType value.
     */
    public StandardType standardType() {
        return this.innerProperties() == null ? null : this.innerProperties().standardType();
    }

    /**
     * Get the description property: Description of the standard.
     * 
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Description of the standard.
     * 
     * @param description the description value to set.
     * @return the SecurityStandardInner object itself.
     */
    public SecurityStandardInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StandardProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the assessments property: List of assessment keys to apply to standard scope.
     * 
     * @return the assessments value.
     */
    public List assessments() {
        return this.innerProperties() == null ? null : this.innerProperties().assessments();
    }

    /**
     * Set the assessments property: List of assessment keys to apply to standard scope.
     * 
     * @param assessments the assessments value to set.
     * @return the SecurityStandardInner object itself.
     */
    public SecurityStandardInner withAssessments(List assessments) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StandardProperties();
        }
        this.innerProperties().withAssessments(assessments);
        return this;
    }

    /**
     * Get the cloudProviders property: List of all standard supported clouds.
     * 
     * @return the cloudProviders value.
     */
    public List cloudProviders() {
        return this.innerProperties() == null ? null : this.innerProperties().cloudProviders();
    }

    /**
     * Set the cloudProviders property: List of all standard supported clouds.
     * 
     * @param cloudProviders the cloudProviders value to set.
     * @return the SecurityStandardInner object itself.
     */
    public SecurityStandardInner withCloudProviders(List cloudProviders) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StandardProperties();
        }
        this.innerProperties().withCloudProviders(cloudProviders);
        return this;
    }

    /**
     * Get the policySetDefinitionId property: The policy set definition id associated with the standard.
     * 
     * @return the policySetDefinitionId value.
     */
    public String policySetDefinitionId() {
        return this.innerProperties() == null ? null : this.innerProperties().policySetDefinitionId();
    }

    /**
     * Set the policySetDefinitionId property: The policy set definition id associated with the standard.
     * 
     * @param policySetDefinitionId the policySetDefinitionId value to set.
     * @return the SecurityStandardInner object itself.
     */
    public SecurityStandardInner withPolicySetDefinitionId(String policySetDefinitionId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StandardProperties();
        }
        this.innerProperties().withPolicySetDefinitionId(policySetDefinitionId);
        return this;
    }

    /**
     * Get the metadata property: The security standard metadata.
     * 
     * @return the metadata value.
     */
    public StandardMetadata metadata() {
        return this.innerProperties() == null ? null : this.innerProperties().metadata();
    }

    /**
     * Set the metadata property: The security standard metadata.
     * 
     * @param metadata the metadata value to set.
     * @return the SecurityStandardInner object itself.
     */
    public SecurityStandardInner withMetadata(StandardMetadata metadata) {
        if (this.innerProperties() == null) {
            this.innerProperties = new StandardProperties();
        }
        this.innerProperties().withMetadata(metadata);
        return this;
    }

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

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

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

                if ("id".equals(fieldName)) {
                    deserializedSecurityStandardInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedSecurityStandardInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedSecurityStandardInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedSecurityStandardInner.innerProperties = StandardProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSecurityStandardInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy