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

package com.azure.resourcemanager.automanage.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
import com.azure.resourcemanager.automanage.models.ReportResource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Data related to the report detail. */
@Fluent
public final class AssignmentReportProperties {
    /*
     * Start time of the configuration profile assignment processing.
     */
    @JsonProperty(value = "startTime")
    private String startTime;

    /*
     * End time of the configuration profile assignment processing.
     */
    @JsonProperty(value = "endTime")
    private String endTime;

    /*
     * Last modified time of the configuration profile assignment processing.
     */
    @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY)
    private String lastModifiedTime;

    /*
     * Duration of the configuration profile assignment processing.
     */
    @JsonProperty(value = "duration", access = JsonProperty.Access.WRITE_ONLY)
    private String duration;

    /*
     * Type of the configuration profile assignment processing (Initial/Consistency).
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /*
     * The status of the configuration profile assignment.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private String status;

    /*
     * The configurationProfile linked to the assignment.
     */
    @JsonProperty(value = "configurationProfile", access = JsonProperty.Access.WRITE_ONLY)
    private String configurationProfile;

    /*
     * List of resources processed by the configuration profile assignment.
     */
    @JsonProperty(value = "resources", access = JsonProperty.Access.WRITE_ONLY)
    private List<ReportResource> resources;

    /*
     * Error message, if any, returned by the configuration profile assignment processing.
     */
    @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY)
    private ManagementError error;

    /*
     * Version of the report format
     */
    @JsonProperty(value = "reportFormatVersion", access = JsonProperty.Access.WRITE_ONLY)
    private String reportFormatVersion;

    /**
     * Get the startTime property: Start time of the configuration profile assignment processing.
     *
     * @return the startTime value.
     */
    public String startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: Start time of the configuration profile assignment processing.
     *
     * @param startTime the startTime value to set.
     * @return the AssignmentReportProperties object itself.
     */
    public AssignmentReportProperties withStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the endTime property: End time of the configuration profile assignment processing.
     *
     * @return the endTime value.
     */
    public String endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: End time of the configuration profile assignment processing.
     *
     * @param endTime the endTime value to set.
     * @return the AssignmentReportProperties object itself.
     */
    public AssignmentReportProperties withEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }

    /**
     * Get the lastModifiedTime property: Last modified time of the configuration profile assignment processing.
     *
     * @return the lastModifiedTime value.
     */
    public String lastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * Get the duration property: Duration of the configuration profile assignment processing.
     *
     * @return the duration value.
     */
    public String duration() {
        return this.duration;
    }

    /**
     * Get the type property: Type of the configuration profile assignment processing (Initial/Consistency).
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the status property: The status of the configuration profile assignment.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Get the configurationProfile property: The configurationProfile linked to the assignment.
     *
     * @return the configurationProfile value.
     */
    public String configurationProfile() {
        return this.configurationProfile;
    }

    /**
     * Get the resources property: List of resources processed by the configuration profile assignment.
     *
     * @return the resources value.
     */
    public List<ReportResource> resources() {
        return this.resources;
    }

    /**
     * Get the error property: Error message, if any, returned by the configuration profile assignment processing.
     *
     * @return the error value.
     */
    public ManagementError error() {
        return this.error;
    }

    /**
     * Get the reportFormatVersion property: Version of the report format.
     *
     * @return the reportFormatVersion value.
     */
    public String reportFormatVersion() {
        return this.reportFormatVersion;
    }

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