docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ApiObject

    Class for encapsulating generic json types as a JToken.

    Inheritance
    object
    ApiObject
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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.

    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)