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

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

/**
 * Describe the additional data of governance assignment - optional.
 */
@Fluent
public final class GovernanceAssignmentAdditionalData implements JsonSerializable {
    /*
     * Ticket number associated with this governance assignment
     */
    private Integer ticketNumber;

    /*
     * Ticket link associated with this governance assignment - for example: https://snow.com
     */
    private String ticketLink;

    /*
     * The ticket status associated with this governance assignment - for example: Active
     */
    private String ticketStatus;

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

    /**
     * Get the ticketNumber property: Ticket number associated with this governance assignment.
     * 
     * @return the ticketNumber value.
     */
    public Integer ticketNumber() {
        return this.ticketNumber;
    }

    /**
     * Set the ticketNumber property: Ticket number associated with this governance assignment.
     * 
     * @param ticketNumber the ticketNumber value to set.
     * @return the GovernanceAssignmentAdditionalData object itself.
     */
    public GovernanceAssignmentAdditionalData withTicketNumber(Integer ticketNumber) {
        this.ticketNumber = ticketNumber;
        return this;
    }

    /**
     * Get the ticketLink property: Ticket link associated with this governance assignment - for example:
     * https://snow.com.
     * 
     * @return the ticketLink value.
     */
    public String ticketLink() {
        return this.ticketLink;
    }

    /**
     * Set the ticketLink property: Ticket link associated with this governance assignment - for example:
     * https://snow.com.
     * 
     * @param ticketLink the ticketLink value to set.
     * @return the GovernanceAssignmentAdditionalData object itself.
     */
    public GovernanceAssignmentAdditionalData withTicketLink(String ticketLink) {
        this.ticketLink = ticketLink;
        return this;
    }

    /**
     * Get the ticketStatus property: The ticket status associated with this governance assignment - for example:
     * Active.
     * 
     * @return the ticketStatus value.
     */
    public String ticketStatus() {
        return this.ticketStatus;
    }

    /**
     * Set the ticketStatus property: The ticket status associated with this governance assignment - for example:
     * Active.
     * 
     * @param ticketStatus the ticketStatus value to set.
     * @return the GovernanceAssignmentAdditionalData object itself.
     */
    public GovernanceAssignmentAdditionalData withTicketStatus(String ticketStatus) {
        this.ticketStatus = ticketStatus;
        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.writeNumberField("ticketNumber", this.ticketNumber);
        jsonWriter.writeStringField("ticketLink", this.ticketLink);
        jsonWriter.writeStringField("ticketStatus", this.ticketStatus);
        return jsonWriter.writeEndObject();
    }

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

                if ("ticketNumber".equals(fieldName)) {
                    deserializedGovernanceAssignmentAdditionalData.ticketNumber
                        = reader.getNullable(JsonReader::getInt);
                } else if ("ticketLink".equals(fieldName)) {
                    deserializedGovernanceAssignmentAdditionalData.ticketLink = reader.getString();
                } else if ("ticketStatus".equals(fieldName)) {
                    deserializedGovernanceAssignmentAdditionalData.ticketStatus = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedGovernanceAssignmentAdditionalData;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy