// 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.fasterxml.jackson.annotation.JsonProperty;

/** Defines the dependency of the move resource. */
@Fluent
public final class MoveResourceDependency {
    /*
     * Gets the source ARM ID of the dependent resource.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Gets the dependency resolution status.
     */
    @JsonProperty(value = "resolutionStatus")
    private String resolutionStatus;

    /*
     * Defines the resolution type.
     */
    @JsonProperty(value = "resolutionType")
    private ResolutionType resolutionType;

    /*
     * Defines the dependency type.
     */
    @JsonProperty(value = "dependencyType")
    private DependencyType dependencyType;

    /*
     * Defines the properties for manual resolution.
     */
    @JsonProperty(value = "manualResolution")
    private ManualResolutionProperties manualResolution;

    /*
     * Defines the properties for automatic resolution.
     */
    @JsonProperty(value = "automaticResolution")
    private AutomaticResolutionProperties automaticResolution;

    /*
     * Gets or sets a value indicating whether the dependency is optional.
     */
    @JsonProperty(value = "isOptional")
    private String isOptional;

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

    /**
     * Get the id property: Gets the source ARM ID of the dependent resource.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Gets the source ARM ID of the dependent resource.
     *
     * @param id the id value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the resolutionStatus property: Gets the dependency resolution status.
     *
     * @return the resolutionStatus value.
     */
    public String resolutionStatus() {
        return this.resolutionStatus;
    }

    /**
     * Set the resolutionStatus property: Gets the dependency resolution status.
     *
     * @param resolutionStatus the resolutionStatus value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withResolutionStatus(String resolutionStatus) {
        this.resolutionStatus = resolutionStatus;
        return this;
    }

    /**
     * Get the resolutionType property: Defines the resolution type.
     *
     * @return the resolutionType value.
     */
    public ResolutionType resolutionType() {
        return this.resolutionType;
    }

    /**
     * Set the resolutionType property: Defines the resolution type.
     *
     * @param resolutionType the resolutionType value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withResolutionType(ResolutionType resolutionType) {
        this.resolutionType = resolutionType;
        return this;
    }

    /**
     * Get the dependencyType property: Defines the dependency type.
     *
     * @return the dependencyType value.
     */
    public DependencyType dependencyType() {
        return this.dependencyType;
    }

    /**
     * Set the dependencyType property: Defines the dependency type.
     *
     * @param dependencyType the dependencyType value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withDependencyType(DependencyType dependencyType) {
        this.dependencyType = dependencyType;
        return this;
    }

    /**
     * Get the manualResolution property: Defines the properties for manual resolution.
     *
     * @return the manualResolution value.
     */
    public ManualResolutionProperties manualResolution() {
        return this.manualResolution;
    }

    /**
     * Set the manualResolution property: Defines the properties for manual resolution.
     *
     * @param manualResolution the manualResolution value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withManualResolution(ManualResolutionProperties manualResolution) {
        this.manualResolution = manualResolution;
        return this;
    }

    /**
     * Get the automaticResolution property: Defines the properties for automatic resolution.
     *
     * @return the automaticResolution value.
     */
    public AutomaticResolutionProperties automaticResolution() {
        return this.automaticResolution;
    }

    /**
     * Set the automaticResolution property: Defines the properties for automatic resolution.
     *
     * @param automaticResolution the automaticResolution value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withAutomaticResolution(AutomaticResolutionProperties automaticResolution) {
        this.automaticResolution = automaticResolution;
        return this;
    }

    /**
     * Get the isOptional property: Gets or sets a value indicating whether the dependency is optional.
     *
     * @return the isOptional value.
     */
    public String isOptional() {
        return this.isOptional;
    }

    /**
     * Set the isOptional property: Gets or sets a value indicating whether the dependency is optional.
     *
     * @param isOptional the isOptional value to set.
     * @return the MoveResourceDependency object itself.
     */
    public MoveResourceDependency withIsOptional(String isOptional) {
        this.isOptional = isOptional;
        return this;
    }

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