Exemple #1
0
 public static async Task <List <Gym> > GetGymListAsync(this IGymAPI operations, string locale, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGymsWithHttpMessagesAsync(locale, null, cancellationToken).ConfigureAwait(false))
     {
         return((_result.Body as IEnumerable <Gym>).OrderBy(d => d.Name).ToList());
     }
 }
Exemple #2
0
 /// <summary>
 /// Get all the gyms for the specified country and language.
 /// </summary>
 /// <remarks>
 /// Will get an array of gyms for the specific country in the specified
 /// language. If no gyms are found, the result will be an empty array.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locale'>
 /// Language and country specifier for the gyms you want to retrieve. The
 /// format is `{lang}-{country}`, example `/gyms/sv-se`. Note that the locale
 /// is case sensitive.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> GetGymsAsync(this IGymAPI operations, string locale, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetGymsWithHttpMessagesAsync(locale, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemple #3
0
 /// <summary>
 /// Get a specific gym by locale and ID.
 /// </summary>
 /// <remarks>
 /// Will get a specific gym by ID and country/language. If the gym is not found
 /// it will return status 404.
 /// </remarks>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locale'>
 /// Language and country specifier for the gyms you want to retrieve. The
 /// format is `{lang}-{country}`, example `/gyms/sv-se`. Note that the locale
 /// is case sensitive.
 /// </param>
 /// <param name='gymID'>
 /// Unique identifier for the gym you want to retrieve.
 /// </param>
 public static object GetGym(this IGymAPI operations, string locale, string gymID)
 {
     return(operations.GetGymAsync(locale, gymID).GetAwaiter().GetResult());
 }