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

com.azure.resourcemanager.security.models.StandardMetadata 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.Immutable;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;

/**
 * The standard metadata.
 */
@Immutable
public final class StandardMetadata implements JsonSerializable {
    /*
     * Standard Created by object id (GUID)
     */
    private String createdBy;

    /*
     * Standard creation date
     */
    private OffsetDateTime createdOn;

    /*
     * Standard last updated by object id (GUID)
     */
    private String lastUpdatedBy;

    /*
     * Standard last update date
     */
    private OffsetDateTime lastUpdatedOn;

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

    /**
     * Get the createdBy property: Standard Created by object id (GUID).
     * 
     * @return the createdBy value.
     */
    public String createdBy() {
        return this.createdBy;
    }

    /**
     * Get the createdOn property: Standard creation date.
     * 
     * @return the createdOn value.
     */
    public OffsetDateTime createdOn() {
        return this.createdOn;
    }

    /**
     * Get the lastUpdatedBy property: Standard last updated by object id (GUID).
     * 
     * @return the lastUpdatedBy value.
     */
    public String lastUpdatedBy() {
        return this.lastUpdatedBy;
    }

    /**
     * Get the lastUpdatedOn property: Standard last update date.
     * 
     * @return the lastUpdatedOn value.
     */
    public OffsetDateTime lastUpdatedOn() {
        return this.lastUpdatedOn;
    }

    /**
     * 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();
        return jsonWriter.writeEndObject();
    }

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

                if ("createdBy".equals(fieldName)) {
                    deserializedStandardMetadata.createdBy = reader.getString();
                } else if ("createdOn".equals(fieldName)) {
                    deserializedStandardMetadata.createdOn = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("lastUpdatedBy".equals(fieldName)) {
                    deserializedStandardMetadata.lastUpdatedBy = reader.getString();
                } else if ("lastUpdatedOn".equals(fieldName)) {
                    deserializedStandardMetadata.lastUpdatedOn = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedStandardMetadata;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy