// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datamigration.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Input for command that completes online migration for an Azure SQL Database Managed Instance. */
@Fluent
public final class MigrateMISyncCompleteCommandInput {
    /*
     * Name of managed instance database
     */
    @JsonProperty(value = "sourceDatabaseName", required = true)
    private String sourceDatabaseName;

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

    /**
     * Get the sourceDatabaseName property: Name of managed instance database.
     *
     * @return the sourceDatabaseName value.
     */
    public String sourceDatabaseName() {
        return this.sourceDatabaseName;
    }

    /**
     * Set the sourceDatabaseName property: Name of managed instance database.
     *
     * @param sourceDatabaseName the sourceDatabaseName value to set.
     * @return the MigrateMISyncCompleteCommandInput object itself.
     */
    public MigrateMISyncCompleteCommandInput withSourceDatabaseName(String sourceDatabaseName) {
        this.sourceDatabaseName = sourceDatabaseName;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (sourceDatabaseName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property sourceDatabaseName in model MigrateMISyncCompleteCommandInput"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(MigrateMISyncCompleteCommandInput.class);
}
