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

package com.azure.resourcemanager.connectedvmware.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.connectedvmware.models.GuestCredential;
import com.azure.resourcemanager.connectedvmware.models.HttpProxyConfiguration;
import com.azure.resourcemanager.connectedvmware.models.ProvisioningAction;
import com.azure.resourcemanager.connectedvmware.models.ResourceStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Defines the GuestAgent. */
@Fluent
public final class GuestAgentInner extends ProxyResource {
    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties", required = true)
    private GuestAgentProperties innerProperties = new GuestAgentProperties();

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

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

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

    /**
     * Get the uuid property: Gets or sets a unique identifier for this resource.
     *
     * @return the uuid value.
     */
    public String uuid() {
        return this.innerProperties() == null ? null : this.innerProperties().uuid();
    }

    /**
     * Get the credentials property: Username / Password Credentials to provision guest agent.
     *
     * @return the credentials value.
     */
    public GuestCredential credentials() {
        return this.innerProperties() == null ? null : this.innerProperties().credentials();
    }

    /**
     * Set the credentials property: Username / Password Credentials to provision guest agent.
     *
     * @param credentials the credentials value to set.
     * @return the GuestAgentInner object itself.
     */
    public GuestAgentInner withCredentials(GuestCredential credentials) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GuestAgentProperties();
        }
        this.innerProperties().withCredentials(credentials);
        return this;
    }

    /**
     * Get the httpProxyConfig property: HTTP Proxy configuration for the VM.
     *
     * @return the httpProxyConfig value.
     */
    public HttpProxyConfiguration httpProxyConfig() {
        return this.innerProperties() == null ? null : this.innerProperties().httpProxyConfig();
    }

    /**
     * Set the httpProxyConfig property: HTTP Proxy configuration for the VM.
     *
     * @param httpProxyConfig the httpProxyConfig value to set.
     * @return the GuestAgentInner object itself.
     */
    public GuestAgentInner withHttpProxyConfig(HttpProxyConfiguration httpProxyConfig) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GuestAgentProperties();
        }
        this.innerProperties().withHttpProxyConfig(httpProxyConfig);
        return this;
    }

    /**
     * Get the provisioningAction property: Gets or sets the guest agent provisioning action.
     *
     * @return the provisioningAction value.
     */
    public ProvisioningAction provisioningAction() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningAction();
    }

    /**
     * Set the provisioningAction property: Gets or sets the guest agent provisioning action.
     *
     * @param provisioningAction the provisioningAction value to set.
     * @return the GuestAgentInner object itself.
     */
    public GuestAgentInner withProvisioningAction(ProvisioningAction provisioningAction) {
        if (this.innerProperties() == null) {
            this.innerProperties = new GuestAgentProperties();
        }
        this.innerProperties().withProvisioningAction(provisioningAction);
        return this;
    }

    /**
     * Get the status property: Gets or sets the guest agent status.
     *
     * @return the status value.
     */
    public String status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Get the customResourceName property: Gets the name of the corresponding resource in Kubernetes.
     *
     * @return the customResourceName value.
     */
    public String customResourceName() {
        return this.innerProperties() == null ? null : this.innerProperties().customResourceName();
    }

    /**
     * Get the statuses property: The resource status information.
     *
     * @return the statuses value.
     */
    public List<ResourceStatus> statuses() {
        return this.innerProperties() == null ? null : this.innerProperties().statuses();
    }

    /**
     * Get the provisioningState property: Gets or sets the provisioning state.
     *
     * @return the provisioningState value.
     */
    public String 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 GuestAgentInner"));
        } else {
            innerProperties().validate();
        }
    }

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