// 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;

/** Additional information for the MAB workload-specific job. */
@Fluent
public final class MabJobExtendedInfo {
    /*
     * List of tasks for this job.
     */
    @JsonProperty(value = "tasksList")
    private List<MabJobTaskDetails> tasksList;

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

    /*
     * Non localized error message specific to this job.
     */
    @JsonProperty(value = "dynamicErrorMessage")
    private String dynamicErrorMessage;

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

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

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

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

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

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

    /**
     * Set the dynamicErrorMessage property: Non localized error message specific to this job.
     *
     * @param dynamicErrorMessage the dynamicErrorMessage value to set.
     * @return the MabJobExtendedInfo object itself.
     */
    public MabJobExtendedInfo 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());
        }
    }
}
