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.

186 lines
4.1 KiB

// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.Ecom
{
/// <summary>
/// Contains information about a single entitlement associated with an account. Instances of this structure are
/// created by <see cref="EcomInterface.CopyEntitlementByIndex" />, <see cref="EcomInterface.CopyEntitlementByNameAndIndex" />, or <see cref="EcomInterface.CopyEntitlementById" />.
/// They must be passed to <see cref="EcomInterface.Release" />.
/// </summary>
public class Entitlement : ISettable
{
/// <summary>
/// Name of the entitlement
/// </summary>
public string EntitlementName { get; set; }
/// <summary>
/// ID of the entitlement owned by an account
/// </summary>
public string EntitlementId { get; set; }
/// <summary>
/// ID of the item associated with the offer which granted this entitlement
/// </summary>
public string CatalogItemId { get; set; }
/// <summary>
/// If queried using pagination then ServerIndex represents the index of the entitlement as it
/// exists on the server. If not queried using pagination then ServerIndex will be -1.
/// </summary>
public int ServerIndex { get; set; }
/// <summary>
/// If true then the catalog has this entitlement marked as redeemed
/// </summary>
public bool Redeemed { get; set; }
/// <summary>
/// If not -1 then this is a POSIX timestamp that this entitlement will end
/// </summary>
public long EndTimestamp { get; set; }
internal void Set(EntitlementInternal? other)
{
if (other != null)
{
EntitlementName = other.Value.EntitlementName;
EntitlementId = other.Value.EntitlementId;
CatalogItemId = other.Value.CatalogItemId;
ServerIndex = other.Value.ServerIndex;
Redeemed = other.Value.Redeemed;
EndTimestamp = other.Value.EndTimestamp;
}
}
public void Set(object other)
{
Set(other as EntitlementInternal?);
}
}
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
internal struct EntitlementInternal : ISettable, System.IDisposable
{
private int m_ApiVersion;
private System.IntPtr m_EntitlementName;
private System.IntPtr m_EntitlementId;
private System.IntPtr m_CatalogItemId;
private int m_ServerIndex;
private int m_Redeemed;
private long m_EndTimestamp;
public string EntitlementName
{
get
{
string value;
Helper.TryMarshalGet(m_EntitlementName, out value);
return value;
}
set
{
Helper.TryMarshalSet(ref m_EntitlementName, value);
}
}
public string EntitlementId
{
get
{
string value;
Helper.TryMarshalGet(m_EntitlementId, out value);
return value;
}
set
{
Helper.TryMarshalSet(ref m_EntitlementId, value);
}
}
public string CatalogItemId
{
get
{
string value;
Helper.TryMarshalGet(m_CatalogItemId, out value);
return value;
}
set
{
Helper.TryMarshalSet(ref m_CatalogItemId, value);
}
}
public int ServerIndex
{
get
{
return m_ServerIndex;
}
set
{
m_ServerIndex = value;
}
}
public bool Redeemed
{
get
{
bool value;
Helper.TryMarshalGet(m_Redeemed, out value);
return value;
}
set
{
Helper.TryMarshalSet(ref m_Redeemed, value);
}
}
public long EndTimestamp
{
get
{
return m_EndTimestamp;
}
set
{
m_EndTimestamp = value;
}
}
public void Set(Entitlement other)
{
if (other != null)
{
m_ApiVersion = EcomInterface.EntitlementApiLatest;
EntitlementName = other.EntitlementName;
EntitlementId = other.EntitlementId;
CatalogItemId = other.CatalogItemId;
ServerIndex = other.ServerIndex;
Redeemed = other.Redeemed;
EndTimestamp = other.EndTimestamp;
}
}
public void Set(object other)
{
Set(other as Entitlement);
}
public void Dispose()
{
Helper.TryMarshalDispose(ref m_EntitlementName);
Helper.TryMarshalDispose(ref m_EntitlementId);
Helper.TryMarshalDispose(ref m_CatalogItemId);
}
}
}