internal async Task <PNResult <PNChannelGroupsListAllResult> > GetAllChannelGroup(Dictionary <string, object> externalQueryParam)
        {
            PNResult <PNChannelGroupsListAllResult> ret = new PNResult <PNChannelGroupsListAllResult>();

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

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

            requestState.ResponseType      = PNOperationType.ChannelGroupAllGet;
            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);
                PNChannelGroupsListAllResult responseResult = responseBuilder.JsonToObject <PNChannelGroupsListAllResult>(resultList, true);
                if (responseResult != null)
                {
                    ret.Result = responseResult;
                }
            }

            return(ret);
        }
Example #2
0
        internal void GetAllChannelGroup(PNCallback <PNChannelGroupsListAllResult> callback)
        {
            IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit);

            Uri request = urlBuilder.BuildGetAllChannelGroupRequest();

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

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

            string json = UrlProcessRequest <PNChannelGroupsListAllResult>(request, requestState, false);

            if (!string.IsNullOrEmpty(json))
            {
                List <object> result = ProcessJsonResponse <PNChannelGroupsListAllResult>(requestState, json);
                ProcessResponseCallbacks(result, requestState);
            }
        }
        internal void GetAllChannelGroup(Dictionary <string, object> externalQueryParam, PNCallback <PNChannelGroupsListAllResult> callback)
        {
            IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null) ? PubnubInstance.InstanceId : "");
            Uri request = urlBuilder.BuildGetAllChannelGroupRequest("GET", "", externalQueryParam);

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

            requestState.ResponseType      = PNOperationType.ChannelGroupAllGet;
            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();
        }
        internal void GetAllChannelGroup(Dictionary <string, object> externalQueryParam, PNCallback <PNChannelGroupsListAllResult> callback)
        {
            IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr);

            urlBuilder.PubnubInstanceId = (PubnubInstance != null) ? PubnubInstance.InstanceId : "";

            Uri request = urlBuilder.BuildGetAllChannelGroupRequest(externalQueryParam);

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

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

            string json = UrlProcessRequest <PNChannelGroupsListAllResult>(request, requestState, false);

            if (!string.IsNullOrEmpty(json))
            {
                List <object> result = ProcessJsonResponse <PNChannelGroupsListAllResult>(requestState, json);
                ProcessResponseCallbacks(result, requestState);
            }
        }