예제 #1
0
        protected async Task <T> RetrieveAsync <T>(IEndpointBuilder builder, GW2RESTConfig config = null)
        {
            if (!string.IsNullOrEmpty(ApiKey))
            {
                if (config == null || config.IgnoreAuthentication == false)
                {
                    builder.AddParameter("access_token", ApiKey);
                }
            }
            string json = await retriever.GetJsonAsync(builder);

            return(deserializer.Deserialize <T>(json));
        }
예제 #2
0
        protected async Task <T> RetrieveAsync <T>(string endpoint, GW2RESTConfig config = null)
        {
            IEndpointBuilder builder = new EndpointBuilder().AddEndpoint(endpoint);

            return(await RetrieveAsync <T>(builder, config));
        }
예제 #3
0
        /// <summary>
        /// Retrieve without an API key.
        /// </summary>
        protected T Retrieve <T>(string endpoint, GW2RESTConfig config = null)
        {
            IEndpointBuilder builder = new EndpointBuilder().AddEndpoint(endpoint);

            return(Retrieve <T>(builder, config));
        }