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

com.azure.resourcemanager.sql.fluent.models.ImportExportOperationResultProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure Sql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt

The 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.sql.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.sql.models.PrivateEndpointConnectionRequestStatus;
import java.io.IOException;
import java.util.List;
import java.util.UUID;

/**
 * Contains the operation result properties for import/export operation.
 */
@Immutable
public final class ImportExportOperationResultProperties
    implements JsonSerializable {
    /*
     * Request Id.
     */
    private UUID requestId;

    /*
     * Request type.
     */
    private String requestType;

    /*
     * Queued time.
     */
    private String queuedTime;

    /*
     * Last modified time.
     */
    private String lastModifiedTime;

    /*
     * Blob Uri.
     */
    private String blobUri;

    /*
     * Server name.
     */
    private String serverName;

    /*
     * Database name.
     */
    private String databaseName;

    /*
     * Operation status.
     */
    private String status;

    /*
     * Error message.
     */
    private String errorMessage;

    /*
     * Gets the status of private endpoints associated with this request.
     */
    private List privateEndpointConnections;

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

    /**
     * Get the requestId property: Request Id.
     * 
     * @return the requestId value.
     */
    public UUID requestId() {
        return this.requestId;
    }

    /**
     * Get the requestType property: Request type.
     * 
     * @return the requestType value.
     */
    public String requestType() {
        return this.requestType;
    }

    /**
     * Get the queuedTime property: Queued time.
     * 
     * @return the queuedTime value.
     */
    public String queuedTime() {
        return this.queuedTime;
    }

    /**
     * Get the lastModifiedTime property: Last modified time.
     * 
     * @return the lastModifiedTime value.
     */
    public String lastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * Get the blobUri property: Blob Uri.
     * 
     * @return the blobUri value.
     */
    public String blobUri() {
        return this.blobUri;
    }

    /**
     * Get the serverName property: Server name.
     * 
     * @return the serverName value.
     */
    public String serverName() {
        return this.serverName;
    }

    /**
     * Get the databaseName property: Database name.
     * 
     * @return the databaseName value.
     */
    public String databaseName() {
        return this.databaseName;
    }

    /**
     * Get the status property: Operation status.
     * 
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Get the errorMessage property: Error message.
     * 
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.errorMessage;
    }

    /**
     * Get the privateEndpointConnections property: Gets the status of private endpoints associated with this request.
     * 
     * @return the privateEndpointConnections value.
     */
    public List privateEndpointConnections() {
        return this.privateEndpointConnections;
    }

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

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

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

                if ("requestId".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.requestId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else if ("requestType".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.requestType = reader.getString();
                } else if ("queuedTime".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.queuedTime = reader.getString();
                } else if ("lastModifiedTime".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.lastModifiedTime = reader.getString();
                } else if ("blobUri".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.blobUri = reader.getString();
                } else if ("serverName".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.serverName = reader.getString();
                } else if ("databaseName".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.databaseName = reader.getString();
                } else if ("status".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.status = reader.getString();
                } else if ("errorMessage".equals(fieldName)) {
                    deserializedImportExportOperationResultProperties.errorMessage = reader.getString();
                } else if ("privateEndpointConnections".equals(fieldName)) {
                    List privateEndpointConnections
                        = reader.readArray(reader1 -> PrivateEndpointConnectionRequestStatus.fromJson(reader1));
                    deserializedImportExportOperationResultProperties.privateEndpointConnections
                        = privateEndpointConnections;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedImportExportOperationResultProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy