// 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.azure.resourcemanager.automation.fluent.models.ModuleUpdateProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The parameters supplied to the update module operation. */
@Fluent
public final class ModuleUpdateParameters {
    /*
     * Gets or sets the module update properties.
     */
    @JsonProperty(value = "properties")
    private ModuleUpdateProperties innerProperties;

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

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

    /*
     * Gets or sets the tags attached to the resource.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /**
     * Get the innerProperties property: Gets or sets the module update properties.
     *
     * @return the innerProperties value.
     */
    private ModuleUpdateProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Set the name property: Gets or sets name of the resource.
     *
     * @param name the name value to set.
     * @return the ModuleUpdateParameters object itself.
     */
    public ModuleUpdateParameters withName(String name) {
        this.name = name;
        return this;
    }

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

    /**
     * Set the location property: Gets or sets the location of the resource.
     *
     * @param location the location value to set.
     * @return the ModuleUpdateParameters object itself.
     */
    public ModuleUpdateParameters withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the tags property: Gets or sets the tags attached to the resource.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Gets or sets the tags attached to the resource.
     *
     * @param tags the tags value to set.
     * @return the ModuleUpdateParameters object itself.
     */
    public ModuleUpdateParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the contentLink property: Gets or sets the module content link.
     *
     * @return the contentLink value.
     */
    public ContentLink contentLink() {
        return this.innerProperties() == null ? null : this.innerProperties().contentLink();
    }

    /**
     * Set the contentLink property: Gets or sets the module content link.
     *
     * @param contentLink the contentLink value to set.
     * @return the ModuleUpdateParameters object itself.
     */
    public ModuleUpdateParameters withContentLink(ContentLink contentLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ModuleUpdateProperties();
        }
        this.innerProperties().withContentLink(contentLink);
        return this;
    }

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