// 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.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 resource properties. */
@Fluent
public final class GuestAgentProperties {
    /*
     * Gets or sets a unique identifier for this resource.
     */
    @JsonProperty(value = "uuid", access = JsonProperty.Access.WRITE_ONLY)
    private String uuid;

    /*
     * Username / Password Credentials to provision guest agent.
     */
    @JsonProperty(value = "credentials")
    private GuestCredential credentials;

    /*
     * HTTP Proxy configuration for the VM.
     */
    @JsonProperty(value = "httpProxyConfig")
    private HttpProxyConfiguration httpProxyConfig;

    /*
     * Gets or sets the guest agent provisioning action.
     */
    @JsonProperty(value = "provisioningAction")
    private ProvisioningAction provisioningAction;

    /*
     * Gets or sets the guest agent status.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private String status;

    /*
     * Gets the name of the corresponding resource in Kubernetes.
     */
    @JsonProperty(value = "customResourceName", access = JsonProperty.Access.WRITE_ONLY)
    private String customResourceName;

    /*
     * The resource status information.
     */
    @JsonProperty(value = "statuses", access = JsonProperty.Access.WRITE_ONLY)
    private List<ResourceStatus> statuses;

    /*
     * Gets or sets the provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

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

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

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

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

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

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

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

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

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

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

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

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