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

package com.azure.resourcemanager.imagebuilder.models;

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

/** Uploads files required for validation to VMs (Linux, Windows). Corresponds to Packer file provisioner. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("File")
@Fluent
public final class ImageTemplateFileValidator extends ImageTemplateInVMValidator {
    /*
     * The URI of the file to be uploaded to the VM for validation. It can be a github link, Azure Storage URI
     * (authorized or SAS), etc
     */
    @JsonProperty(value = "sourceUri")
    private String sourceUri;

    /*
     * SHA256 checksum of the file provided in the sourceUri field above
     */
    @JsonProperty(value = "sha256Checksum")
    private String sha256Checksum;

    /*
     * The absolute path to a file (with nested directory structures already created) where the file (from sourceUri)
     * will be uploaded to in the VM
     */
    @JsonProperty(value = "destination")
    private String destination;

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

    /**
     * Get the sourceUri property: The URI of the file to be uploaded to the VM for validation. It can be a github link,
     * Azure Storage URI (authorized or SAS), etc.
     *
     * @return the sourceUri value.
     */
    public String sourceUri() {
        return this.sourceUri;
    }

    /**
     * Set the sourceUri property: The URI of the file to be uploaded to the VM for validation. It can be a github link,
     * Azure Storage URI (authorized or SAS), etc.
     *
     * @param sourceUri the sourceUri value to set.
     * @return the ImageTemplateFileValidator object itself.
     */
    public ImageTemplateFileValidator withSourceUri(String sourceUri) {
        this.sourceUri = sourceUri;
        return this;
    }

    /**
     * Get the sha256Checksum property: SHA256 checksum of the file provided in the sourceUri field above.
     *
     * @return the sha256Checksum value.
     */
    public String sha256Checksum() {
        return this.sha256Checksum;
    }

    /**
     * Set the sha256Checksum property: SHA256 checksum of the file provided in the sourceUri field above.
     *
     * @param sha256Checksum the sha256Checksum value to set.
     * @return the ImageTemplateFileValidator object itself.
     */
    public ImageTemplateFileValidator withSha256Checksum(String sha256Checksum) {
        this.sha256Checksum = sha256Checksum;
        return this;
    }

    /**
     * Get the destination property: The absolute path to a file (with nested directory structures already created)
     * where the file (from sourceUri) will be uploaded to in the VM.
     *
     * @return the destination value.
     */
    public String destination() {
        return this.destination;
    }

    /**
     * Set the destination property: The absolute path to a file (with nested directory structures already created)
     * where the file (from sourceUri) will be uploaded to in the VM.
     *
     * @param destination the destination value to set.
     * @return the ImageTemplateFileValidator object itself.
     */
    public ImageTemplateFileValidator withDestination(String destination) {
        this.destination = destination;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ImageTemplateFileValidator withName(String name) {
        super.withName(name);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}
