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.
287 lines
5.9 KiB
287 lines
5.9 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 struct Token
|
|
{
|
|
/// <summary>
|
|
/// Name of the app related to the client ID involved with this token
|
|
/// </summary>
|
|
public Utf8String App { get; set; }
|
|
|
|
/// <summary>
|
|
/// Client ID that requested this token
|
|
/// </summary>
|
|
public Utf8String ClientId { get; set; }
|
|
|
|
/// <summary>
|
|
/// The Epic Account ID associated with this auth token
|
|
/// </summary>
|
|
public EpicAccountId AccountId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Access token for the current user login session
|
|
/// </summary>
|
|
public Utf8String 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 Utf8String ExpiresAt { get; set; }
|
|
|
|
/// <summary>
|
|
/// Type of auth token
|
|
/// </summary>
|
|
public AuthTokenType AuthType { get; set; }
|
|
|
|
/// <summary>
|
|
/// Refresh token.
|
|
/// <seealso cref="LoginCredentialType.RefreshToken" />
|
|
/// </summary>
|
|
public Utf8String 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 Utf8String RefreshExpiresAt { get; set; }
|
|
|
|
internal void Set(ref TokenInternal other)
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
|
|
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
|
|
internal struct TokenInternal : IGettable<Token>, ISettable<Token>, 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 Utf8String App
|
|
{
|
|
get
|
|
{
|
|
Utf8String value;
|
|
Helper.Get(m_App, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_App);
|
|
}
|
|
}
|
|
|
|
public Utf8String ClientId
|
|
{
|
|
get
|
|
{
|
|
Utf8String value;
|
|
Helper.Get(m_ClientId, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_ClientId);
|
|
}
|
|
}
|
|
|
|
public EpicAccountId AccountId
|
|
{
|
|
get
|
|
{
|
|
EpicAccountId value;
|
|
Helper.Get(m_AccountId, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_AccountId);
|
|
}
|
|
}
|
|
|
|
public Utf8String AccessToken
|
|
{
|
|
get
|
|
{
|
|
Utf8String value;
|
|
Helper.Get(m_AccessToken, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_AccessToken);
|
|
}
|
|
}
|
|
|
|
public double ExpiresIn
|
|
{
|
|
get
|
|
{
|
|
return m_ExpiresIn;
|
|
}
|
|
|
|
set
|
|
{
|
|
m_ExpiresIn = value;
|
|
}
|
|
}
|
|
|
|
public Utf8String ExpiresAt
|
|
{
|
|
get
|
|
{
|
|
Utf8String value;
|
|
Helper.Get(m_ExpiresAt, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_ExpiresAt);
|
|
}
|
|
}
|
|
|
|
public AuthTokenType AuthType
|
|
{
|
|
get
|
|
{
|
|
return m_AuthType;
|
|
}
|
|
|
|
set
|
|
{
|
|
m_AuthType = value;
|
|
}
|
|
}
|
|
|
|
public Utf8String RefreshToken
|
|
{
|
|
get
|
|
{
|
|
Utf8String value;
|
|
Helper.Get(m_RefreshToken, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_RefreshToken);
|
|
}
|
|
}
|
|
|
|
public double RefreshExpiresIn
|
|
{
|
|
get
|
|
{
|
|
return m_RefreshExpiresIn;
|
|
}
|
|
|
|
set
|
|
{
|
|
m_RefreshExpiresIn = value;
|
|
}
|
|
}
|
|
|
|
public Utf8String RefreshExpiresAt
|
|
{
|
|
get
|
|
{
|
|
Utf8String value;
|
|
Helper.Get(m_RefreshExpiresAt, out value);
|
|
return value;
|
|
}
|
|
|
|
set
|
|
{
|
|
Helper.Set(value, ref m_RefreshExpiresAt);
|
|
}
|
|
}
|
|
|
|
public void Set(ref Token other)
|
|
{
|
|
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(ref Token? other)
|
|
{
|
|
if (other.HasValue)
|
|
{
|
|
m_ApiVersion = AuthInterface.TokenApiLatest;
|
|
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 Dispose()
|
|
{
|
|
Helper.Dispose(ref m_App);
|
|
Helper.Dispose(ref m_ClientId);
|
|
Helper.Dispose(ref m_AccountId);
|
|
Helper.Dispose(ref m_AccessToken);
|
|
Helper.Dispose(ref m_ExpiresAt);
|
|
Helper.Dispose(ref m_RefreshToken);
|
|
Helper.Dispose(ref m_RefreshExpiresAt);
|
|
}
|
|
|
|
public void Get(out Token output)
|
|
{
|
|
output = new Token();
|
|
output.Set(ref this);
|
|
}
|
|
}
|
|
}
|