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

package com.azure.resourcemanager.hybridconnectivity.fluent.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The ingress gateway access credentials. */
@Fluent
public final class IngressGatewayResourceInner {
    /*
     * Azure relay hybrid connection access properties
     */
    @JsonProperty(value = "relay")
    private RelayNamespaceAccessProperties innerRelay;

    /*
     * Ingress gateway profile
     */
    @JsonProperty(value = "ingress")
    private IngressProfileProperties innerIngress;

    /** Creates an instance of IngressGatewayResourceInner class. */
    public IngressGatewayResourceInner() {
    }

    /**
     * Get the innerRelay property: Azure relay hybrid connection access properties.
     *
     * @return the innerRelay value.
     */
    private RelayNamespaceAccessProperties innerRelay() {
        return this.innerRelay;
    }

    /**
     * Get the innerIngress property: Ingress gateway profile.
     *
     * @return the innerIngress value.
     */
    private IngressProfileProperties innerIngress() {
        return this.innerIngress;
    }

    /**
     * Get the namespaceName property: The namespace name.
     *
     * @return the namespaceName value.
     */
    public String namespaceName() {
        return this.innerRelay() == null ? null : this.innerRelay().namespaceName();
    }

    /**
     * Set the namespaceName property: The namespace name.
     *
     * @param namespaceName the namespaceName value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withNamespaceName(String namespaceName) {
        if (this.innerRelay() == null) {
            this.innerRelay = new RelayNamespaceAccessProperties();
        }
        this.innerRelay().withNamespaceName(namespaceName);
        return this;
    }

    /**
     * Get the namespaceNameSuffix property: The suffix domain name of relay namespace.
     *
     * @return the namespaceNameSuffix value.
     */
    public String namespaceNameSuffix() {
        return this.innerRelay() == null ? null : this.innerRelay().namespaceNameSuffix();
    }

    /**
     * Set the namespaceNameSuffix property: The suffix domain name of relay namespace.
     *
     * @param namespaceNameSuffix the namespaceNameSuffix value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withNamespaceNameSuffix(String namespaceNameSuffix) {
        if (this.innerRelay() == null) {
            this.innerRelay = new RelayNamespaceAccessProperties();
        }
        this.innerRelay().withNamespaceNameSuffix(namespaceNameSuffix);
        return this;
    }

    /**
     * Get the hybridConnectionName property: Azure Relay hybrid connection name for the resource.
     *
     * @return the hybridConnectionName value.
     */
    public String hybridConnectionName() {
        return this.innerRelay() == null ? null : this.innerRelay().hybridConnectionName();
    }

    /**
     * Set the hybridConnectionName property: Azure Relay hybrid connection name for the resource.
     *
     * @param hybridConnectionName the hybridConnectionName value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withHybridConnectionName(String hybridConnectionName) {
        if (this.innerRelay() == null) {
            this.innerRelay = new RelayNamespaceAccessProperties();
        }
        this.innerRelay().withHybridConnectionName(hybridConnectionName);
        return this;
    }

    /**
     * Get the accessKey property: Access key for hybrid connection.
     *
     * @return the accessKey value.
     */
    public String accessKey() {
        return this.innerRelay() == null ? null : this.innerRelay().accessKey();
    }

    /**
     * Get the expiresOn property: The expiration of access key in unix time.
     *
     * @return the expiresOn value.
     */
    public Long expiresOn() {
        return this.innerRelay() == null ? null : this.innerRelay().expiresOn();
    }

    /**
     * Set the expiresOn property: The expiration of access key in unix time.
     *
     * @param expiresOn the expiresOn value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withExpiresOn(Long expiresOn) {
        if (this.innerRelay() == null) {
            this.innerRelay = new RelayNamespaceAccessProperties();
        }
        this.innerRelay().withExpiresOn(expiresOn);
        return this;
    }

    /**
     * Get the serviceConfigurationToken property: The token to access the enabled service.
     *
     * @return the serviceConfigurationToken value.
     */
    public String serviceConfigurationToken() {
        return this.innerRelay() == null ? null : this.innerRelay().serviceConfigurationToken();
    }

    /**
     * Set the serviceConfigurationToken property: The token to access the enabled service.
     *
     * @param serviceConfigurationToken the serviceConfigurationToken value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withServiceConfigurationToken(String serviceConfigurationToken) {
        if (this.innerRelay() == null) {
            this.innerRelay = new RelayNamespaceAccessProperties();
        }
        this.innerRelay().withServiceConfigurationToken(serviceConfigurationToken);
        return this;
    }

    /**
     * Get the hostname property: The ingress hostname.
     *
     * @return the hostname value.
     */
    public String hostname() {
        return this.innerIngress() == null ? null : this.innerIngress().hostname();
    }

    /**
     * Set the hostname property: The ingress hostname.
     *
     * @param hostname the hostname value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withHostname(String hostname) {
        if (this.innerIngress() == null) {
            this.innerIngress = new IngressProfileProperties();
        }
        this.innerIngress().withHostname(hostname);
        return this;
    }

    /**
     * Get the serverId property: The arc ingress gateway server app id.
     *
     * @return the serverId value.
     */
    public String serverId() {
        return this.innerIngress() == null ? null : this.innerIngress().serverId();
    }

    /**
     * Set the serverId property: The arc ingress gateway server app id.
     *
     * @param serverId the serverId value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withServerId(String serverId) {
        if (this.innerIngress() == null) {
            this.innerIngress = new IngressProfileProperties();
        }
        this.innerIngress().withServerId(serverId);
        return this;
    }

    /**
     * Get the tenantId property: The target resource home tenant id.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerIngress() == null ? null : this.innerIngress().tenantId();
    }

    /**
     * Set the tenantId property: The target resource home tenant id.
     *
     * @param tenantId the tenantId value to set.
     * @return the IngressGatewayResourceInner object itself.
     */
    public IngressGatewayResourceInner withTenantId(String tenantId) {
        if (this.innerIngress() == null) {
            this.innerIngress = new IngressProfileProperties();
        }
        this.innerIngress().withTenantId(tenantId);
        return this;
    }

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