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

package com.azure.resourcemanager.postgresqlflexibleserver.models;

import com.azure.core.annotation.Immutable;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Migration status. */
@Immutable
public final class MigrationStatus {
    /*
     * State of migration
     */
    @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY)
    private MigrationState state;

    /*
     * Error message, if any, for the migration state
     */
    @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY)
    private String error;

    /*
     * Current Migration sub state details.
     */
    @JsonProperty(value = "currentSubStateDetails", access = JsonProperty.Access.WRITE_ONLY)
    private MigrationSubStateDetails currentSubStateDetails;

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

    /**
     * Get the state property: State of migration.
     *
     * @return the state value.
     */
    public MigrationState state() {
        return this.state;
    }

    /**
     * Get the error property: Error message, if any, for the migration state.
     *
     * @return the error value.
     */
    public String error() {
        return this.error;
    }

    /**
     * Get the currentSubStateDetails property: Current Migration sub state details.
     *
     * @return the currentSubStateDetails value.
     */
    public MigrationSubStateDetails currentSubStateDetails() {
        return this.currentSubStateDetails;
    }

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