shouldThrottle method

  1. @Deprecated('Not supported. Member documentation may have more information.')
Future<ShouldThrottleResponse> shouldThrottle(
  1. String name, {
  2. int? port,
  3. String? requestedAmount,
  4. String? $fields,
})

Calls the Bouncer method ShouldThrottle to check if a request should be throttled.

Request parameters:

name - Required. Name of the resource Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/appGateways/\[^/\]+$.

port - Optional. The port that is being throttled

requestedAmount - Optional. The current throughput through the port (mbps)

$fields - Selector specifying which fields to include in a partial response.

Completes with a ShouldThrottleResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

@core.Deprecated(
  'Not supported. Member documentation may have more information.',
)
async.Future<ShouldThrottleResponse> shouldThrottle(
  core.String name, {
  core.int? port,
  core.String? requestedAmount,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (port != null) 'port': ['${port}'],
    if (requestedAmount != null) 'requestedAmount': [requestedAmount],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name') + ':shouldThrottle';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ShouldThrottleResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}