Exemplo n.º 1
0
        private async Task <T> GetCollectionMethod <T>(int collectionId, CollectionMethods collectionMethod, string language = null, CancellationToken cancellationToken = default(CancellationToken)) where T : new()
        {
            RestRequest req = _client.Create("collection/{collectionId}/{method}");

            req.AddUrlSegment("collectionId", collectionId.ToString());
            req.AddUrlSegment("method", collectionMethod.GetDescription());

            if (language != null)
            {
                req.AddParameter("language", language);
            }

            RestResponse <T> resp = await req.ExecuteGet <T>(cancellationToken).ConfigureAwait(false);

            return(resp);
        }
Exemplo n.º 2
0
        private T GetCollectionMethod <T>(int collectionId, CollectionMethods collectionMethod, string language = null) where T : new()
        {
            RestRequest req = new RestRequest("collection/{collectionId}/{method}");

            req.AddUrlSegment("collectionId", collectionId.ToString());
            req.AddUrlSegment("method", collectionMethod.GetDescription());

            if (language != null)
            {
                req.AddParameter("language", language);
            }

            IRestResponse <T> resp = _client.Get <T>(req);

            return(resp.Data);
        }
Exemplo n.º 3
0
        private async Task <T> GetCollectionMethod <T>(int collectionId, CollectionMethods collectionMethod, string language = null) where T : new()
        {
            RestRequest req = new RestRequest("collection/{collectionId}/{method}");

            req.AddUrlSegment("collectionId", collectionId.ToString());
            req.AddUrlSegment("method", collectionMethod.GetDescription());

            if (language != null)
            {
                req.AddParameter("language", language);
            }

            IRestResponse <T> resp = await _client.ExecuteGetTaskAsync <T>(req).ConfigureAwait(false);

            return(resp.Data);
        }