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

com.azure.resourcemanager.hybridcompute.fluent.models.ProvisioningIssueProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-07.

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.hybridcompute.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.hybridcompute.models.AccessRule;
import com.azure.resourcemanager.hybridcompute.models.ProvisioningIssueSeverity;
import com.azure.resourcemanager.hybridcompute.models.ProvisioningIssueType;
import java.io.IOException;
import java.util.List;

/**
 * Properties of a provisioning issue.
 */
@Immutable
public final class ProvisioningIssueProperties implements JsonSerializable {
    /*
     * Issue type
     */
    private ProvisioningIssueType issueType;

    /*
     * Severity of the provisioning issue.
     */
    private ProvisioningIssueSeverity severity;

    /*
     * Description of the provisioning issue.
     */
    private String description;

    /*
     * ARM Ids of the resources that can be associated to the same perimeter to remediate the issue
     */
    private List suggestedResourceIds;

    /*
     * Access rules that can be added to the perimeter to remediate the issue
     */
    private List suggestedAccessRules;

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

    /**
     * Get the issueType property: Issue type.
     * 
     * @return the issueType value.
     */
    public ProvisioningIssueType issueType() {
        return this.issueType;
    }

    /**
     * Get the severity property: Severity of the provisioning issue.
     * 
     * @return the severity value.
     */
    public ProvisioningIssueSeverity severity() {
        return this.severity;
    }

    /**
     * Get the description property: Description of the provisioning issue.
     * 
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Get the suggestedResourceIds property: ARM Ids of the resources that can be associated to the same perimeter to
     * remediate the issue.
     * 
     * @return the suggestedResourceIds value.
     */
    public List suggestedResourceIds() {
        return this.suggestedResourceIds;
    }

    /**
     * Get the suggestedAccessRules property: Access rules that can be added to the perimeter to remediate the issue.
     * 
     * @return the suggestedAccessRules value.
     */
    public List suggestedAccessRules() {
        return this.suggestedAccessRules;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

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

                if ("issueType".equals(fieldName)) {
                    deserializedProvisioningIssueProperties.issueType
                        = ProvisioningIssueType.fromString(reader.getString());
                } else if ("severity".equals(fieldName)) {
                    deserializedProvisioningIssueProperties.severity
                        = ProvisioningIssueSeverity.fromString(reader.getString());
                } else if ("description".equals(fieldName)) {
                    deserializedProvisioningIssueProperties.description = reader.getString();
                } else if ("suggestedResourceIds".equals(fieldName)) {
                    List suggestedResourceIds = reader.readArray(reader1 -> reader1.getString());
                    deserializedProvisioningIssueProperties.suggestedResourceIds = suggestedResourceIds;
                } else if ("suggestedAccessRules".equals(fieldName)) {
                    List suggestedAccessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1));
                    deserializedProvisioningIssueProperties.suggestedAccessRules = suggestedAccessRules;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedProvisioningIssueProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy