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

package com.azure.resourcemanager.apimanagement.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.apimanagement.fluent.models.TagContractProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Parameters supplied to Create/Update Tag operations. */
@Fluent
public final class TagCreateUpdateParameters {
    /*
     * Properties supplied to Create Tag operation.
     */
    @JsonProperty(value = "properties")
    private TagContractProperties innerProperties;

    /**
     * Get the innerProperties property: Properties supplied to Create Tag operation.
     *
     * @return the innerProperties value.
     */
    private TagContractProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Set the displayName property: Tag name.
     *
     * @param displayName the displayName value to set.
     * @return the TagCreateUpdateParameters object itself.
     */
    public TagCreateUpdateParameters withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new TagContractProperties();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

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