Class ApiObject
Class for encapsulating generic json types as a JToken.
Inherited Members
Namespace: Unity.Services.Apis.Shared
Assembly: solution.dll
Syntax
public class ApiObject
Constructors
ApiObject(object)
Create an instance of an api object
Declaration
[Preserve]
public ApiObject(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | the source object |
Methods
GetAsString(Formatting)
Returns the Jtoken as a string.
Declaration
public string GetAsString(Formatting formatting = null)
Parameters
Type | Name | Description |
---|---|---|
Formatting | formatting | The formatting option. Defaults to none. |
Returns
Type | Description |
---|---|
string | The token value as a string. |
GetAs<T>(JsonSerializerSettings)
Deserialize the token to the specified type.
Declaration
public T GetAs<T>(JsonSerializerSettings settings = null)
Parameters
Type | Name | Description |
---|---|---|
JsonSerializerSettings | settings | Serializer settings, uses defaults if null |
Returns
Type | Description |
---|---|
T | The deserialized object. |
Type Parameters
Name | Description |
---|---|
T | The type to cast internal object to. |