docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ApiSourceVersion

    A class containing version information about the source API.

    Inheritance
    object
    ApiSourceVersion
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cloud.Common
    Assembly: Unity.Cloud.Common.dll
    Syntax
    public class ApiSourceVersion

    Constructors

    ApiSourceVersion(string, string)

    Creates an instance of the ApiSourceVersion with the provided name and version.

    Declaration
    public ApiSourceVersion(string name, string version)
    Parameters
    Type Name Description
    string name

    The API name.

    string version

    The API version.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the name or version are null or empty.

    Fields

    k_DevVersion

    Default dev version for the API source version.

    Declaration
    public const string k_DevVersion = "dev"
    Field Value
    Type Description
    string

    Properties

    Name

    The name of the source API.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    Version

    The version of the source API.

    Declaration
    public string Version { get; }
    Property Value
    Type Description
    string

    Methods

    GetApiSourceVersionForAssembly(Assembly)

    Returns the ApiSourceVersion for the calling assembly. The source values are retrieved from the ApiSourceVersionAttribute which must be defined in the calling Assembly.

    Declaration
    public static ApiSourceVersion GetApiSourceVersionForAssembly(Assembly assembly)
    Parameters
    Type Name Description
    Assembly assembly

    The target assembly.

    Returns
    Type Description
    ApiSourceVersion

    The retrieved ApiSourceVersion.

    Remarks

    An instance of the ApiSourceVersionAttribute must be defined at the assembly-level in the calling Assembly in order for the correct API source values to be added as a header.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if the assembly is null or if the name or version defined in the retrieved ApiSourceVersionAttribute are null or white space.

    InvalidOperationException

    Thrown if ApiSourceVersionAttribute does not exist or is not initialized in the calling assembly.

    InvalidArgumentException

    Thrown if ApiSourceVersionAttribute is initialized with null or empty values in the calling assembly.

    Extension Methods

    ServiceHeaderUtils.GetHeaderValue(ApiSourceVersion)
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)