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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.automation.models.DscMetaConfiguration;
import com.azure.resourcemanager.automation.models.DscReportError;
import com.azure.resourcemanager.automation.models.DscReportResource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Definition of the dsc node report type. */
@Fluent
public final class DscNodeReportInner {
    /*
     * Gets or sets the end time of the node report.
     */
    @JsonProperty(value = "endTime")
    private OffsetDateTime endTime;

    /*
     * Gets or sets the lastModifiedTime of the node report.
     */
    @JsonProperty(value = "lastModifiedTime")
    private OffsetDateTime lastModifiedTime;

    /*
     * Gets or sets the start time of the node report.
     */
    @JsonProperty(value = "startTime")
    private OffsetDateTime startTime;

    /*
     * Gets or sets the type of the node report.
     */
    @JsonProperty(value = "type")
    private String type;

    /*
     * Gets or sets the id of the node report.
     */
    @JsonProperty(value = "reportId")
    private String reportId;

    /*
     * Gets or sets the status of the node report.
     */
    @JsonProperty(value = "status")
    private String status;

    /*
     * Gets or sets the refreshMode of the node report.
     */
    @JsonProperty(value = "refreshMode")
    private String refreshMode;

    /*
     * Gets or sets the rebootRequested of the node report.
     */
    @JsonProperty(value = "rebootRequested")
    private String rebootRequested;

    /*
     * Gets or sets the reportFormatVersion of the node report.
     */
    @JsonProperty(value = "reportFormatVersion")
    private String reportFormatVersion;

    /*
     * Gets or sets the configurationVersion of the node report.
     */
    @JsonProperty(value = "configurationVersion")
    private String configurationVersion;

    /*
     * Gets or sets the id.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Gets or sets the errors for the node report.
     */
    @JsonProperty(value = "errors")
    private List<DscReportError> errors;

    /*
     * Gets or sets the resource for the node report.
     */
    @JsonProperty(value = "resources")
    private List<DscReportResource> resources;

    /*
     * Gets or sets the metaConfiguration of the node at the time of the report.
     */
    @JsonProperty(value = "metaConfiguration")
    private DscMetaConfiguration metaConfiguration;

    /*
     * Gets or sets the hostname of the node that sent the report.
     */
    @JsonProperty(value = "hostName")
    private String hostname;

    /*
     * Gets or sets the IPv4 address of the node that sent the report.
     */
    @JsonProperty(value = "iPV4Addresses")
    private List<String> iPV4Addresses;

    /*
     * Gets or sets the IPv6 address of the node that sent the report.
     */
    @JsonProperty(value = "iPV6Addresses")
    private List<String> iPV6Addresses;

    /*
     * Gets or sets the number of resource in the node report.
     */
    @JsonProperty(value = "numberOfResources")
    private Integer numberOfResources;

    /*
     * Gets or sets the unparsed errors for the node report.
     */
    @JsonProperty(value = "rawErrors")
    private String rawErrors;

    /**
     * Get the endTime property: Gets or sets the end time of the node report.
     *
     * @return the endTime value.
     */
    public OffsetDateTime endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: Gets or sets the end time of the node report.
     *
     * @param endTime the endTime value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withEndTime(OffsetDateTime endTime) {
        this.endTime = endTime;
        return this;
    }

    /**
     * Get the lastModifiedTime property: Gets or sets the lastModifiedTime of the node report.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * Set the lastModifiedTime property: Gets or sets the lastModifiedTime of the node report.
     *
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        this.lastModifiedTime = lastModifiedTime;
        return this;
    }

    /**
     * Get the startTime property: Gets or sets the start time of the node report.
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: Gets or sets the start time of the node report.
     *
     * @param startTime the startTime value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withStartTime(OffsetDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the type property: Gets or sets the type of the node report.
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Set the type property: Gets or sets the type of the node report.
     *
     * @param type the type value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withType(String type) {
        this.type = type;
        return this;
    }

    /**
     * Get the reportId property: Gets or sets the id of the node report.
     *
     * @return the reportId value.
     */
    public String reportId() {
        return this.reportId;
    }

    /**
     * Set the reportId property: Gets or sets the id of the node report.
     *
     * @param reportId the reportId value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withReportId(String reportId) {
        this.reportId = reportId;
        return this;
    }

    /**
     * Get the status property: Gets or sets the status of the node report.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Set the status property: Gets or sets the status of the node report.
     *
     * @param status the status value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withStatus(String status) {
        this.status = status;
        return this;
    }

    /**
     * Get the refreshMode property: Gets or sets the refreshMode of the node report.
     *
     * @return the refreshMode value.
     */
    public String refreshMode() {
        return this.refreshMode;
    }

    /**
     * Set the refreshMode property: Gets or sets the refreshMode of the node report.
     *
     * @param refreshMode the refreshMode value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withRefreshMode(String refreshMode) {
        this.refreshMode = refreshMode;
        return this;
    }

    /**
     * Get the rebootRequested property: Gets or sets the rebootRequested of the node report.
     *
     * @return the rebootRequested value.
     */
    public String rebootRequested() {
        return this.rebootRequested;
    }

    /**
     * Set the rebootRequested property: Gets or sets the rebootRequested of the node report.
     *
     * @param rebootRequested the rebootRequested value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withRebootRequested(String rebootRequested) {
        this.rebootRequested = rebootRequested;
        return this;
    }

    /**
     * Get the reportFormatVersion property: Gets or sets the reportFormatVersion of the node report.
     *
     * @return the reportFormatVersion value.
     */
    public String reportFormatVersion() {
        return this.reportFormatVersion;
    }

    /**
     * Set the reportFormatVersion property: Gets or sets the reportFormatVersion of the node report.
     *
     * @param reportFormatVersion the reportFormatVersion value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withReportFormatVersion(String reportFormatVersion) {
        this.reportFormatVersion = reportFormatVersion;
        return this;
    }

    /**
     * Get the configurationVersion property: Gets or sets the configurationVersion of the node report.
     *
     * @return the configurationVersion value.
     */
    public String configurationVersion() {
        return this.configurationVersion;
    }

    /**
     * Set the configurationVersion property: Gets or sets the configurationVersion of the node report.
     *
     * @param configurationVersion the configurationVersion value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withConfigurationVersion(String configurationVersion) {
        this.configurationVersion = configurationVersion;
        return this;
    }

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

    /**
     * Set the id property: Gets or sets the id.
     *
     * @param id the id value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the errors property: Gets or sets the errors for the node report.
     *
     * @return the errors value.
     */
    public List<DscReportError> errors() {
        return this.errors;
    }

    /**
     * Set the errors property: Gets or sets the errors for the node report.
     *
     * @param errors the errors value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withErrors(List<DscReportError> errors) {
        this.errors = errors;
        return this;
    }

    /**
     * Get the resources property: Gets or sets the resource for the node report.
     *
     * @return the resources value.
     */
    public List<DscReportResource> resources() {
        return this.resources;
    }

    /**
     * Set the resources property: Gets or sets the resource for the node report.
     *
     * @param resources the resources value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withResources(List<DscReportResource> resources) {
        this.resources = resources;
        return this;
    }

    /**
     * Get the metaConfiguration property: Gets or sets the metaConfiguration of the node at the time of the report.
     *
     * @return the metaConfiguration value.
     */
    public DscMetaConfiguration metaConfiguration() {
        return this.metaConfiguration;
    }

    /**
     * Set the metaConfiguration property: Gets or sets the metaConfiguration of the node at the time of the report.
     *
     * @param metaConfiguration the metaConfiguration value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withMetaConfiguration(DscMetaConfiguration metaConfiguration) {
        this.metaConfiguration = metaConfiguration;
        return this;
    }

    /**
     * Get the hostname property: Gets or sets the hostname of the node that sent the report.
     *
     * @return the hostname value.
     */
    public String hostname() {
        return this.hostname;
    }

    /**
     * Set the hostname property: Gets or sets the hostname of the node that sent the report.
     *
     * @param hostname the hostname value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withHostname(String hostname) {
        this.hostname = hostname;
        return this;
    }

    /**
     * Get the iPV4Addresses property: Gets or sets the IPv4 address of the node that sent the report.
     *
     * @return the iPV4Addresses value.
     */
    public List<String> iPV4Addresses() {
        return this.iPV4Addresses;
    }

    /**
     * Set the iPV4Addresses property: Gets or sets the IPv4 address of the node that sent the report.
     *
     * @param iPV4Addresses the iPV4Addresses value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withIPV4Addresses(List<String> iPV4Addresses) {
        this.iPV4Addresses = iPV4Addresses;
        return this;
    }

    /**
     * Get the iPV6Addresses property: Gets or sets the IPv6 address of the node that sent the report.
     *
     * @return the iPV6Addresses value.
     */
    public List<String> iPV6Addresses() {
        return this.iPV6Addresses;
    }

    /**
     * Set the iPV6Addresses property: Gets or sets the IPv6 address of the node that sent the report.
     *
     * @param iPV6Addresses the iPV6Addresses value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withIPV6Addresses(List<String> iPV6Addresses) {
        this.iPV6Addresses = iPV6Addresses;
        return this;
    }

    /**
     * Get the numberOfResources property: Gets or sets the number of resource in the node report.
     *
     * @return the numberOfResources value.
     */
    public Integer numberOfResources() {
        return this.numberOfResources;
    }

    /**
     * Set the numberOfResources property: Gets or sets the number of resource in the node report.
     *
     * @param numberOfResources the numberOfResources value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withNumberOfResources(Integer numberOfResources) {
        this.numberOfResources = numberOfResources;
        return this;
    }

    /**
     * Get the rawErrors property: Gets or sets the unparsed errors for the node report.
     *
     * @return the rawErrors value.
     */
    public String rawErrors() {
        return this.rawErrors;
    }

    /**
     * Set the rawErrors property: Gets or sets the unparsed errors for the node report.
     *
     * @param rawErrors the rawErrors value to set.
     * @return the DscNodeReportInner object itself.
     */
    public DscNodeReportInner withRawErrors(String rawErrors) {
        this.rawErrors = rawErrors;
        return this;
    }

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