// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.fluidrelay.models.EncryptionProperties;
import com.azure.resourcemanager.fluidrelay.models.FluidRelayEndpoints;
import com.azure.resourcemanager.fluidrelay.models.Identity;
import com.azure.resourcemanager.fluidrelay.models.ProvisioningState;
import com.azure.resourcemanager.fluidrelay.models.StorageSku;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** A FluidRelay Server. */
@Fluent
public final class FluidRelayServerInner extends Resource {
    /*
     * The resource-specific properties for this resource.
     */
    @JsonProperty(value = "properties")
    private FluidRelayServerProperties innerProperties;

    /*
     * System meta data for this resource, including creation and modification information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

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

    /**
     * Get the systemData property: System meta data for this resource, including creation and modification information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * 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 FluidRelayServerInner object itself.
     */
    public FluidRelayServerInner withIdentity(Identity identity) {
        this.identity = identity;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public FluidRelayServerInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public FluidRelayServerInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the frsTenantId property: The Fluid tenantId for this server.
     *
     * @return the frsTenantId value.
     */
    public String frsTenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().frsTenantId();
    }

    /**
     * Get the fluidRelayEndpoints property: The Fluid Relay Service endpoints for this server.
     *
     * @return the fluidRelayEndpoints value.
     */
    public FluidRelayEndpoints fluidRelayEndpoints() {
        return this.innerProperties() == null ? null : this.innerProperties().fluidRelayEndpoints();
    }

    /**
     * Get the provisioningState property: Provision states for FluidRelay RP.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Set the provisioningState property: Provision states for FluidRelay RP.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the FluidRelayServerInner object itself.
     */
    public FluidRelayServerInner withProvisioningState(ProvisioningState provisioningState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluidRelayServerProperties();
        }
        this.innerProperties().withProvisioningState(provisioningState);
        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 FluidRelayServerInner object itself.
     */
    public FluidRelayServerInner withEncryption(EncryptionProperties encryption) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluidRelayServerProperties();
        }
        this.innerProperties().withEncryption(encryption);
        return this;
    }

    /**
     * Get the storagesku property: StorageSKU
     *
     * <p>Sku of the storage associated with the resource.
     *
     * @return the storagesku value.
     */
    public StorageSku storagesku() {
        return this.innerProperties() == null ? null : this.innerProperties().storagesku();
    }

    /**
     * Set the storagesku property: StorageSKU
     *
     * <p>Sku of the storage associated with the resource.
     *
     * @param storagesku the storagesku value to set.
     * @return the FluidRelayServerInner object itself.
     */
    public FluidRelayServerInner withStoragesku(StorageSku storagesku) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FluidRelayServerProperties();
        }
        this.innerProperties().withStoragesku(storagesku);
        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();
        }
    }
}
