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

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

/**
 * Publisher or creator of the content item.
 */
@Fluent
public final class MetadataAuthor implements JsonSerializable {
    /*
     * Name of the author. Company or person.
     */
    private String name;

    /*
     * Email of author contact
     */
    private String email;

    /*
     * Link for author/vendor page
     */
    private String link;

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

    /**
     * Get the name property: Name of the author. Company or person.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the author. Company or person.
     * 
     * @param name the name value to set.
     * @return the MetadataAuthor object itself.
     */
    public MetadataAuthor withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the email property: Email of author contact.
     * 
     * @return the email value.
     */
    public String email() {
        return this.email;
    }

    /**
     * Set the email property: Email of author contact.
     * 
     * @param email the email value to set.
     * @return the MetadataAuthor object itself.
     */
    public MetadataAuthor withEmail(String email) {
        this.email = email;
        return this;
    }

    /**
     * Get the link property: Link for author/vendor page.
     * 
     * @return the link value.
     */
    public String link() {
        return this.link;
    }

    /**
     * Set the link property: Link for author/vendor page.
     * 
     * @param link the link value to set.
     * @return the MetadataAuthor object itself.
     */
    public MetadataAuthor withLink(String link) {
        this.link = link;
        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.writeStringField("name", this.name);
        jsonWriter.writeStringField("email", this.email);
        jsonWriter.writeStringField("link", this.link);
        return jsonWriter.writeEndObject();
    }

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

                if ("name".equals(fieldName)) {
                    deserializedMetadataAuthor.name = reader.getString();
                } else if ("email".equals(fieldName)) {
                    deserializedMetadataAuthor.email = reader.getString();
                } else if ("link".equals(fieldName)) {
                    deserializedMetadataAuthor.link = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMetadataAuthor;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy