// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.Ecom
{
public sealed partial class Transaction : Handle
{
public Transaction()
{
}
public Transaction(System.IntPtr innerHandle) : base(innerHandle)
{
}
///
/// The most recent version of the Function.
///
public const int TransactionCopyentitlementbyindexApiLatest = 1;
///
/// The most recent version of the Function.
///
public const int TransactionGetentitlementscountApiLatest = 1;
///
/// Fetches an entitlement from a given index.
///
///
/// structure containing the index being accessed
/// the entitlement for the given index, if it exists and is valid, use when finished
///
/// if the information is available and passed out in OutEntitlement
/// if the entitlement information is stale and passed out in OutEntitlement
/// if you pass a null pointer for the out parameter
/// if the entitlement is not found
///
public Result CopyEntitlementByIndex(TransactionCopyEntitlementByIndexOptions options, out Entitlement outEntitlement)
{
var optionsAddress = System.IntPtr.Zero;
Helper.TryMarshalSet(ref optionsAddress, options);
var outEntitlementAddress = System.IntPtr.Zero;
var funcResult = Bindings.EOS_Ecom_Transaction_CopyEntitlementByIndex(InnerHandle, optionsAddress, ref outEntitlementAddress);
Helper.TryMarshalDispose(ref optionsAddress);
if (Helper.TryMarshalGet(outEntitlementAddress, out outEntitlement))
{
Bindings.EOS_Ecom_Entitlement_Release(outEntitlementAddress);
}
return funcResult;
}
///
/// Fetch the number of entitlements that are part of this transaction.
///
///
/// structure containing the Epic Online Services Account ID being accessed
///
/// the number of entitlements found.
///
public uint GetEntitlementsCount(TransactionGetEntitlementsCountOptions options)
{
var optionsAddress = System.IntPtr.Zero;
Helper.TryMarshalSet(ref optionsAddress, options);
var funcResult = Bindings.EOS_Ecom_Transaction_GetEntitlementsCount(InnerHandle, optionsAddress);
Helper.TryMarshalDispose(ref optionsAddress);
return funcResult;
}
///
/// The Ecom Transaction Interface exposes getters for accessing information about a completed transaction.
/// All Ecom Transaction Interface calls take a handle of type as the first parameter.
/// An handle is originally returned as part of the struct.
/// An handle can also be retrieved from an handle using .
/// It is expected that after a transaction that is called.
/// When is called any remaining transactions will also be released.
///
///
///
///
public Result GetTransactionId(out string outBuffer)
{
System.IntPtr outBufferAddress = System.IntPtr.Zero;
int inOutBufferLength = EcomInterface.TransactionidMaximumLength + 1;
Helper.TryMarshalAllocate(ref outBufferAddress, inOutBufferLength);
var funcResult = Bindings.EOS_Ecom_Transaction_GetTransactionId(InnerHandle, outBufferAddress, ref inOutBufferLength);
Helper.TryMarshalGet(outBufferAddress, out outBuffer);
Helper.TryMarshalDispose(ref outBufferAddress);
return funcResult;
}
///
/// Release the memory associated with an . Is is expected to be called after
/// being received from a .
///
///
///
///
/// A handle to a transaction.
public void Release()
{
Bindings.EOS_Ecom_Transaction_Release(InnerHandle);
}
}
}