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

com.azure.resourcemanager.billing.fluent.models.PartnerTransferProperties 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 com.azure.resourcemanager.billing.models.DetailedTransferStatus;
import com.azure.resourcemanager.billing.models.InitiatorCustomerType;
import com.azure.resourcemanager.billing.models.TransferStatus;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;

/**
 * Transfer Details.
 */
@Immutable
public final class PartnerTransferProperties implements JsonSerializable {
    /*
     * The time at which the transfer request expires.
     */
    private OffsetDateTime expirationTime;

    /*
     * Overall transfer status.
     */
    private TransferStatus transferStatus;

    /*
     * The email ID of the user to whom the transfer request was sent.
     */
    private String recipientEmailId;

    /*
     * The type of customer who sent the transfer request.
     */
    private InitiatorCustomerType initiatorCustomerType;

    /*
     * The email ID of the user who sent the transfer request.
     */
    private String initiatorEmailId;

    /*
     * Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft Partner Agreement billing
     * account.
     */
    private String resellerId;

    /*
     * Optional name of the reseller for transfer requests that are sent from Microsoft Partner Agreement billing
     * account.
     */
    private String resellerName;

    /*
     * The email ID of the user who canceled the transfer request.
     */
    private String canceledBy;

    /*
     * Detailed transfer status.
     */
    private List detailedTransferStatus;

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

    /**
     * Get the expirationTime property: The time at which the transfer request expires.
     * 
     * @return the expirationTime value.
     */
    public OffsetDateTime expirationTime() {
        return this.expirationTime;
    }

    /**
     * Get the transferStatus property: Overall transfer status.
     * 
     * @return the transferStatus value.
     */
    public TransferStatus transferStatus() {
        return this.transferStatus;
    }

    /**
     * Get the recipientEmailId property: The email ID of the user to whom the transfer request was sent.
     * 
     * @return the recipientEmailId value.
     */
    public String recipientEmailId() {
        return this.recipientEmailId;
    }

    /**
     * Get the initiatorCustomerType property: The type of customer who sent the transfer request.
     * 
     * @return the initiatorCustomerType value.
     */
    public InitiatorCustomerType initiatorCustomerType() {
        return this.initiatorCustomerType;
    }

    /**
     * Get the initiatorEmailId property: The email ID of the user who sent the transfer request.
     * 
     * @return the initiatorEmailId value.
     */
    public String initiatorEmailId() {
        return this.initiatorEmailId;
    }

    /**
     * Get the resellerId property: Optional MPN ID of the reseller for transfer requests that are sent from a Microsoft
     * Partner Agreement billing account.
     * 
     * @return the resellerId value.
     */
    public String resellerId() {
        return this.resellerId;
    }

    /**
     * Get the resellerName property: Optional name of the reseller for transfer requests that are sent from Microsoft
     * Partner Agreement billing account.
     * 
     * @return the resellerName value.
     */
    public String resellerName() {
        return this.resellerName;
    }

    /**
     * Get the canceledBy property: The email ID of the user who canceled the transfer request.
     * 
     * @return the canceledBy value.
     */
    public String canceledBy() {
        return this.canceledBy;
    }

    /**
     * Get the detailedTransferStatus property: Detailed transfer status.
     * 
     * @return the detailedTransferStatus value.
     */
    public List detailedTransferStatus() {
        return this.detailedTransferStatus;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (detailedTransferStatus() != null) {
            detailedTransferStatus().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

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

                if ("expirationTime".equals(fieldName)) {
                    deserializedPartnerTransferProperties.expirationTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("transferStatus".equals(fieldName)) {
                    deserializedPartnerTransferProperties.transferStatus
                        = TransferStatus.fromString(reader.getString());
                } else if ("recipientEmailId".equals(fieldName)) {
                    deserializedPartnerTransferProperties.recipientEmailId = reader.getString();
                } else if ("initiatorCustomerType".equals(fieldName)) {
                    deserializedPartnerTransferProperties.initiatorCustomerType
                        = InitiatorCustomerType.fromString(reader.getString());
                } else if ("initiatorEmailId".equals(fieldName)) {
                    deserializedPartnerTransferProperties.initiatorEmailId = reader.getString();
                } else if ("resellerId".equals(fieldName)) {
                    deserializedPartnerTransferProperties.resellerId = reader.getString();
                } else if ("resellerName".equals(fieldName)) {
                    deserializedPartnerTransferProperties.resellerName = reader.getString();
                } else if ("canceledBy".equals(fieldName)) {
                    deserializedPartnerTransferProperties.canceledBy = reader.getString();
                } else if ("detailedTransferStatus".equals(fieldName)) {
                    List detailedTransferStatus
                        = reader.readArray(reader1 -> DetailedTransferStatus.fromJson(reader1));
                    deserializedPartnerTransferProperties.detailedTransferStatus = detailedTransferStatus;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedPartnerTransferProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy