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

com.azure.resourcemanager.billing.models.SubscriptionEnrollmentDetails 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.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;

/**
 * The enrollment details for the subscription. Available for billing accounts with agreement type Enterprise Agreement.
 */
@Fluent
public class SubscriptionEnrollmentDetails implements JsonSerializable {
    /*
     * The name of the department
     */
    private String departmentDisplayName;

    /*
     * The ID that uniquely identifies the department.
     */
    private String departmentId;

    /*
     * The status of the enrollment account.
     */
    private String enrollmentAccountStatus;

    /*
     * The name of the enrollment account.
     */
    private String enrollmentAccountDisplayName;

    /*
     * The ID that uniquely identifies an enrollment account.
     */
    private String enrollmentAccountId;

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

    /**
     * Get the departmentDisplayName property: The name of the department.
     * 
     * @return the departmentDisplayName value.
     */
    public String departmentDisplayName() {
        return this.departmentDisplayName;
    }

    /**
     * Set the departmentDisplayName property: The name of the department.
     * 
     * @param departmentDisplayName the departmentDisplayName value to set.
     * @return the SubscriptionEnrollmentDetails object itself.
     */
    public SubscriptionEnrollmentDetails withDepartmentDisplayName(String departmentDisplayName) {
        this.departmentDisplayName = departmentDisplayName;
        return this;
    }

    /**
     * Get the departmentId property: The ID that uniquely identifies the department.
     * 
     * @return the departmentId value.
     */
    public String departmentId() {
        return this.departmentId;
    }

    /**
     * Set the departmentId property: The ID that uniquely identifies the department.
     * 
     * @param departmentId the departmentId value to set.
     * @return the SubscriptionEnrollmentDetails object itself.
     */
    public SubscriptionEnrollmentDetails withDepartmentId(String departmentId) {
        this.departmentId = departmentId;
        return this;
    }

    /**
     * Get the enrollmentAccountStatus property: The status of the enrollment account.
     * 
     * @return the enrollmentAccountStatus value.
     */
    public String enrollmentAccountStatus() {
        return this.enrollmentAccountStatus;
    }

    /**
     * Set the enrollmentAccountStatus property: The status of the enrollment account.
     * 
     * @param enrollmentAccountStatus the enrollmentAccountStatus value to set.
     * @return the SubscriptionEnrollmentDetails object itself.
     */
    public SubscriptionEnrollmentDetails withEnrollmentAccountStatus(String enrollmentAccountStatus) {
        this.enrollmentAccountStatus = enrollmentAccountStatus;
        return this;
    }

    /**
     * Get the enrollmentAccountDisplayName property: The name of the enrollment account.
     * 
     * @return the enrollmentAccountDisplayName value.
     */
    public String enrollmentAccountDisplayName() {
        return this.enrollmentAccountDisplayName;
    }

    /**
     * Set the enrollmentAccountDisplayName property: The name of the enrollment account.
     * 
     * @param enrollmentAccountDisplayName the enrollmentAccountDisplayName value to set.
     * @return the SubscriptionEnrollmentDetails object itself.
     */
    public SubscriptionEnrollmentDetails withEnrollmentAccountDisplayName(String enrollmentAccountDisplayName) {
        this.enrollmentAccountDisplayName = enrollmentAccountDisplayName;
        return this;
    }

    /**
     * Get the enrollmentAccountId property: The ID that uniquely identifies an enrollment account.
     * 
     * @return the enrollmentAccountId value.
     */
    public String enrollmentAccountId() {
        return this.enrollmentAccountId;
    }

    /**
     * Set the enrollmentAccountId property: The ID that uniquely identifies an enrollment account.
     * 
     * @param enrollmentAccountId the enrollmentAccountId value to set.
     * @return the SubscriptionEnrollmentDetails object itself.
     */
    public SubscriptionEnrollmentDetails withEnrollmentAccountId(String enrollmentAccountId) {
        this.enrollmentAccountId = enrollmentAccountId;
        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("departmentDisplayName", this.departmentDisplayName);
        jsonWriter.writeStringField("departmentId", this.departmentId);
        jsonWriter.writeStringField("enrollmentAccountStatus", this.enrollmentAccountStatus);
        jsonWriter.writeStringField("enrollmentAccountDisplayName", this.enrollmentAccountDisplayName);
        jsonWriter.writeStringField("enrollmentAccountId", this.enrollmentAccountId);
        return jsonWriter.writeEndObject();
    }

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

                if ("departmentDisplayName".equals(fieldName)) {
                    deserializedSubscriptionEnrollmentDetails.departmentDisplayName = reader.getString();
                } else if ("departmentId".equals(fieldName)) {
                    deserializedSubscriptionEnrollmentDetails.departmentId = reader.getString();
                } else if ("enrollmentAccountStatus".equals(fieldName)) {
                    deserializedSubscriptionEnrollmentDetails.enrollmentAccountStatus = reader.getString();
                } else if ("enrollmentAccountDisplayName".equals(fieldName)) {
                    deserializedSubscriptionEnrollmentDetails.enrollmentAccountDisplayName = reader.getString();
                } else if ("enrollmentAccountId".equals(fieldName)) {
                    deserializedSubscriptionEnrollmentDetails.enrollmentAccountId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSubscriptionEnrollmentDetails;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy