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

com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates 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.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The SecurityAssessmentMetadataPropertiesResponsePublishDates model.
 */
@Fluent
public final class SecurityAssessmentMetadataPropertiesResponsePublishDates
    implements JsonSerializable {
    /*
     * The GA property.
     */
    private String ga;

    /*
     * The public property.
     */
    private String publicProperty;

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

    /**
     * Get the ga property: The GA property.
     * 
     * @return the ga value.
     */
    public String ga() {
        return this.ga;
    }

    /**
     * Set the ga property: The GA property.
     * 
     * @param ga the ga value to set.
     * @return the SecurityAssessmentMetadataPropertiesResponsePublishDates object itself.
     */
    public SecurityAssessmentMetadataPropertiesResponsePublishDates withGa(String ga) {
        this.ga = ga;
        return this;
    }

    /**
     * Get the publicProperty property: The public property.
     * 
     * @return the publicProperty value.
     */
    public String publicProperty() {
        return this.publicProperty;
    }

    /**
     * Set the publicProperty property: The public property.
     * 
     * @param publicProperty the publicProperty value to set.
     * @return the SecurityAssessmentMetadataPropertiesResponsePublishDates object itself.
     */
    public SecurityAssessmentMetadataPropertiesResponsePublishDates withPublicProperty(String publicProperty) {
        this.publicProperty = publicProperty;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (publicProperty() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property publicProperty in model SecurityAssessmentMetadataPropertiesResponsePublishDates"));
        }
    }

    private static final ClientLogger LOGGER
        = new ClientLogger(SecurityAssessmentMetadataPropertiesResponsePublishDates.class);

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("public", this.publicProperty);
        jsonWriter.writeStringField("GA", this.ga);
        return jsonWriter.writeEndObject();
    }

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

                if ("public".equals(fieldName)) {
                    deserializedSecurityAssessmentMetadataPropertiesResponsePublishDates.publicProperty
                        = reader.getString();
                } else if ("GA".equals(fieldName)) {
                    deserializedSecurityAssessmentMetadataPropertiesResponsePublishDates.ga = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSecurityAssessmentMetadataPropertiesResponsePublishDates;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy