You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
279 lines
5.8 KiB
279 lines
5.8 KiB
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
// This file is automatically generated. Changes to this file may be overwritten.
|
|
|
|
namespace Epic.OnlineServices.Auth
|
|
{
|
|
/// <summary>
|
|
/// A structure that contains an auth token.
|
|
/// These structures are created by <see cref="AuthInterface.CopyUserAuthToken" /> and must be passed to <see cref="AuthInterface.Release" />.
|
|
/// </summary>
|
|
public class Token : ISettable
|
|
{
|
|
/// <summary>
|
|
/// Name of the app related to the client ID involved with this token
|
|
/// </summary>
|
|
public string App { get; set; }
|
|
|
|
/// <summary>
|
|
/// Client ID that requested this token
|
|
/// </summary>
|
|
public string ClientId { get; set; }
|
|
|
|
/// <summary>
|
|
/// The Epic Online Services Account ID associated with this auth token
|
|
/// </summary>
|
|
public EpicAccountId AccountId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Access token for the current user login session
|
|
/// </summary>
|
|
public string AccessToken { get; set; }
|
|
|
|
/// <summary>
|
|
/// Time before the access token expires, in seconds, relative to the call to <see cref="AuthInterface.CopyUserAuthToken" />
|
|
/// </summary>
|
|
public double ExpiresIn { get; set; }
|
|
|
|
/// <summary>
|
|
/// Absolute time in UTC before the access token expires, in ISO 8601 format
|
|
/// </summary>
|
|
public string ExpiresAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Type of auth token
|
|
/// </summary>
|
|
public AuthTokenType AuthType { get; set; }
|
|
|
|
/// <summary>
|
|
/// Refresh token.
|
|
/// <seealso cref="LoginCredentialType" />::<seealso cref="LoginCredentialType.RefreshToken" />
|
|
/// </summary>
|
|
public string RefreshToken { get; set; }
|
|
|
|
/// <summary>
|
|
/// Time before the access token expires, in seconds, relative to the call to <see cref="AuthInterface.CopyUserAuthToken" />
|
|
/// </summary>
|
|
public double RefreshExpiresIn { get; set; }
|
|
|
|
/// <summary>
|
|
/// Absolute time in UTC before the refresh token expires, in ISO 8601 format
|
|
/// </summary>
|
|
public string RefreshExpiresAt { get; set; }
|
|
|
|
internal void Set(TokenInternal? other)
|
|
{
|
|
if (other != null)
|
|
{
|
|
App = other.Value.App;
|
|
ClientId = other.Value.ClientId;
|
|
AccountId = other.Value.AccountId;
|
|
AccessToken = other.Value.AccessToken;
|
|
ExpiresIn = other.Value.ExpiresIn;
|
|
ExpiresAt = other.Value.ExpiresAt;
|
|
AuthType = other.Value.AuthType;
|
|
RefreshToken = other.Value.RefreshToken;
|
|
RefreshExpiresIn = other.Value.RefreshExpiresIn;
|
|
RefreshExpiresAt = other.Value.RefreshExpiresAt;
|
|
}
|
|
}
|
|
|
|
public void Set(object other)
|
|
{
|
|
Set(other as TokenInternal?);
|
|
}
|
|
}
|
|
|
|
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
|
|
internal struct TokenInternal : ISettable, System.IDisposable
|
|
{
|
|
private int m_ApiVersion;
|
|
private System.IntPtr m_App;
|
|
private System.IntPtr m_ClientId;
|
|
private System.IntPtr m_AccountId;
|
|
private System.IntPtr m_AccessToken;
|
|
private double m_ExpiresIn;
|
|
private System.IntPtr m_ExpiresAt;
|
|
private AuthTokenType m_AuthType;
|
|
private System.IntPtr m_RefreshToken;
|
|
private double m_RefreshExpiresIn;
|
|
private System.IntPtr m_RefreshExpiresAt;
|
|
|
|
public string App
|
|
{
|
|
get
|
|
{
|
|
string value;
|
|
Helper.TryMarshalGet(m_App, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_App, value);
|
|
}
|
|
}
|
|
|
|
public string ClientId
|
|
{
|
|
get
|
|
{
|
|
string value;
|
|
Helper.TryMarshalGet(m_ClientId, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_ClientId, value);
|
|
}
|
|
}
|
|
|
|
public EpicAccountId AccountId
|
|
{
|
|
get
|
|
{
|
|
EpicAccountId value;
|
|
Helper.TryMarshalGet(m_AccountId, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_AccountId, value);
|
|
}
|
|
}
|
|
|
|
public string AccessToken
|
|
{
|
|
get
|
|
{
|
|
string value;
|
|
Helper.TryMarshalGet(m_AccessToken, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_AccessToken, value);
|
|
}
|
|
}
|
|
|
|
public double ExpiresIn
|
|
{
|
|
get
|
|
{
|
|
return m_ExpiresIn;
|
|
}
|
|
|
|
set
|
|
{
|
|
m_ExpiresIn = value;
|
|
}
|
|
}
|
|
|
|
public string ExpiresAt
|
|
{
|
|
get
|
|
{
|
|
string value;
|
|
Helper.TryMarshalGet(m_ExpiresAt, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_ExpiresAt, value);
|
|
}
|
|
}
|
|
|
|
public AuthTokenType AuthType
|
|
{
|
|
get
|
|
{
|
|
return m_AuthType;
|
|
}
|
|
|
|
set
|
|
{
|
|
m_AuthType = value;
|
|
}
|
|
}
|
|
|
|
public string RefreshToken
|
|
{
|
|
get
|
|
{
|
|
string value;
|
|
Helper.TryMarshalGet(m_RefreshToken, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_RefreshToken, value);
|
|
}
|
|
}
|
|
|
|
public double RefreshExpiresIn
|
|
{
|
|
get
|
|
{
|
|
return m_RefreshExpiresIn;
|
|
}
|
|
|
|
set
|
|
{
|
|
m_RefreshExpiresIn = value;
|
|
}
|
|
}
|
|
|
|
public string RefreshExpiresAt
|
|
{
|
|
get
|
|
{
|
|
string value;
|
|
Helper.TryMarshalGet(m_RefreshExpiresAt, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.TryMarshalSet(ref m_RefreshExpiresAt, value);
|
|
}
|
|
}
|
|
|
|
public void Set(Token other)
|
|
{
|
|
if (other != null)
|
|
{
|
|
m_ApiVersion = AuthInterface.TokenApiLatest;
|
|
App = other.App;
|
|
ClientId = other.ClientId;
|
|
AccountId = other.AccountId;
|
|
AccessToken = other.AccessToken;
|
|
ExpiresIn = other.ExpiresIn;
|
|
ExpiresAt = other.ExpiresAt;
|
|
AuthType = other.AuthType;
|
|
RefreshToken = other.RefreshToken;
|
|
RefreshExpiresIn = other.RefreshExpiresIn;
|
|
RefreshExpiresAt = other.RefreshExpiresAt;
|
|
}
|
|
}
|
|
|
|
public void Set(object other)
|
|
{
|
|
Set(other as Token);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Helper.TryMarshalDispose(ref m_App);
|
|
Helper.TryMarshalDispose(ref m_ClientId);
|
|
Helper.TryMarshalDispose(ref m_AccountId);
|
|
Helper.TryMarshalDispose(ref m_AccessToken);
|
|
Helper.TryMarshalDispose(ref m_ExpiresAt);
|
|
Helper.TryMarshalDispose(ref m_RefreshToken);
|
|
Helper.TryMarshalDispose(ref m_RefreshExpiresAt);
|
|
}
|
|
}
|
|
}
|