Beispiel #1
0
        /// <summary>
        /// Deletes a multiplayer server game asset for a title.
        /// </summary>
        public static void DeleteAsset(DeleteAssetRequest request, Action <EmptyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            var context = (request == null ? null : request.AuthenticationContext) ?? PlayFabSettings.staticPlayer;


            PlayFabHttp.MakeApiCall("/MultiplayerServer/DeleteAsset", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context);
        }
        /// <summary>
        /// Deletes a multiplayer server game asset for a title.
        /// </summary>
        public static async Task <PlayFabResult <EmptyResponse> > DeleteAssetAsync(DeleteAssetRequest request, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            if (PlayFabSettings.EntityToken == null)
            {
                throw new PlayFabException(PlayFabExceptionCode.EntityTokenNotSet, "Must call GetEntityToken before calling this method");
            }

            var httpResult = await PlayFabHttp.DoPost("/MultiplayerServer/DeleteAsset", request, "X-EntityToken", PlayFabSettings.EntityToken, extraHeaders);

            if (httpResult is PlayFabError)
            {
                var error = (PlayFabError)httpResult;
                PlayFabSettings.GlobalErrorHandler?.Invoke(error);
                return(new PlayFabResult <EmptyResponse> {
                    Error = error, CustomData = customData
                });
            }

            var resultRawJson = (string)httpResult;
            var resultData    = PluginManager.GetPlugin <ISerializerPlugin>(PluginContract.PlayFab_Serializer).DeserializeObject <PlayFabJsonSuccess <EmptyResponse> >(resultRawJson);
            var result        = resultData.data;

            return(new PlayFabResult <EmptyResponse> {
                Result = result, CustomData = customData
            });
        }
Beispiel #3
0
        public void DeleteAllAssets()
        {
            var deleteAssetOperation = new DeleteAssetOperation {
                Item = new DeleteAllMyAssets()
            };
            var deleteAssetRequest = new DeleteAssetRequest {
                deleteAssetOperation = deleteAssetOperation
            };

            /* pass a local variable as a "ref" parameter, rather than passing the field itself, so
             * the service can't modify what the field refers to */
            CorrelationHeader correlationHeader = _correlationHeader;
            SessionHeader     sessionHeader     = _sessionHeader;

            WarningHeader       warningHeader;
            DeleteAssetResponse deleteAssetResponse;

            _client.DeleteAsset(_applicationHeader,
                                ref correlationHeader,
                                ref sessionHeader,
                                deleteAssetRequest,
                                out warningHeader,
                                out deleteAssetResponse);

            Console.WriteLine("[deleting any previous assets]");
        }
        /// <summary>
        /// Deletes an existing MediaPackage VOD Asset resource.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeleteAsset service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the DeleteAsset service method, as returned by MediaPackageVod.</returns>
        /// <exception cref="Amazon.MediaPackageVod.Model.ForbiddenException">
        /// The client is not authorized to access the requested resource.
        /// </exception>
        /// <exception cref="Amazon.MediaPackageVod.Model.InternalServerErrorException">
        /// An unexpected error occurred.
        /// </exception>
        /// <exception cref="Amazon.MediaPackageVod.Model.NotFoundException">
        /// The requested resource does not exist.
        /// </exception>
        /// <exception cref="Amazon.MediaPackageVod.Model.ServiceUnavailableException">
        /// An unexpected error occurred.
        /// </exception>
        /// <exception cref="Amazon.MediaPackageVod.Model.TooManyRequestsException">
        /// The client has exceeded their resource or throttling limits.
        /// </exception>
        /// <exception cref="Amazon.MediaPackageVod.Model.UnprocessableEntityException">
        /// The parameters sent in the request are not valid.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/mediapackage-vod-2018-11-07/DeleteAsset">REST API Reference for DeleteAsset Operation</seealso>
        public virtual Task <DeleteAssetResponse> DeleteAssetAsync(DeleteAssetRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteAssetRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteAssetResponseUnmarshaller.Instance;

            return(InvokeAsync <DeleteAssetResponse>(request, options, cancellationToken));
        }
        internal virtual DeleteAssetResponse DeleteAsset(DeleteAssetRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeleteAssetRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeleteAssetResponseUnmarshaller.Instance;

            return(Invoke <DeleteAssetResponse>(request, options));
        }
        /// <summary>
        /// Deletes a multiplayer server game asset for a title.
        /// </summary>
        public void DeleteAsset(DeleteAssetRequest request, Action <EmptyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null)
        {
            var context      = (request == null ? null : request.AuthenticationContext) ?? authenticationContext;
            var callSettings = apiSettings ?? PlayFabSettings.staticSettings;

            if (!context.IsEntityLoggedIn())
            {
                throw new PlayFabException(PlayFabExceptionCode.NotLoggedIn, "Must be logged in to call this method");
            }
            PlayFabHttp.MakeApiCall("/MultiplayerServer/DeleteAsset", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders, context, callSettings, this);
        }
Beispiel #7
0
        public async Task <ActionResult> DeleteAsset()
        {
            var assetClient = _mindSphereSdkService.GetAssetManagementClient();
            var request     = new DeleteAssetRequest()
            {
                Id      = "8e775e74a9fa4b4f8fcf15e808d7fb10",
                IfMatch = "5"
            };

            await assetClient.DeleteAssetAsync(request);

            return(StatusCode(204));
        }
 /// <summary>
 /// Deletes a multiplayer server game asset for a title.
 /// </summary>
 public static void DeleteAsset(DeleteAssetRequest request, Action <EmptyResponse> resultCallback, Action <PlayFabError> errorCallback, object customData = null, Dictionary <string, string> extraHeaders = null)
 {
     PlayFabHttp.MakeApiCall("/MultiplayerServer/DeleteAsset", request, AuthType.EntityToken, resultCallback, errorCallback, customData, extraHeaders);
 }