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

package com.azure.resourcemanager.dnsresolver.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.dnsresolver.fluent.models.VirtualNetworkLinkPatchProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Describes a virtual network link for PATCH operation. */
@Fluent
public final class VirtualNetworkLinkPatch {
    /*
     * Updatable properties of the virtual network link.
     */
    @JsonProperty(value = "properties")
    private VirtualNetworkLinkPatchProperties innerProperties;

    /**
     * Get the innerProperties property: Updatable properties of the virtual network link.
     *
     * @return the innerProperties value.
     */
    private VirtualNetworkLinkPatchProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the metadata property: Metadata attached to the virtual network link.
     *
     * @return the metadata value.
     */
    public Map<String, String> metadata() {
        return this.innerProperties() == null ? null : this.innerProperties().metadata();
    }

    /**
     * Set the metadata property: Metadata attached to the virtual network link.
     *
     * @param metadata the metadata value to set.
     * @return the VirtualNetworkLinkPatch object itself.
     */
    public VirtualNetworkLinkPatch withMetadata(Map<String, String> metadata) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualNetworkLinkPatchProperties();
        }
        this.innerProperties().withMetadata(metadata);
        return this;
    }

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