/// <summary> /// Get player information Get information about a single player by player tag. Player tags can be found either in game or by from clan member lists. Note that player tags start with hash character '#' and that needs to be URL-encoded properly to work in URL, so for example player tag '#2ABC' would become '%232ABC' in the URL. /// </summary> /// <exception cref="CocApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="playerTag">Tag of the player.</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of Player</returns> public async System.Threading.Tasks.Task <Player?> FetchPlayerOrDefaultAsync(string playerTag, System.Threading.CancellationToken?cancellationToken = null) { CocApi.Client.ApiResponse <Player> result = await FetchPlayerResponseAsync(playerTag, cancellationToken).ConfigureAwait(false); return(result.IsSuccessStatusCode ? result.Data : null); }
/// <summary> /// List clan labels List clan labels /// </summary> /// <exception cref="CocApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="limit">Limit the number of items returned in the response. (optional)</param> /// <param name="after">Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both. (optional)</param> /// <param name="before">Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both. (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of LabelsObject</returns> public async System.Threading.Tasks.Task <LabelsObject?> FetchClanLabelsOrDefaultAsync(int?limit = null, string?after = null, string?before = null, System.Threading.CancellationToken?cancellationToken = null) { CocApi.Client.ApiResponse <LabelsObject> result = await FetchClanLabelsResponseAsync(limit, after, before, cancellationToken).ConfigureAwait(false); return(result.IsSuccessStatusCode ? result.Data : null); }
/// <summary> /// Get player information Get information about a single player by player tag. Player tags can be found either in game or by from clan member lists. Note that player tags start with hash character '#' and that needs to be URL-encoded properly to work in URL, so for example player tag '#2ABC' would become '%232ABC' in the URL. /// </summary> /// <exception cref="CocApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="playerTag">Tag of the player.</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of Player</returns> public async System.Threading.Tasks.Task <Player> FetchPlayerAsync(string playerTag, System.Threading.CancellationToken?cancellationToken = null) { CocApi.Client.ApiResponse <Player> result = await FetchPlayerResponseAsync(playerTag, cancellationToken).ConfigureAwait(false); return(result.Data ?? throw new NullReferenceException()); }
/// <summary> /// List clan labels List clan labels /// </summary> /// <exception cref="CocApi.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="limit">Limit the number of items returned in the response. (optional)</param> /// <param name="after">Return only items that occur after this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both. (optional)</param> /// <param name="before">Return only items that occur before this marker. Before marker can be found from the response, inside the 'paging' property. Note that only after or before can be specified for a request, not both. (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of LabelsObject</returns> public async System.Threading.Tasks.Task <LabelsObject> FetchClanLabelsAsync(int?limit = null, string?after = null, string?before = null, System.Threading.CancellationToken?cancellationToken = null) { CocApi.Client.ApiResponse <LabelsObject> result = await FetchClanLabelsResponseAsync(limit, after, before, cancellationToken).ConfigureAwait(false); return(result.Data ?? throw new NullReferenceException()); }