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

com.azure.resourcemanager.billing.fluent.models.TransitionDetailsInner Maven / Gradle / Ivy

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.billing.fluent.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 details for a billing account transitioned from agreement type Microsoft Online Services Program to agreement
 * type Microsoft Customer Agreement.
 */
@Immutable
public final class TransitionDetailsInner implements JsonSerializable {
    /*
     * The transition completion date.
     */
    private OffsetDateTime transitionDate;

    /*
     * The anniversary day of the pre-transitioned account of type Microsoft Online Services Program.
     */
    private Integer anniversaryDay;

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

    /**
     * Get the transitionDate property: The transition completion date.
     * 
     * @return the transitionDate value.
     */
    public OffsetDateTime transitionDate() {
        return this.transitionDate;
    }

    /**
     * Get the anniversaryDay property: The anniversary day of the pre-transitioned account of type Microsoft Online
     * Services Program.
     * 
     * @return the anniversaryDay value.
     */
    public Integer anniversaryDay() {
        return this.anniversaryDay;
    }

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

                if ("transitionDate".equals(fieldName)) {
                    deserializedTransitionDetailsInner.transitionDate = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("anniversaryDay".equals(fieldName)) {
                    deserializedTransitionDetailsInner.anniversaryDay = reader.getNullable(JsonReader::getInt);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedTransitionDetailsInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy