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

package com.azure.resourcemanager.automation.models;

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

/** Definition of the content link. */
@Fluent
public final class ContentLink {
    /*
     * Gets or sets the uri of the runbook content.
     */
    @JsonProperty(value = "uri")
    private String uri;

    /*
     * Gets or sets the hash.
     */
    @JsonProperty(value = "contentHash")
    private ContentHash contentHash;

    /*
     * Gets or sets the version of the content.
     */
    @JsonProperty(value = "version")
    private String version;

    /**
     * Get the uri property: Gets or sets the uri of the runbook content.
     *
     * @return the uri value.
     */
    public String uri() {
        return this.uri;
    }

    /**
     * Set the uri property: Gets or sets the uri of the runbook content.
     *
     * @param uri the uri value to set.
     * @return the ContentLink object itself.
     */
    public ContentLink withUri(String uri) {
        this.uri = uri;
        return this;
    }

    /**
     * Get the contentHash property: Gets or sets the hash.
     *
     * @return the contentHash value.
     */
    public ContentHash contentHash() {
        return this.contentHash;
    }

    /**
     * Set the contentHash property: Gets or sets the hash.
     *
     * @param contentHash the contentHash value to set.
     * @return the ContentLink object itself.
     */
    public ContentLink withContentHash(ContentHash contentHash) {
        this.contentHash = contentHash;
        return this;
    }

    /**
     * Get the version property: Gets or sets the version of the content.
     *
     * @return the version value.
     */
    public String version() {
        return this.version;
    }

    /**
     * Set the version property: Gets or sets the version of the content.
     *
     * @param version the version value to set.
     * @return the ContentLink object itself.
     */
    public ContentLink withVersion(String version) {
        this.version = version;
        return this;
    }

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