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

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** Azure IaaS VM workload-specific additional information for job. */
@Fluent
public final class AzureIaaSvmJobExtendedInfo {
    /*
     * List of tasks associated with this job.
     */
    @JsonProperty(value = "tasksList")
    private List<AzureIaaSvmJobTaskDetails> tasksList;

    /*
     * Job properties.
     */
    @JsonProperty(value = "propertyBag")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> propertyBag;

    /*
     * Job internal properties.
     */
    @JsonProperty(value = "internalPropertyBag")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> internalPropertyBag;

    /*
     * Indicates progress of the job. Null if it has not started or completed.
     */
    @JsonProperty(value = "progressPercentage")
    private Double progressPercentage;

    /*
     * Time remaining for execution of this job.
     */
    @JsonProperty(value = "estimatedRemainingDuration")
    private String estimatedRemainingDuration;

    /*
     * Non localized error message on job execution.
     */
    @JsonProperty(value = "dynamicErrorMessage")
    private String dynamicErrorMessage;

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

    /**
     * Get the tasksList property: List of tasks associated with this job.
     *
     * @return the tasksList value.
     */
    public List<AzureIaaSvmJobTaskDetails> tasksList() {
        return this.tasksList;
    }

    /**
     * Set the tasksList property: List of tasks associated with this job.
     *
     * @param tasksList the tasksList value to set.
     * @return the AzureIaaSvmJobExtendedInfo object itself.
     */
    public AzureIaaSvmJobExtendedInfo withTasksList(List<AzureIaaSvmJobTaskDetails> tasksList) {
        this.tasksList = tasksList;
        return this;
    }

    /**
     * Get the propertyBag property: Job properties.
     *
     * @return the propertyBag value.
     */
    public Map<String, String> propertyBag() {
        return this.propertyBag;
    }

    /**
     * Set the propertyBag property: Job properties.
     *
     * @param propertyBag the propertyBag value to set.
     * @return the AzureIaaSvmJobExtendedInfo object itself.
     */
    public AzureIaaSvmJobExtendedInfo withPropertyBag(Map<String, String> propertyBag) {
        this.propertyBag = propertyBag;
        return this;
    }

    /**
     * Get the internalPropertyBag property: Job internal properties.
     *
     * @return the internalPropertyBag value.
     */
    public Map<String, String> internalPropertyBag() {
        return this.internalPropertyBag;
    }

    /**
     * Set the internalPropertyBag property: Job internal properties.
     *
     * @param internalPropertyBag the internalPropertyBag value to set.
     * @return the AzureIaaSvmJobExtendedInfo object itself.
     */
    public AzureIaaSvmJobExtendedInfo withInternalPropertyBag(Map<String, String> internalPropertyBag) {
        this.internalPropertyBag = internalPropertyBag;
        return this;
    }

    /**
     * Get the progressPercentage property: Indicates progress of the job. Null if it has not started or completed.
     *
     * @return the progressPercentage value.
     */
    public Double progressPercentage() {
        return this.progressPercentage;
    }

    /**
     * Set the progressPercentage property: Indicates progress of the job. Null if it has not started or completed.
     *
     * @param progressPercentage the progressPercentage value to set.
     * @return the AzureIaaSvmJobExtendedInfo object itself.
     */
    public AzureIaaSvmJobExtendedInfo withProgressPercentage(Double progressPercentage) {
        this.progressPercentage = progressPercentage;
        return this;
    }

    /**
     * Get the estimatedRemainingDuration property: Time remaining for execution of this job.
     *
     * @return the estimatedRemainingDuration value.
     */
    public String estimatedRemainingDuration() {
        return this.estimatedRemainingDuration;
    }

    /**
     * Set the estimatedRemainingDuration property: Time remaining for execution of this job.
     *
     * @param estimatedRemainingDuration the estimatedRemainingDuration value to set.
     * @return the AzureIaaSvmJobExtendedInfo object itself.
     */
    public AzureIaaSvmJobExtendedInfo withEstimatedRemainingDuration(String estimatedRemainingDuration) {
        this.estimatedRemainingDuration = estimatedRemainingDuration;
        return this;
    }

    /**
     * Get the dynamicErrorMessage property: Non localized error message on job execution.
     *
     * @return the dynamicErrorMessage value.
     */
    public String dynamicErrorMessage() {
        return this.dynamicErrorMessage;
    }

    /**
     * Set the dynamicErrorMessage property: Non localized error message on job execution.
     *
     * @param dynamicErrorMessage the dynamicErrorMessage value to set.
     * @return the AzureIaaSvmJobExtendedInfo object itself.
     */
    public AzureIaaSvmJobExtendedInfo withDynamicErrorMessage(String dynamicErrorMessage) {
        this.dynamicErrorMessage = dynamicErrorMessage;
        return this;
    }

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