Class UGCContentApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.UGC
Assembly: solution.dll
Syntax
public class UGCContentApi : IUGCContentApi, IApiAccessor
Constructors
UGCContentApi(IApiClient)
Initializes a new instance of the UGCContentApi class using a Configuration object and client instance.
Declaration
public UGCContentApi(IApiClient apiClient)
Parameters
| Type | Name | Description |
|---|---|---|
| IApiClient | apiClient | The client interface for synchronous API access. |
UGCContentApi(IApiClient, IApiConfiguration)
Initializes a new instance of the UGCContentApi class using a Configuration object and client instance.
Declaration
public UGCContentApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| IApiClient | apiClient | The client interface for synchronous API access. |
| IApiConfiguration | apiConfiguration | The configuration object. |
Properties
Client
The client for accessing this underlying API asynchronously.
Declaration
public IApiClient Client { get; }
Property Value
| Type | Description |
|---|---|
| IApiClient |
Configuration
Gets the configuration object
Declaration
public IApiConfiguration Configuration { get; }
Property Value
| Type | Description |
|---|---|
| IApiConfiguration | An instance of the Configuration |
Methods
CreateContent(string, string, NewContentRequest, CancellationToken)
Create new content item
Declaration
public ApiOperation<UploadContentResponse> CreateContent(string projectId, string environmentId, NewContentRequest newContentRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| NewContentRequest | newContentRequest | Request information for content (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<UploadContentResponse> | The operation |
CreateContentVersion(string, string, string, AddVersionRequest, CancellationToken)
Creates a new version of the content item asset and image
Declaration
public ApiOperation<UploadContentResponse> CreateContentVersion(string projectId, string environmentId, string contentId, AddVersionRequest addVersionRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| AddVersionRequest | addVersionRequest | The AddVersionRequest request sent by the client (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<UploadContentResponse> | The operation |
CreateUserRating(string, string, string, ContentRatingRequest, CancellationToken)
Add a new user rating for content
Declaration
public ApiOperation<ContentUserRatingDTO> CreateUserRating(string projectId, string environmentId, string contentId, ContentRatingRequest contentRatingRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| ContentRatingRequest | contentRatingRequest | Request information for content rating (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentUserRatingDTO> | The operation |
DeleteContent(string, string, string, CancellationToken)
Soft delete a content item
Declaration
public ApiOperation DeleteContent(string projectId, string environmentId, string contentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation | The operation |
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
| Type | Description |
|---|---|
| string | The base path |
GetContent(string, string, string, bool?, CancellationToken)
Get details about a content item
Declaration
public ApiOperation<ContentDTO> GetContent(string projectId, string environmentId, string contentId, bool? includeStatistics = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| bool? | includeStatistics | If content stats should be included in the query (optional, default to false) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDTO> | The operation |
GetContentDownloads(string, string, string, CancellationToken)
Get content statistics
Declaration
public ApiOperation<ContentDownloadStats> GetContentDownloads(string projectId, string environmentId, string contentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDownloadStats> | The operation |
GetContentTrendsList(string, string, string, int?, int?, string, bool?, CancellationToken)
Get content trends
Declaration
public ApiOperation<ContentDTOPagedResult> GetContentTrendsList(string projectId, string environmentId, string trendType, int? offset = null, int? limit = null, string sortBy = null, bool? includeTotal = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project to query content trends |
| string | environmentId | Environment to query content trends |
| string | trendType | Trend type: TopRated, MostDownloaded, Newest, Popular, Trending, Engaging |
| int? | offset | The amount of results to skip (optional) |
| int? | limit | The amount of results to take (optional) |
| string | sortBy | The field to use to sort by in order, prefix - for descending (optional) |
| bool? | includeTotal | Should the result include the total count of objects available to page (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDTOPagedResult> | The operation |
GetUserRating(string, string, string, CancellationToken)
Get content rating for user
Declaration
public ApiOperation<ContentUserRatingDTO> GetUserRating(string projectId, string environmentId, string contentId, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentUserRatingDTO> | The operation |
SearchContent(string, string, int?, int?, List<string>, string, List<string>, List<string>, bool?, bool?, CancellationToken)
Search all content items in a given project and environment
Declaration
public ApiOperation<ContentDTOPagedResult> SearchContent(string projectId, string environmentId, int? offset = null, int? limit = null, List<string> sortBys = null, string search = null, List<string> tags = null, List<string> filters = null, bool? includeTotal = null, bool? includeStatistics = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Content that belongs to this project |
| string | environmentId | Content that belongs to this environment |
| int? | offset | The amount of results to skip (optional) |
| int? | limit | The amount of results to take (optional) |
| List<string> | sortBys | The field to use to sort by in ascending order, prefix - for descending (optional) |
| string | search | Only return results with this search term in their name (optional) |
| List<string> | tags | Only return results with these tags (optional) |
| List<string> | filters | You can filter on any field in the DTO<br /> Syntax for filters is: {field},{operator},{value}<br /> The operators are: eq (equal to), neq (not equal to), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal)<br /> The field can be nested up to two levels. Ex: "field.nestedField.nestedNestedField"<br /> filters="deletedAt,eq,null" will only return entities that have not been deleted<br /> (optional) |
| bool? | includeTotal | Should the result include the total count of objects available to page (optional) |
| bool? | includeStatistics | If content stats should be included in the content DTO (optional, default to false) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDTOPagedResult> | The operation |
SearchPlayerContent(int?, int?, List<string>, string, List<string>, bool?, bool?, CancellationToken)
Search all player content items
Declaration
public ApiOperation<ContentDTOPagedResult> SearchPlayerContent(int? offset = null, int? limit = null, List<string> sortBys = null, string search = null, List<string> filters = null, bool? includeTotal = null, bool? includeStatistics = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | offset | The amount of results to skip (optional) |
| int? | limit | The amount of results to take (optional) |
| List<string> | sortBys | The field to use to sort by in ascending order, prefix - for descending (optional) |
| string | search | Only return results with this search term in their name (optional) |
| List<string> | filters | You can filter on any field in the DTO<br /> Syntax for filters is: {field},{operator},{value}<br /> The operators are: eq (equal to), neq (not equal to), gt (greater than), gte (greater than or equal), lt (less than), lte (less than or equal)<br /> The field can be nested up to two levels. Ex: "field.nestedField.nestedNestedField"<br /> filters="deletedAt,eq,null" will only return entities that have not been deleted<br /> (optional) |
| bool? | includeTotal | Should the result include the total count of objects available to page (optional) |
| bool? | includeStatistics | If content stats should be included in the content DTO (optional, default to false) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDTOPagedResult> | The operation |
UpdateContentVisibility(string, string, string, UpdateContentVisibilityRequest, CancellationToken)
Update content visibility
Declaration
public ApiOperation<ContentDTO> UpdateContentVisibility(string projectId, string environmentId, string contentId, UpdateContentVisibilityRequest updateContentVisibilityRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| UpdateContentVisibilityRequest | updateContentVisibilityRequest | Request information for content (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDTO> | The operation |
UpdateDetails(string, string, string, UpdateContentRequest, CancellationToken)
Update details about a content item
Declaration
public ApiOperation<ContentDTO> UpdateDetails(string projectId, string environmentId, string contentId, UpdateContentRequest updateContentRequest = null, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | projectId | Project that this content belongs to |
| string | environmentId | Environment that this content belongs to |
| string | contentId | Content id |
| UpdateContentRequest | updateContentRequest | Request information for content (optional) |
| CancellationToken | cancellationToken | Cancellation Token to cancel the request. |
Returns
| Type | Description |
|---|---|
| ApiOperation<ContentDTO> | The operation |