Interface IUgcService
This interface describes the UGC related methods available to game clients.
Namespace: Unity.Services.Ugc
Assembly: Unity.Services.Ugc.dll
Syntax
public interface IUgcService
Methods
ApproveContentAsync(string)
Approve content that needed moderation.
Declaration
Task<Content> ApproveContentAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task<Content> | The approved content |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
CreateContentAsync(CreateContentArgs)
Create a new content in a project environment
Declaration
Task<Content> CreateContentAsync(CreateContentArgs createContentArgs)
Parameters
Type | Name | Description |
---|---|---|
CreateContentArgs | createContentArgs | Contains all the parameters of the request |
Returns
Type | Description |
---|---|
Task<Content> | The content that will be eventually available once the upload has been uploaded. |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
CreateContentVersionAsync(string, Stream, Stream)
Create a new version of a content.
Declaration
Task<Content> CreateContentVersionAsync(string contentId, Stream asset, Stream thumbnail = null)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Stream | asset | The stream containing the binary payload of the content |
Stream | thumbnail | The stream containing the image representing the content |
Returns
Type | Description |
---|---|
Task<Content> | The content that will be eventually available once the upload has been uploaded. |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
CreateRepresentationAsync(CreateRepresentationArgs)
Create a new representation of a content
Declaration
Task<Representation> CreateRepresentationAsync(CreateRepresentationArgs createRepresentationArgs)
Parameters
Type | Name | Description |
---|---|---|
CreateRepresentationArgs | createRepresentationArgs | Contains all the parameters of the request |
Returns
Type | Description |
---|---|
Task<Representation> | The created representation |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
CreateRepresentationVersionAsync(string, string, Stream)
Create a representation version.
Declaration
Task<RepresentationVersion> CreateRepresentationVersionAsync(string contentId, string representationId, Stream asset)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
string | representationId | The representation identifier |
Stream | asset | The stream containing the binary payload of the representation version |
Returns
Type | Description |
---|---|
Task<RepresentationVersion> | The representation. |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
CreateSubscriptionAsync(string)
Subscribe to the content for the current user
Declaration
Task<Subscription> CreateSubscriptionAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task<Subscription> | The created subscription |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
DeleteContentAsync(string)
Delete a content
Declaration
Task DeleteContentAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task | A task |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
DeleteRepresentationAsync(DeleteRepresentationArgs)
Delete representation
Declaration
Task DeleteRepresentationAsync(DeleteRepresentationArgs deleteRepresentationArgs)
Parameters
Type | Name | Description |
---|---|---|
DeleteRepresentationArgs | deleteRepresentationArgs | The id of the representation to delete |
Returns
Type | Description |
---|---|
Task | A task |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
DeleteSubscriptionAsync(string)
Unsubscribe to the content for the current user
Declaration
Task DeleteSubscriptionAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task | A task |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
DownloadContentDataAsync(Content, bool, bool)
Download data and/or thumbnail of a content
Declaration
Task DownloadContentDataAsync(Content content, bool downloadContent, bool downloadThumbnail)
Parameters
Type | Name | Description |
---|---|---|
Content | content | The content that will have its data downloaded |
bool | downloadContent | True if we want to download the content's data |
bool | downloadThumbnail | True if we want to download the content's thumbnail |
Returns
Type | Description |
---|---|
Task | The downloaded data will be put in the |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetContentAsync(GetContentArgs)
Get a specific content.
Declaration
Task<Content> GetContentAsync(GetContentArgs getContentArgs)
Parameters
Type | Name | Description |
---|---|---|
GetContentArgs | getContentArgs | Contains all the parameters of the request |
Returns
Type | Description |
---|---|
Task<Content> | The requested content |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetContentTrendsAsync(GetContentTrendsArgs)
Get content by ContentTrendType
Declaration
Task<PagedResults<Content>> GetContentTrendsAsync(GetContentTrendsArgs getContentTrendsArgs = null)
Parameters
Type | Name | Description |
---|---|---|
GetContentTrendsArgs | getContentTrendsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Content>> | A list of contents of this trend type, with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetContentVersionsAsync(GetContentVersionsArgs)
Get content versions of a content.
Declaration
Task<PagedResults<ContentVersion>> GetContentVersionsAsync(GetContentVersionsArgs getContentVersionsArgs)
Parameters
Type | Name | Description |
---|---|---|
GetContentVersionsArgs | getContentVersionsArgs | Contains all the parameters of the request |
Returns
Type | Description |
---|---|
Task<PagedResults<ContentVersion>> | The list of versions associated with the content with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetContentsAsync(GetContentsArgs)
Get all content from a project specific environment. Content with visibility set to Hidden or with ModerationStatus different from Approved won't be returned. Deleted contents and ones that haven't finished uploading won't be returned either.
Declaration
Task<PagedResults<Content>> GetContentsAsync(GetContentsArgs getContentsArgs = null)
Parameters
Type | Name | Description |
---|---|---|
GetContentsArgs | getContentsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Content>> | A list of contents from the environment with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetPlayerContentsAsync(GetPlayerContentsArgs)
Get all content created by the current signed in player
Declaration
Task<PagedResults<Content>> GetPlayerContentsAsync(GetPlayerContentsArgs getPlayerContentsArgs = null)
Parameters
Type | Name | Description |
---|---|---|
GetPlayerContentsArgs | getPlayerContentsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Content>> | A list of contents from the environment with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetRepresentationAsync(GetRepresentationArgs)
Get a specific representation of a content
Declaration
Task<Representation> GetRepresentationAsync(GetRepresentationArgs getRepresentationArgs)
Parameters
Type | Name | Description |
---|---|---|
GetRepresentationArgs | getRepresentationArgs | Contains all the parameters of the request |
Returns
Type | Description |
---|---|
Task<Representation> | The representation |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetRepresentationVersionsAsync(GetRepresentationVersionsArgs)
Get versions of a representation
Declaration
Task<PagedResults<RepresentationVersion>> GetRepresentationVersionsAsync(GetRepresentationVersionsArgs getRepresentationVersionsArgs)
Parameters
Type | Name | Description |
---|---|---|
GetRepresentationVersionsArgs | getRepresentationVersionsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<RepresentationVersion>> | A list of versions of a specific representation with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetRepresentationsAsync(GetRepresentationsArgs)
Get representations of a content
Declaration
Task<PagedResults<Representation>> GetRepresentationsAsync(GetRepresentationsArgs getRepresentationsArgs)
Parameters
Type | Name | Description |
---|---|---|
GetRepresentationsArgs | getRepresentationsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Representation>> | A list of representations of specific content with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetSubscriptionsAsync(GetSubscriptionsArgs)
Get all subscriptions of the current user
Declaration
Task<PagedResults<Subscription>> GetSubscriptionsAsync(GetSubscriptionsArgs getSubscriptionsArgs)
Parameters
Type | Name | Description |
---|---|---|
GetSubscriptionsArgs | getSubscriptionsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Subscription>> | A list of subscriptions of the current user with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetTagsAsync()
Get a list of tags associated with the project
Declaration
Task<List<Tag>> GetTagsAsync()
Returns
Type | Description |
---|---|
Task<List<Tag>> | A list of tags |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
GetUserContentRatingAsync(string)
Get the rating of a content.
Declaration
Task<ContentUserRating> GetUserContentRatingAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task<ContentUserRating> | The rating of the content |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
IsSubscribedToAsync(string)
Check if the current user is subscribed to the content
Declaration
Task<bool> IsSubscribedToAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task<bool> | true if the content is subscribed to, false otherwise |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
RejectContentAsync(string)
Reject content that needed moderation.
Declaration
Task<Content> RejectContentAsync(string contentId)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
Returns
Type | Description |
---|---|
Task<Content> | The rejected content |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
ReportContentAsync(ReportContentArgs)
Report a content
Declaration
Task<Content> ReportContentAsync(ReportContentArgs reportContentArgs)
Parameters
Type | Name | Description |
---|---|---|
ReportContentArgs | reportContentArgs | The details of the report request |
Returns
Type | Description |
---|---|
Task<Content> | The reported content |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
SearchContentModerationAsync(SearchContentModerationArgs)
Search for content that needs moderation in the project.
Declaration
Task<PagedResults<Content>> SearchContentModerationAsync(SearchContentModerationArgs searchContentModerationArgs)
Parameters
Type | Name | Description |
---|---|---|
SearchContentModerationArgs | searchContentModerationArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Content>> | A list of contents requiring moderation with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
SearchRepresentationsAsync(SearchRepresentationsArgs)
Search representations within a project
Declaration
Task<PagedResults<Representation>> SearchRepresentationsAsync(SearchRepresentationsArgs searchRepresentationsArgs)
Parameters
Type | Name | Description |
---|---|---|
SearchRepresentationsArgs | searchRepresentationsArgs | The details of the search request |
Returns
Type | Description |
---|---|
Task<PagedResults<Representation>> | A list of representations within a project with pagination information |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
SubmitUserContentRatingAsync(string, float)
Submit a user rating of a content
Declaration
Task<ContentUserRating> SubmitUserContentRatingAsync(string contentId, float rating)
Parameters
Type | Name | Description |
---|---|---|
string | contentId | The content identifier |
float | rating | The rating value |
Returns
Type | Description |
---|---|
Task<ContentUserRating> | The rating |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
UpdateContentDetailsAsync(UpdateContentDetailsArgs)
Update a specific content details.
Declaration
Task<Content> UpdateContentDetailsAsync(UpdateContentDetailsArgs updateContentDetailsArgs)
Parameters
Type | Name | Description |
---|---|---|
UpdateContentDetailsArgs | updateContentDetailsArgs | The details of the update request |
Returns
Type | Description |
---|---|
Task<Content> | The updated content |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|
UpdateRepresentationAsync(UpdateRepresentationArgs)
Update a specific representation.
Declaration
Task<Representation> UpdateRepresentationAsync(UpdateRepresentationArgs updateRepresentationArgs)
Parameters
Type | Name | Description |
---|---|---|
UpdateRepresentationArgs | updateRepresentationArgs | The details of the update request |
Returns
Type | Description |
---|---|
Task<Representation> | The updated representation |
Exceptions
Type | Condition |
---|---|
UgcException | Thrown if request is unsuccessful due to UGC Service specific issues.
|
RequestFailedException | Thrown if request is unsuccessful due to common services issues.
|