Beispiel #1
0
        /// <summary>
        /// Asynchronously Retrieve Geolocations, with support for cancellation.
        /// </summary>
        /// <remarks>
        /// Retrieves a list of geolocations associated with your company, with
        /// optional filters to narrow down the results.
        /// </remarks>
        /// <param name="filter">
        /// An instance of the <see cref="GeolocationFilter"/> class, for narrowing down the results.
        /// </param>
        /// <param name="options">
        /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
        /// </param>
        /// <param name="cancellationToken">
        /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>
        /// An enumerable set of <see cref="Geolocation"/> objects, along with an output
        /// instance of the <see cref="ResultsMeta"/> class containing additional data.
        /// </returns>
        public async Task <(IList <Geolocation>, ResultsMeta)> GetGeolocationsAsync(
            GeolocationFilter filter,
            RequestOptions options,
            CancellationToken cancellationToken)
        {
            var context = new GetContext <Geolocation>(EndpointName.Geolocations, filter, options);

            await ExecuteOperationAsync(context, cancellationToken).ConfigureAwait(false);

            return(context.Results.Items, context.ResultsMeta);
        }
Beispiel #2
0
 /// <summary>
 /// Asynchronously Retrieve Geolocations, with support for cancellation.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of geolocations associated with your company, with
 /// optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="GeolocationFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="cancellationToken">
 /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Geolocation"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <Geolocation>, ResultsMeta)> GetGeolocationsAsync(
     GeolocationFilter filter,
     CancellationToken cancellationToken)
 {
     return(await GetGeolocationsAsync(filter, null, cancellationToken).ConfigureAwait(false));
 }
Beispiel #3
0
 /// <summary>
 /// Asynchronously Retrieve Geolocations.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of geolocations associated with your company, with
 /// optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="GeolocationFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="options">
 /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Geolocation"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public async Task <(IList <Geolocation>, ResultsMeta)> GetGeolocationsAsync(
     GeolocationFilter filter,
     RequestOptions options)
 {
     return(await GetGeolocationsAsync(filter, options, default).ConfigureAwait(false));
 }
Beispiel #4
0
 /// <summary>
 /// Retrieve Geolocations.
 /// </summary>
 /// <remarks>
 /// Retrieves a list of geolocations associated with your company, with
 /// optional filters to narrow down the results.
 /// </remarks>
 /// <param name="filter">
 /// An instance of the <see cref="GeolocationFilter"/> class, for narrowing down the results.
 /// </param>
 /// <param name="options">
 /// An instance of the <see cref="RequestOptions"/> class, for customizing method processing.
 /// </param>
 /// <returns>
 /// An enumerable set of <see cref="Geolocation"/> objects, along with an output
 /// instance of the <see cref="ResultsMeta"/> class containing additional data.
 /// </returns>
 public (IList <Geolocation>, ResultsMeta) GetGeolocations(
     GeolocationFilter filter,
     RequestOptions options)
 {
     return(AsyncUtil.RunSync(() => GetGeolocationsAsync(filter, options)));
 }