#if !DISABLE_PLAYFABENTITY_API
using System;
using System.Collections.Generic;
using PlayFab.SharedModels;
namespace PlayFab.DataModels
{
///
/// Aborts the pending upload of the requested files.
///
[Serializable]
public class AbortFileUploadsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
///
/// Names of the files to have their pending uploads aborted.
///
public List FileNames;
///
/// The expected version of the profile, if set and doesn't match the current version of the profile the operation will not
/// be performed.
///
public int? ProfileVersion;
}
[Serializable]
public class AbortFileUploadsResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
}
///
/// Deletes the requested files from the entity's profile.
///
[Serializable]
public class DeleteFilesRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
///
/// Names of the files to be deleted.
///
public List FileNames;
///
/// The expected version of the profile, if set and doesn't match the current version of the profile the operation will not
/// be performed.
///
public int? ProfileVersion;
}
[Serializable]
public class DeleteFilesResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
}
///
/// Combined entity type and ID structure which uniquely identifies a single entity.
///
[Serializable]
public class EntityKey : PlayFabBaseModel
{
///
/// Unique ID of the entity.
///
public string Id;
///
/// Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types
///
public string Type;
}
///
/// Finalizes the upload of the requested files. Verifies that the files have been successfully uploaded and moves the file
/// pointers from pending to live.
///
[Serializable]
public class FinalizeFileUploadsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
///
/// Names of the files to be finalized. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'
///
public List FileNames;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
}
[Serializable]
public class FinalizeFileUploadsResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// Collection of metadata for the entity's files
///
public Dictionary Metadata;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
}
[Serializable]
public class GetFileMetadata : PlayFabBaseModel
{
///
/// Checksum value for the file, can be used to check if the file on the server has changed.
///
public string Checksum;
///
/// Download URL where the file can be retrieved
///
public string DownloadUrl;
///
/// Name of the file
///
public string FileName;
///
/// Last UTC time the file was modified
///
public DateTime LastModified;
///
/// Storage service's reported byte count
///
public int Size;
}
///
/// Returns URLs that may be used to download the files for a profile for a limited length of time. Only returns files that
/// have been successfully uploaded, files that are still pending will either return the old value, if it exists, or
/// nothing.
///
[Serializable]
public class GetFilesRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
}
[Serializable]
public class GetFilesResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// Collection of metadata for the entity's files
///
public Dictionary Metadata;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
}
///
/// Gets JSON objects from an entity profile and returns it.
///
[Serializable]
public class GetObjectsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
///
/// Determines whether the object will be returned as an escaped JSON string or as a un-escaped JSON object. Default is JSON
/// object.
///
public bool? EscapeObject;
}
[Serializable]
public class GetObjectsResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// Requested objects that the calling entity has access to
///
public Dictionary Objects;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
}
[Serializable]
public class InitiateFileUploadMetadata : PlayFabBaseModel
{
///
/// Name of the file.
///
public string FileName;
///
/// Location the data should be sent to via an HTTP PUT operation.
///
public string UploadUrl;
}
///
/// Returns URLs that may be used to upload the files for a profile 5 minutes. After using the upload calls
/// FinalizeFileUploads must be called to move the file status from pending to live.
///
[Serializable]
public class InitiateFileUploadsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
///
/// Names of the files to be set. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'
///
public List FileNames;
///
/// The expected version of the profile, if set and doesn't match the current version of the profile the operation will not
/// be performed.
///
public int? ProfileVersion;
}
[Serializable]
public class InitiateFileUploadsResponse : PlayFabResultCommon
{
///
/// The entity id and type.
///
public EntityKey Entity;
///
/// The current version of the profile, can be used for concurrency control during updates.
///
public int ProfileVersion;
///
/// Collection of file names and upload urls
///
public List UploadDetails;
}
[Serializable]
public class ObjectResult : PlayFabBaseModel
{
///
/// Un-escaped JSON object, if EscapeObject false or default.
///
public object DataObject;
///
/// Escaped string JSON body of the object, if EscapeObject is true.
///
public string EscapedDataObject;
///
/// Name of the object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'
///
public string ObjectName;
}
public enum OperationTypes
{
Created,
Updated,
Deleted,
None
}
[Serializable]
public class SetObject : PlayFabBaseModel
{
///
/// Body of the object to be saved. If empty and DeleteObject is true object will be deleted if it exists, or no operation
/// will occur if it does not exist. Only one of Object or EscapedDataObject fields may be used.
///
public object DataObject;
///
/// Flag to indicate that this object should be deleted. Both DataObject and EscapedDataObject must not be set as well.
///
public bool? DeleteObject;
///
/// Body of the object to be saved as an escaped JSON string. If empty and DeleteObject is true object will be deleted if it
/// exists, or no operation will occur if it does not exist. Only one of DataObject or EscapedDataObject fields may be used.
///
public string EscapedDataObject;
///
/// Name of object. Restricted to a-Z, 0-9, '(', ')', '_', '-' and '.'.
///
public string ObjectName;
}
[Serializable]
public class SetObjectInfo : PlayFabBaseModel
{
///
/// Name of the object
///
public string ObjectName;
///
/// Optional reason to explain why the operation was the result that it was.
///
public string OperationReason;
///
/// Indicates which operation was completed, either Created, Updated, Deleted or None.
///
public OperationTypes? SetResult;
}
///
/// Sets JSON objects on the requested entity profile. May include a version number to be used to perform optimistic
/// concurrency operations during update. If the current version differs from the version in the request the request will be
/// ignored. If no version is set on the request then the value will always be updated if the values differ. Using the
/// version value does not guarantee a write though, ConcurrentEditError may still occur if multiple clients are attempting
/// to update the same profile.
///
[Serializable]
public class SetObjectsRequest : PlayFabRequestCommon
{
///
/// The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
///
public Dictionary CustomTags;
///
/// The entity to perform this action on.
///
public EntityKey Entity;
///
/// Optional field used for concurrency control. By specifying the previously returned value of ProfileVersion from
/// GetProfile API, you can ensure that the object set will only be performed if the profile has not been updated by any
/// other clients since the version you last loaded.
///
public int? ExpectedProfileVersion;
///
/// Collection of objects to set on the profile.
///
public List Objects;
}
[Serializable]
public class SetObjectsResponse : PlayFabResultCommon
{
///
/// New version of the entity profile.
///
public int ProfileVersion;
///
/// New version of the entity profile.
///
public List SetResults;
}
}
#endif