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

com.azure.resourcemanager.sql.fluent.models.CopyLongTermRetentionBackupParametersProperties 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.Fluent;
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.BackupStorageRedundancy;
import java.io.IOException;

/**
 * Contains the properties to perform long term retention backup copy operation.
 */
@Fluent
public final class CopyLongTermRetentionBackupParametersProperties
    implements JsonSerializable {
    /*
     * The subscription that owns the target server
     */
    private String targetSubscriptionId;

    /*
     * The resource group that owns the target server
     */
    private String targetResourceGroup;

    /*
     * The resource Id of the target server that owns the database
     */
    private String targetServerResourceId;

    /*
     * The fully qualified domain name of the target server
     */
    private String targetServerFullyQualifiedDomainName;

    /*
     * The name of the database owns the copied backup.
     */
    private String targetDatabaseName;

    /*
     * The storage redundancy type of the copied backup
     */
    private BackupStorageRedundancy targetBackupStorageRedundancy;

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

    /**
     * Get the targetSubscriptionId property: The subscription that owns the target server.
     * 
     * @return the targetSubscriptionId value.
     */
    public String targetSubscriptionId() {
        return this.targetSubscriptionId;
    }

    /**
     * Set the targetSubscriptionId property: The subscription that owns the target server.
     * 
     * @param targetSubscriptionId the targetSubscriptionId value to set.
     * @return the CopyLongTermRetentionBackupParametersProperties object itself.
     */
    public CopyLongTermRetentionBackupParametersProperties withTargetSubscriptionId(String targetSubscriptionId) {
        this.targetSubscriptionId = targetSubscriptionId;
        return this;
    }

    /**
     * Get the targetResourceGroup property: The resource group that owns the target server.
     * 
     * @return the targetResourceGroup value.
     */
    public String targetResourceGroup() {
        return this.targetResourceGroup;
    }

    /**
     * Set the targetResourceGroup property: The resource group that owns the target server.
     * 
     * @param targetResourceGroup the targetResourceGroup value to set.
     * @return the CopyLongTermRetentionBackupParametersProperties object itself.
     */
    public CopyLongTermRetentionBackupParametersProperties withTargetResourceGroup(String targetResourceGroup) {
        this.targetResourceGroup = targetResourceGroup;
        return this;
    }

    /**
     * Get the targetServerResourceId property: The resource Id of the target server that owns the database.
     * 
     * @return the targetServerResourceId value.
     */
    public String targetServerResourceId() {
        return this.targetServerResourceId;
    }

    /**
     * Set the targetServerResourceId property: The resource Id of the target server that owns the database.
     * 
     * @param targetServerResourceId the targetServerResourceId value to set.
     * @return the CopyLongTermRetentionBackupParametersProperties object itself.
     */
    public CopyLongTermRetentionBackupParametersProperties withTargetServerResourceId(String targetServerResourceId) {
        this.targetServerResourceId = targetServerResourceId;
        return this;
    }

    /**
     * Get the targetServerFullyQualifiedDomainName property: The fully qualified domain name of the target server.
     * 
     * @return the targetServerFullyQualifiedDomainName value.
     */
    public String targetServerFullyQualifiedDomainName() {
        return this.targetServerFullyQualifiedDomainName;
    }

    /**
     * Set the targetServerFullyQualifiedDomainName property: The fully qualified domain name of the target server.
     * 
     * @param targetServerFullyQualifiedDomainName the targetServerFullyQualifiedDomainName value to set.
     * @return the CopyLongTermRetentionBackupParametersProperties object itself.
     */
    public CopyLongTermRetentionBackupParametersProperties
        withTargetServerFullyQualifiedDomainName(String targetServerFullyQualifiedDomainName) {
        this.targetServerFullyQualifiedDomainName = targetServerFullyQualifiedDomainName;
        return this;
    }

    /**
     * Get the targetDatabaseName property: The name of the database owns the copied backup.
     * 
     * @return the targetDatabaseName value.
     */
    public String targetDatabaseName() {
        return this.targetDatabaseName;
    }

    /**
     * Set the targetDatabaseName property: The name of the database owns the copied backup.
     * 
     * @param targetDatabaseName the targetDatabaseName value to set.
     * @return the CopyLongTermRetentionBackupParametersProperties object itself.
     */
    public CopyLongTermRetentionBackupParametersProperties withTargetDatabaseName(String targetDatabaseName) {
        this.targetDatabaseName = targetDatabaseName;
        return this;
    }

    /**
     * Get the targetBackupStorageRedundancy property: The storage redundancy type of the copied backup.
     * 
     * @return the targetBackupStorageRedundancy value.
     */
    public BackupStorageRedundancy targetBackupStorageRedundancy() {
        return this.targetBackupStorageRedundancy;
    }

    /**
     * Set the targetBackupStorageRedundancy property: The storage redundancy type of the copied backup.
     * 
     * @param targetBackupStorageRedundancy the targetBackupStorageRedundancy value to set.
     * @return the CopyLongTermRetentionBackupParametersProperties object itself.
     */
    public CopyLongTermRetentionBackupParametersProperties
        withTargetBackupStorageRedundancy(BackupStorageRedundancy targetBackupStorageRedundancy) {
        this.targetBackupStorageRedundancy = targetBackupStorageRedundancy;
        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("targetSubscriptionId", this.targetSubscriptionId);
        jsonWriter.writeStringField("targetResourceGroup", this.targetResourceGroup);
        jsonWriter.writeStringField("targetServerResourceId", this.targetServerResourceId);
        jsonWriter.writeStringField("targetServerFullyQualifiedDomainName", this.targetServerFullyQualifiedDomainName);
        jsonWriter.writeStringField("targetDatabaseName", this.targetDatabaseName);
        jsonWriter.writeStringField("targetBackupStorageRedundancy",
            this.targetBackupStorageRedundancy == null ? null : this.targetBackupStorageRedundancy.toString());
        return jsonWriter.writeEndObject();
    }

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

                if ("targetSubscriptionId".equals(fieldName)) {
                    deserializedCopyLongTermRetentionBackupParametersProperties.targetSubscriptionId
                        = reader.getString();
                } else if ("targetResourceGroup".equals(fieldName)) {
                    deserializedCopyLongTermRetentionBackupParametersProperties.targetResourceGroup
                        = reader.getString();
                } else if ("targetServerResourceId".equals(fieldName)) {
                    deserializedCopyLongTermRetentionBackupParametersProperties.targetServerResourceId
                        = reader.getString();
                } else if ("targetServerFullyQualifiedDomainName".equals(fieldName)) {
                    deserializedCopyLongTermRetentionBackupParametersProperties.targetServerFullyQualifiedDomainName
                        = reader.getString();
                } else if ("targetDatabaseName".equals(fieldName)) {
                    deserializedCopyLongTermRetentionBackupParametersProperties.targetDatabaseName = reader.getString();
                } else if ("targetBackupStorageRedundancy".equals(fieldName)) {
                    deserializedCopyLongTermRetentionBackupParametersProperties.targetBackupStorageRedundancy
                        = BackupStorageRedundancy.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedCopyLongTermRetentionBackupParametersProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy