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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.storagemover.models.AgentPropertiesErrorDetails;
import com.azure.resourcemanager.storagemover.models.AgentStatus;
import com.azure.resourcemanager.storagemover.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** The AgentProperties model. */
@Fluent
public final class AgentProperties {
    /*
     * A description for the Agent.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * The Agent version.
     */
    @JsonProperty(value = "agentVersion", access = JsonProperty.Access.WRITE_ONLY)
    private String agentVersion;

    /*
     * The fully qualified resource ID of the Hybrid Compute resource for the Agent.
     */
    @JsonProperty(value = "arcResourceId", required = true)
    private String arcResourceId;

    /*
     * The VM UUID of the Hybrid Compute resource for the Agent.
     */
    @JsonProperty(value = "arcVmUuid", required = true)
    private String arcVmUuid;

    /*
     * The Agent status.
     */
    @JsonProperty(value = "agentStatus", access = JsonProperty.Access.WRITE_ONLY)
    private AgentStatus agentStatus;

    /*
     * The last updated time of the Agent status.
     */
    @JsonProperty(value = "lastStatusUpdate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastStatusUpdate;

    /*
     * Local IP address reported by the Agent.
     */
    @JsonProperty(value = "localIPAddress", access = JsonProperty.Access.WRITE_ONLY)
    private String localIpAddress;

    /*
     * Available memory reported by the Agent, in MB.
     */
    @JsonProperty(value = "memoryInMB", access = JsonProperty.Access.WRITE_ONLY)
    private Long memoryInMB;

    /*
     * Available compute cores reported by the Agent.
     */
    @JsonProperty(value = "numberOfCores", access = JsonProperty.Access.WRITE_ONLY)
    private Long numberOfCores;

    /*
     * Uptime of the Agent in seconds.
     */
    @JsonProperty(value = "uptimeInSeconds", access = JsonProperty.Access.WRITE_ONLY)
    private Long uptimeInSeconds;

    /*
     * The errorDetails property.
     */
    @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY)
    private AgentPropertiesErrorDetails errorDetails;

    /*
     * The provisioning state of this resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

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

    /**
     * Get the description property: A description for the Agent.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: A description for the Agent.
     *
     * @param description the description value to set.
     * @return the AgentProperties object itself.
     */
    public AgentProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the agentVersion property: The Agent version.
     *
     * @return the agentVersion value.
     */
    public String agentVersion() {
        return this.agentVersion;
    }

    /**
     * Get the arcResourceId property: The fully qualified resource ID of the Hybrid Compute resource for the Agent.
     *
     * @return the arcResourceId value.
     */
    public String arcResourceId() {
        return this.arcResourceId;
    }

    /**
     * Set the arcResourceId property: The fully qualified resource ID of the Hybrid Compute resource for the Agent.
     *
     * @param arcResourceId the arcResourceId value to set.
     * @return the AgentProperties object itself.
     */
    public AgentProperties withArcResourceId(String arcResourceId) {
        this.arcResourceId = arcResourceId;
        return this;
    }

    /**
     * Get the arcVmUuid property: The VM UUID of the Hybrid Compute resource for the Agent.
     *
     * @return the arcVmUuid value.
     */
    public String arcVmUuid() {
        return this.arcVmUuid;
    }

    /**
     * Set the arcVmUuid property: The VM UUID of the Hybrid Compute resource for the Agent.
     *
     * @param arcVmUuid the arcVmUuid value to set.
     * @return the AgentProperties object itself.
     */
    public AgentProperties withArcVmUuid(String arcVmUuid) {
        this.arcVmUuid = arcVmUuid;
        return this;
    }

    /**
     * Get the agentStatus property: The Agent status.
     *
     * @return the agentStatus value.
     */
    public AgentStatus agentStatus() {
        return this.agentStatus;
    }

    /**
     * Get the lastStatusUpdate property: The last updated time of the Agent status.
     *
     * @return the lastStatusUpdate value.
     */
    public OffsetDateTime lastStatusUpdate() {
        return this.lastStatusUpdate;
    }

    /**
     * Get the localIpAddress property: Local IP address reported by the Agent.
     *
     * @return the localIpAddress value.
     */
    public String localIpAddress() {
        return this.localIpAddress;
    }

    /**
     * Get the memoryInMB property: Available memory reported by the Agent, in MB.
     *
     * @return the memoryInMB value.
     */
    public Long memoryInMB() {
        return this.memoryInMB;
    }

    /**
     * Get the numberOfCores property: Available compute cores reported by the Agent.
     *
     * @return the numberOfCores value.
     */
    public Long numberOfCores() {
        return this.numberOfCores;
    }

    /**
     * Get the uptimeInSeconds property: Uptime of the Agent in seconds.
     *
     * @return the uptimeInSeconds value.
     */
    public Long uptimeInSeconds() {
        return this.uptimeInSeconds;
    }

    /**
     * Get the errorDetails property: The errorDetails property.
     *
     * @return the errorDetails value.
     */
    public AgentPropertiesErrorDetails errorDetails() {
        return this.errorDetails;
    }

    /**
     * Get the provisioningState property: The provisioning state of this resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (arcResourceId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property arcResourceId in model AgentProperties"));
        }
        if (arcVmUuid() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property arcVmUuid in model AgentProperties"));
        }
        if (errorDetails() != null) {
            errorDetails().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(AgentProperties.class);
}
