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

package com.azure.resourcemanager.resourcemover.models;

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

/** Defines the move collection properties. */
@Fluent
public final class MoveCollectionProperties {
    /*
     * Gets or sets the source region.
     */
    @JsonProperty(value = "sourceRegion", required = true)
    private String sourceRegion;

    /*
     * Gets or sets the target region.
     */
    @JsonProperty(value = "targetRegion", required = true)
    private String targetRegion;

    /*
     * Defines the provisioning states.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Defines the move collection errors.
     */
    @JsonProperty(value = "errors", access = JsonProperty.Access.WRITE_ONLY)
    private MoveCollectionPropertiesErrors errors;

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

    /**
     * Get the sourceRegion property: Gets or sets the source region.
     *
     * @return the sourceRegion value.
     */
    public String sourceRegion() {
        return this.sourceRegion;
    }

    /**
     * Set the sourceRegion property: Gets or sets the source region.
     *
     * @param sourceRegion the sourceRegion value to set.
     * @return the MoveCollectionProperties object itself.
     */
    public MoveCollectionProperties withSourceRegion(String sourceRegion) {
        this.sourceRegion = sourceRegion;
        return this;
    }

    /**
     * Get the targetRegion property: Gets or sets the target region.
     *
     * @return the targetRegion value.
     */
    public String targetRegion() {
        return this.targetRegion;
    }

    /**
     * Set the targetRegion property: Gets or sets the target region.
     *
     * @param targetRegion the targetRegion value to set.
     * @return the MoveCollectionProperties object itself.
     */
    public MoveCollectionProperties withTargetRegion(String targetRegion) {
        this.targetRegion = targetRegion;
        return this;
    }

    /**
     * Get the provisioningState property: Defines the provisioning states.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the errors property: Defines the move collection errors.
     *
     * @return the errors value.
     */
    public MoveCollectionPropertiesErrors errors() {
        return this.errors;
    }

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

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