// 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.ConnectionUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The parameters supplied to the update connection operation. */
@Fluent
public final class ConnectionUpdateParameters {
    /*
     * Gets or sets the name of the connection.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Gets or sets the properties of the connection.
     */
    @JsonProperty(value = "properties")
    private ConnectionUpdateProperties innerProperties;

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

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

    /**
     * Get the innerProperties property: Gets or sets the properties of the connection.
     *
     * @return the innerProperties value.
     */
    private ConnectionUpdateProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Set the description property: Gets or sets the description of the connection.
     *
     * @param description the description value to set.
     * @return the ConnectionUpdateParameters object itself.
     */
    public ConnectionUpdateParameters withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConnectionUpdateProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the fieldDefinitionValues property: Gets or sets the field definition values of the connection.
     *
     * @return the fieldDefinitionValues value.
     */
    public Map<String, String> fieldDefinitionValues() {
        return this.innerProperties() == null ? null : this.innerProperties().fieldDefinitionValues();
    }

    /**
     * Set the fieldDefinitionValues property: Gets or sets the field definition values of the connection.
     *
     * @param fieldDefinitionValues the fieldDefinitionValues value to set.
     * @return the ConnectionUpdateParameters object itself.
     */
    public ConnectionUpdateParameters withFieldDefinitionValues(Map<String, String> fieldDefinitionValues) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConnectionUpdateProperties();
        }
        this.innerProperties().withFieldDefinitionValues(fieldDefinitionValues);
        return this;
    }

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