Class ApiSourceVersion
A class containing version information about the source API.
Inherited Members
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 |
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 |
| 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. |