delete method

Future<DeletedApplePayDomain> delete({
  1. required String domain,
})

Delete an apple pay domain.

Implementation

Future<DeletedApplePayDomain> delete({required String domain}) async {
  final $uri = Uri.parse('$_baseUri/v1/apple_pay/domains/$domain');
  final $request = _$http.Request(
    'DELETE',
    $uri,
  );
  $request.headers['Content-Type'] = 'application/x-www-form-urlencoded';
  $request.headers['Accept'] = 'application/json';
  final $response = await _httpClient.send($request);
  final $body = await $response.stream.toBytes();
  switch ($response.statusCode) {
    /// Successful response.
    case 200:
      final $json = _$convert.jsonDecode(_$convert.utf8.decode($body));
      return DeletedApplePayDomain.fromJson($json);

    /// Error response.
    case _:
      final $json = _$convert.jsonDecode(_$convert.utf8.decode($body));
      throw Error.fromJson($json);
  }
}