docs.unity3d.com
    Show / Hide Table of Contents

    Class ServiceHostConfiguration

    A class representing a configuration for the service environment for the application.

    Inheritance
    Object
    ServiceHostConfiguration
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Common
    Syntax
    [Obsolete("Use ServiceHostResolver instead.")]
    public sealed class ServiceHostConfiguration : IServiceHostResolver

    Fields

    k_DefaultEnvironment

    Declaration
    public const ServiceEnvironment k_DefaultEnvironment = ServiceEnvironment.Production
    Field Value
    Type Description
    ServiceEnvironment

    Properties

    SystemOverrideEnvironmentVariableName

    The environment variable key for the service environment override.

    Declaration
    public static string SystemOverrideEnvironmentVariableName { get; }
    Property Value
    Type Description
    String

    SystemOverrideProviderVariableName

    The environment variable key for the service domain provider override.

    Declaration
    public static string SystemOverrideProviderVariableName { get; }
    Property Value
    Type Description
    String

    Methods

    GetResolvedAddress(ServiceProtocol)

    Returns the service address for the specified inputs.

    Declaration
    public string GetResolvedAddress(ServiceProtocol protocol = ServiceProtocol.Http)
    Parameters
    Type Name Description
    ServiceProtocol protocol

    The web protocol.

    Returns
    Type Description
    String

    The service address.

    Implements
    IServiceHostResolver.GetResolvedAddress(ServiceProtocol)

    GetResolvedDomainProvider()

    Gets the resolved the ServiceDomainProvider.

    Declaration
    public ServiceDomainProvider GetResolvedDomainProvider()
    Returns
    Type Description
    ServiceDomainProvider

    The resolved service domain provider.

    Implements
    IServiceHostResolver.GetResolvedDomainProvider()

    GetResolvedEnvironment()

    Gets the resolved ServiceEnvironment.

    Declaration
    public ServiceEnvironment GetResolvedEnvironment()
    Returns
    Type Description
    ServiceEnvironment

    The resolved environment.

    Implements
    IServiceHostResolver.GetResolvedEnvironment()

    GetResolvedRequestUri(String, ServiceProtocol)

    Resolves and returns the request URI for the specified path and protocol.

    Declaration
    public string GetResolvedRequestUri(string path, ServiceProtocol protocol = ServiceProtocol.Http)
    Parameters
    Type Name Description
    String path

    The request path.

    ServiceProtocol protocol

    The web protocol.

    Returns
    Type Description
    String

    The Uri string.

    Implements
    IServiceHostResolver.GetResolvedRequestUri(String, ServiceProtocol)

    GetServiceAddress(ServiceEnvironment, ServiceDomainProvider, String, Int32, ServiceProtocol, String)

    Returns the service address for the specified inputs.

    Declaration
    public string GetServiceAddress(ServiceEnvironment environmentOverride, ServiceDomainProvider serviceDomainProviderOverride, string subdomain, int port, ServiceProtocol protocol, string serviceName)
    Parameters
    Type Name Description
    ServiceEnvironment environmentOverride

    The service environment override.

    ServiceDomainProvider serviceDomainProviderOverride

    The service domain provider.

    String subdomain

    The service subdomain.

    Int32 port

    The service port.

    ServiceProtocol protocol

    The web protocol.

    String serviceName

    The service's name.

    Returns
    Type Description
    String

    The service address.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    GetServiceAddress(ServiceEnvironment, ServiceDomainProvider, ServiceProtocol, String)

    Returns the service address for the specified inputs.

    Declaration
    public string GetServiceAddress(ServiceEnvironment environmentOverride, ServiceDomainProvider serviceDomainProviderOverride, ServiceProtocol protocol = ServiceProtocol.Http, string serviceName = "project")
    Parameters
    Type Name Description
    ServiceEnvironment environmentOverride

    The service environment override.

    ServiceDomainProvider serviceDomainProviderOverride

    The service domain provider.

    ServiceProtocol protocol

    The web protocol.

    String serviceName

    The service's name.

    Returns
    Type Description
    String

    The service address.

    GetServiceAddress(ServiceProtocol, String)

    Returns the service address for the specified inputs.

    Declaration
    public string GetServiceAddress(ServiceProtocol protocol = ServiceProtocol.Http, string serviceName = "project")
    Parameters
    Type Name Description
    ServiceProtocol protocol

    The web protocol.

    String serviceName

    The service's name.

    Returns
    Type Description
    String

    The service address.

    GetServiceDomain()

    Will return the domain for the resolved ServiceDomainProvider.

    Declaration
    public string GetServiceDomain()
    Returns
    Type Description
    String

    The domain for the specified provider.

    GetServiceDomain(ServiceDomainProvider)

    Will return the domain for a given ServiceDomainProvider.

    Declaration
    public string GetServiceDomain(ServiceDomainProvider serviceDomainProvider)
    Parameters
    Type Name Description
    ServiceDomainProvider serviceDomainProvider

    The service domain provider.

    Returns
    Type Description
    String

    The domain for the specified provider.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if the ServiceDomainProvider is not mapped to a domain.

    ResolveEnvironment(Nullable<ServiceEnvironment>)

    Resolves the ServiceEnvironment, prioritizing the override set via the Environment Variable.

    Declaration
    public (ServiceEnvironment environment, string url) ResolveEnvironment(ServiceEnvironment? environmentOverride = null)
    Parameters
    Type Name Description
    Nullable<ServiceEnvironment> environmentOverride

    The service environment override.

    Returns
    Type Description
    (T1, T2)<ServiceEnvironment, String>

    The resolved environment and url.

    Exceptions
    Type Condition
    NotSupportedException

    ResolveProvider(Nullable<ServiceDomainProvider>)

    Resolves the ServiceDomainProvider, prioritizing the override set via the Environment Variable.

    Declaration
    public ServiceDomainProvider ResolveProvider(ServiceDomainProvider? providerOverride = null)
    Parameters
    Type Name Description
    Nullable<ServiceDomainProvider> providerOverride

    The service environment override.

    Returns
    Type Description
    ServiceDomainProvider

    The resolved environment and url.

    Exceptions
    Type Condition
    NotSupportedException
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023