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

com.azure.resourcemanager.billing.fluent.models.RecipientTransferProperties 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.EligibleProductType;
import com.azure.resourcemanager.billing.models.InitiatorCustomerType;
import com.azure.resourcemanager.billing.models.SupportedAccountType;
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 RecipientTransferProperties implements JsonSerializable {
    /*
     * The time at which the transfer request expires.
     */
    private OffsetDateTime expirationTime;

    /*
     * Type of subscriptions that can be transferred.
     */
    private List allowedProductType;

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

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

    /*
     * 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 type of customer who sent the transfer request.
     */
    private InitiatorCustomerType initiatorCustomerType;

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

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

    /*
     * The customer tenant id.
     */
    private String customerTenantId;

    /*
     * List of supported account types.
     */
    private List supportedAccounts;

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

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

    /**
     * Get the allowedProductType property: Type of subscriptions that can be transferred.
     * 
     * @return the allowedProductType value.
     */
    public List allowedProductType() {
        return this.allowedProductType;
    }

    /**
     * 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 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 initiatorCustomerType property: The type of customer who sent the transfer request.
     * 
     * @return the initiatorCustomerType value.
     */
    public InitiatorCustomerType initiatorCustomerType() {
        return this.initiatorCustomerType;
    }

    /**
     * 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;
    }

    /**
     * Get the customerTenantId property: The customer tenant id.
     * 
     * @return the customerTenantId value.
     */
    public String customerTenantId() {
        return this.customerTenantId;
    }

    /**
     * Get the supportedAccounts property: List of supported account types.
     * 
     * @return the supportedAccounts value.
     */
    public List supportedAccounts() {
        return this.supportedAccounts;
    }

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

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

            return deserializedRecipientTransferProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy