// 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.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Describes the Machine Extension Instance View. */
@Fluent
public class MachineExtensionInstanceView {
    /*
     * The machine extension name.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Specifies the type of the extension; an example is "CustomScriptExtension".
     */
    @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY)
    private String type;

    /*
     * Specifies the version of the script handler.
     */
    @JsonProperty(value = "typeHandlerVersion", access = JsonProperty.Access.WRITE_ONLY)
    private String typeHandlerVersion;

    /*
     * Instance view status.
     */
    @JsonProperty(value = "status")
    private MachineExtensionInstanceViewStatus status;

    /**
     * Get the name property: The machine extension name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the type property: Specifies the type of the extension; an example is "CustomScriptExtension".
     *
     * @return the type value.
     */
    public String type() {
        return this.type;
    }

    /**
     * Get the typeHandlerVersion property: Specifies the version of the script handler.
     *
     * @return the typeHandlerVersion value.
     */
    public String typeHandlerVersion() {
        return this.typeHandlerVersion;
    }

    /**
     * Get the status property: Instance view status.
     *
     * @return the status value.
     */
    public MachineExtensionInstanceViewStatus status() {
        return this.status;
    }

    /**
     * Set the status property: Instance view status.
     *
     * @param status the status value to set.
     * @return the MachineExtensionInstanceView object itself.
     */
    public MachineExtensionInstanceView withStatus(MachineExtensionInstanceViewStatus status) {
        this.status = status;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (status() != null) {
            status().validate();
        }
    }
}
