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

package com.azure.resourcemanager.labservices.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.labservices.models.EnableState;
import com.azure.resourcemanager.labservices.models.OsState;
import com.azure.resourcemanager.labservices.models.OsType;
import com.azure.resourcemanager.labservices.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Lab services virtual machine image. */
@Fluent
public final class ImageInner extends ProxyResource {
    /*
     * Metadata pertaining to creation and last modification of the image.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Image resource properties
     */
    @JsonProperty(value = "properties", required = true)
    private ImageProperties innerProperties = new ImageProperties();

    /**
     * Get the systemData property: Metadata pertaining to creation and last modification of the image.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the innerProperties property: Image resource properties.
     *
     * @return the innerProperties value.
     */
    private ImageProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Get the displayName property: The image display name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

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

    /**
     * Get the iconUrl property: URL of the image icon.
     *
     * @return the iconUrl value.
     */
    public String iconUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().iconUrl();
    }

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

    /**
     * Get the osType property: The OS Type of the image.
     *
     * @return the osType value.
     */
    public OsType osType() {
        return this.innerProperties() == null ? null : this.innerProperties().osType();
    }

    /**
     * Get the plan property: The ID of marketplace plan associated with the image (optional).
     *
     * @return the plan value.
     */
    public String plan() {
        return this.innerProperties() == null ? null : this.innerProperties().plan();
    }

    /**
     * Get the termsStatus property: The status of image terms of use (enabled = accepted, disabled = not accepted).
     *
     * @return the termsStatus value.
     */
    public EnableState termsStatus() {
        return this.innerProperties() == null ? null : this.innerProperties().termsStatus();
    }

    /**
     * Get the offer property: The ID of an offer associated with the image.
     *
     * @return the offer value.
     */
    public String offer() {
        return this.innerProperties() == null ? null : this.innerProperties().offer();
    }

    /**
     * Get the publisher property: The ID of the publisher of the image.
     *
     * @return the publisher value.
     */
    public String publisher() {
        return this.innerProperties() == null ? null : this.innerProperties().publisher();
    }

    /**
     * Get the sku property: The image SKU.
     *
     * @return the sku value.
     */
    public String sku() {
        return this.innerProperties() == null ? null : this.innerProperties().sku();
    }

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

    /**
     * Get the sharedGalleryId property: The ID for the image in the shared gallery.
     *
     * @return the sharedGalleryId value.
     */
    public String sharedGalleryId() {
        return this.innerProperties() == null ? null : this.innerProperties().sharedGalleryId();
    }

    /**
     * Get the availableRegions property: The available regions of the image in the shared gallery.
     *
     * @return the availableRegions value.
     */
    public List<String> availableRegions() {
        return this.innerProperties() == null ? null : this.innerProperties().availableRegions();
    }

    /**
     * Set the availableRegions property: The available regions of the image in the shared gallery.
     *
     * @param availableRegions the availableRegions value to set.
     * @return the ImageInner object itself.
     */
    public ImageInner withAvailableRegions(List<String> availableRegions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ImageProperties();
        }
        this.innerProperties().withAvailableRegions(availableRegions);
        return this;
    }

    /**
     * Get the osState property: The OS State of the image.
     *
     * @return the osState value.
     */
    public OsState osState() {
        return this.innerProperties() == null ? null : this.innerProperties().osState();
    }

    /**
     * Get the enabledState property: Is the image enabled.
     *
     * @return the enabledState value.
     */
    public EnableState enabledState() {
        return this.innerProperties() == null ? null : this.innerProperties().enabledState();
    }

    /**
     * Set the enabledState property: Is the image enabled.
     *
     * @param enabledState the enabledState value to set.
     * @return the ImageInner object itself.
     */
    public ImageInner withEnabledState(EnableState enabledState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ImageProperties();
        }
        this.innerProperties().withEnabledState(enabledState);
        return this;
    }

    /**
     * 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 ImageInner"));
        } else {
            innerProperties().validate();
        }
    }

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