Skip to content

[Proposal] Add interface definitions for all *InstanceAPI.cs classes #127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 270 additions & 0 deletions PlayFabSDK/source/IPlayFabAddonInstanceAPI.cs

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions PlayFabSDK/source/IPlayFabAdminInstanceAPI.cs

Large diffs are not rendered by default.

75 changes: 75 additions & 0 deletions PlayFabSDK/source/IPlayFabAuthenticationInstanceAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using PlayFab.AuthenticationModels;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace PlayFab
{
/// <summary>
/// Interface for PlayFab Authentication Instance API.
/// </summary>
public interface IPlayFabAuthenticationInstanceAPI
{
/// <summary>
/// Checks if the entity is currently logged in.
/// </summary>
/// <returns>True if the entity is logged in; otherwise, false.</returns>
bool IsEntityLoggedIn();

/// <summary>
/// Forgets all stored credentials for the current entity.
/// </summary>
void ForgetAllCredentials();

/// <summary>
/// Authenticates a game server using a custom ID and returns an entity token.
/// </summary>
/// <param name="request">The request containing the custom ID and optional custom tags.</param>
/// <param name="customData">Optional custom data for the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the authentication result.</returns>
Task<PlayFabResult<AuthenticateCustomIdResult>> AuthenticateGameServerWithCustomIdAsync(
AuthenticateCustomIdRequest request,
object customData = null,
Dictionary<string, string> extraHeaders = null
);

/// <summary>
/// Deletes a game server entity.
/// </summary>
/// <param name="request">The request containing the entity to delete and optional custom tags.</param>
/// <param name="customData">Optional custom data for the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains an empty response.</returns>
Task<PlayFabResult<EmptyResponse>> DeleteAsync(
DeleteRequest request,
object customData = null,
Dictionary<string, string> extraHeaders = null
);

/// <summary>
/// Retrieves an entity token for the specified entity or the currently logged in entity.
/// </summary>
/// <param name="request">The request containing the entity and optional custom tags.</param>
/// <param name="customData">Optional custom data for the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the entity token response.</returns>
Task<PlayFabResult<GetEntityTokenResponse>> GetEntityTokenAsync(
GetEntityTokenRequest request,
object customData = null,
Dictionary<string, string> extraHeaders = null
);

/// <summary>
/// Validates that the provided entity token has not expired or been revoked.
/// </summary>
/// <param name="request">The request containing the entity token and optional custom tags.</param>
/// <param name="customData">Optional custom data for the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the validation response.</returns>
Task<PlayFabResult<ValidateEntityTokenResponse>> ValidateEntityTokenAsync(
ValidateEntityTokenRequest request,
object customData = null,
Dictionary<string, string> extraHeaders = null
);
}
}
888 changes: 888 additions & 0 deletions PlayFabSDK/source/IPlayFabClientInstanceAPI.cs

Large diffs are not rendered by default.

158 changes: 158 additions & 0 deletions PlayFabSDK/source/IPlayFabCloudScriptInstanceAPI.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
using PlayFab.CloudScriptModels;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace PlayFab
{
/// <summary>
/// Interface for PlayFab CloudScript Instance API, providing methods to execute and manage CloudScript and Azure Functions.
/// </summary>
public interface IPlayFabCloudScriptInstanceAPI
{
/// <summary>
/// Checks if the entity is currently logged in.
/// </summary>
/// <returns>True if the entity is logged in; otherwise, false.</returns>
bool IsEntityLoggedIn();

/// <summary>
/// Forgets all stored credentials for the current entity.
/// </summary>
void ForgetAllCredentials();

/// <summary>
/// Executes a CloudScript function with the entity profile defined in the request.
/// </summary>
/// <param name="request">The request parameters for executing the CloudScript function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the CloudScript execution.</returns>
Task<PlayFabResult<ExecuteCloudScriptResult>> ExecuteEntityCloudScriptAsync(ExecuteEntityCloudScriptRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Executes an Azure Function with the profile of the entity defined in the request.
/// </summary>
/// <param name="request">The request parameters for executing the Azure Function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the result of the function execution.</returns>
Task<PlayFabResult<ExecuteFunctionResult>> ExecuteFunctionAsync(ExecuteFunctionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Retrieves information about a registered function.
/// </summary>
/// <param name="request">The request parameters for retrieving the function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the function information.</returns>
Task<PlayFabResult<GetFunctionResult>> GetFunctionAsync(GetFunctionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Lists all EventHub triggered functions currently registered for the title.
/// </summary>
/// <param name="request">The request parameters for listing EventHub functions.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of EventHub functions.</returns>
Task<PlayFabResult<ListEventHubFunctionsResult>> ListEventHubFunctionsAsync(ListFunctionsRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Lists all functions currently registered for the title.
/// </summary>
/// <param name="request">The request parameters for listing functions.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of functions.</returns>
Task<PlayFabResult<ListFunctionsResult>> ListFunctionsAsync(ListFunctionsRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Lists all HTTP triggered functions currently registered for the title.
/// </summary>
/// <param name="request">The request parameters for listing HTTP functions.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of HTTP functions.</returns>
Task<PlayFabResult<ListHttpFunctionsResult>> ListHttpFunctionsAsync(ListFunctionsRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Lists all Queue triggered functions currently registered for the title.
/// </summary>
/// <param name="request">The request parameters for listing queued functions.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation, containing the list of queued functions.</returns>
Task<PlayFabResult<ListQueuedFunctionsResult>> ListQueuedFunctionsAsync(ListFunctionsRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Posts the result of a function execution for an entity triggered action.
/// </summary>
/// <param name="request">The request parameters containing the function result.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> PostFunctionResultForEntityTriggeredActionAsync(PostFunctionResultForEntityTriggeredActionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Posts the result of a function execution for a function execution event.
/// </summary>
/// <param name="request">The request parameters containing the function result.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> PostFunctionResultForFunctionExecutionAsync(PostFunctionResultForFunctionExecutionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Posts the result of a function execution for a player triggered action.
/// </summary>
/// <param name="request">The request parameters containing the function result.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> PostFunctionResultForPlayerTriggeredActionAsync(PostFunctionResultForPlayerTriggeredActionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Posts the result of a function execution for a scheduled task.
/// </summary>
/// <param name="request">The request parameters containing the function result.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> PostFunctionResultForScheduledTaskAsync(PostFunctionResultForScheduledTaskRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Registers an EventHub triggered function for the title.
/// </summary>
/// <param name="request">The request parameters for registering the EventHub function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> RegisterEventHubFunctionAsync(RegisterEventHubFunctionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Registers an HTTP triggered function for the title.
/// </summary>
/// <param name="request">The request parameters for registering the HTTP function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> RegisterHttpFunctionAsync(RegisterHttpFunctionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Registers a Queue triggered function for the title.
/// </summary>
/// <param name="request">The request parameters for registering the queued function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> RegisterQueuedFunctionAsync(RegisterQueuedFunctionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);

/// <summary>
/// Unregisters a function from the title.
/// </summary>
/// <param name="request">The request parameters for unregistering the function.</param>
/// <param name="customData">Optional custom data to associate with the request.</param>
/// <param name="extraHeaders">Optional extra headers to include in the request.</param>
/// <returns>A task that represents the asynchronous operation.</returns>
Task<PlayFabResult<EmptyResult>> UnregisterFunctionAsync(UnregisterFunctionRequest request, object customData = null, Dictionary<string, string> extraHeaders = null);
}
}
Loading