private void RemoveUuidMetadata(string uuid, Dictionary <string, object> externalQueryParam, PNCallback <PNRemoveUuidMetadataResult> callback)
        {
            if (string.IsNullOrEmpty(uuid))
            {
                uuid = config.Uuid;
            }

            IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null) ? PubnubInstance.InstanceId : "");

            Uri request = urlBuilder.BuildDeleteUuidMetadataRequest("DELETE", "", uuid, externalQueryParam);

            RequestState <PNRemoveUuidMetadataResult> requestState = new RequestState <PNRemoveUuidMetadataResult>();

            requestState.ResponseType      = PNOperationType.PNDeleteUuidMetadataOperation;
            requestState.PubnubCallback    = callback;
            requestState.Reconnect         = false;
            requestState.EndPointOperation = this;

            UrlProcessRequest(request, requestState, false).ContinueWith(r =>
            {
                string json = r.Result.Item1;
                if (!string.IsNullOrEmpty(json))
                {
                    List <object> result = ProcessJsonResponse(requestState, json);
                    ProcessResponseCallbacks(result, requestState);
                }
            }, TaskContinuationOptions.ExecuteSynchronously).Wait();
        }
        private async Task <PNResult <PNRemoveUuidMetadataResult> > RemoveUuidMetadata(string uuid, Dictionary <string, object> externalQueryParam)
        {
            PNResult <PNRemoveUuidMetadataResult> ret = new PNResult <PNRemoveUuidMetadataResult>();

            if (string.IsNullOrEmpty(uuid))
            {
                uuid = config.Uuid;
            }

            if (string.IsNullOrEmpty(config.SubscribeKey) || string.IsNullOrEmpty(config.SubscribeKey.Trim()) || config.SubscribeKey.Length <= 0)
            {
                PNStatus errStatus = new PNStatus {
                    Error = true, ErrorData = new PNErrorData("Invalid Subscribe key", new ArgumentException("Invalid Subscribe key"))
                };
                ret.Status = errStatus;
                return(ret);
            }

            IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null) ? PubnubInstance.InstanceId : "");

            Uri request = urlBuilder.BuildDeleteUuidMetadataRequest("DELETE", "", uuid, externalQueryParam);

            RequestState <PNRemoveUuidMetadataResult> requestState = new RequestState <PNRemoveUuidMetadataResult>();

            requestState.ResponseType      = PNOperationType.PNDeleteUuidMetadataOperation;
            requestState.Reconnect         = false;
            requestState.EndPointOperation = this;

            Tuple <string, PNStatus> JsonAndStatusTuple = await UrlProcessRequest(request, requestState, false).ConfigureAwait(false);

            ret.Status = JsonAndStatusTuple.Item2;
            string json = JsonAndStatusTuple.Item1;

            if (!string.IsNullOrEmpty(json))
            {
                List <object>              resultList      = ProcessJsonResponse(requestState, json);
                ResponseBuilder            responseBuilder = new ResponseBuilder(config, jsonLibrary, pubnubLog);
                PNRemoveUuidMetadataResult responseResult  = responseBuilder.JsonToObject <PNRemoveUuidMetadataResult>(resultList, true);
                if (responseResult != null)
                {
                    ret.Result = responseResult;
                }
            }

            return(ret);
        }