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

package com.azure.resourcemanager.fluidrelay.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.fluidrelay.fluent.models.FluidRelayServerUpdateProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The updatable properties of a Fluid Relay server. */
@Fluent
public final class FluidRelayServerUpdate {
    /*
     * The resource-specific properties that can be updated for this resource.
     */
    @JsonProperty(value = "properties")
    private FluidRelayServerUpdateProperties innerProperties;

    /*
     * Resource tags.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * The type of identity used for the resource.
     */
    @JsonProperty(value = "identity")
    private Identity identity;

    /*
     * The geo-location where the resource lives
     */
    @JsonProperty(value = "location")
    private String location;

    /**
     * Get the innerProperties property: The resource-specific properties that can be updated for this resource.
     *
     * @return the innerProperties value.
     */
    private FluidRelayServerUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: Resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Resource tags.
     *
     * @param tags the tags value to set.
     * @return the FluidRelayServerUpdate object itself.
     */
    public FluidRelayServerUpdate withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the identity property: The type of identity used for the resource.
     *
     * @return the identity value.
     */
    public Identity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The type of identity used for the resource.
     *
     * @param identity the identity value to set.
     * @return the FluidRelayServerUpdate object itself.
     */
    public FluidRelayServerUpdate withIdentity(Identity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the location property: The geo-location where the resource lives.
     *
     * @return the location value.
     */
    public String location() {
        return this.location;
    }

    /**
     * Set the location property: The geo-location where the resource lives.
     *
     * @param location the location value to set.
     * @return the FluidRelayServerUpdate object itself.
     */
    public FluidRelayServerUpdate withLocation(String location) {
        this.location = location;
        return this;
    }

    /**
     * Get the encryption property: All encryption configuration for a resource.
     *
     * @return the encryption value.
     */
    public EncryptionProperties encryption() {
        return this.innerProperties() == null ? null : this.innerProperties().encryption();
    }

    /**
     * Set the encryption property: All encryption configuration for a resource.
     *
     * @param encryption the encryption value to set.
     * @return the FluidRelayServerUpdate object itself.
     */
    public FluidRelayServerUpdate withEncryption(EncryptionProperties encryption) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluidRelayServerUpdateProperties();
        }
        this.innerProperties().withEncryption(encryption);
        return this;
    }

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