// 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.management.ProxyResource;
import com.azure.core.management.SystemData;
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 Agent resource. */
@Fluent
public final class AgentInner extends ProxyResource {
    /*
     * The properties property.
     */
    @JsonProperty(value = "properties", required = true)
    private AgentProperties innerProperties = new AgentProperties();

    /*
     * Resource system metadata.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: The properties property.
     *
     * @return the innerProperties value.
     */
    private AgentProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Resource system metadata.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

    /**
     * Get the agentVersion property: The Agent version.
     *
     * @return the agentVersion value.
     */
    public String agentVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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 AgentInner object itself.
     */
    public AgentInner withArcResourceId(String arcResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AgentProperties();
        }
        this.innerProperties().withArcResourceId(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.innerProperties() == null ? null : this.innerProperties().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 AgentInner object itself.
     */
    public AgentInner withArcVmUuid(String arcVmUuid) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AgentProperties();
        }
        this.innerProperties().withArcVmUuid(arcVmUuid);
        return this;
    }

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

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

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

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

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

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

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

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

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

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