ship_card method

Future<IssuingCard> ship_card({
  1. required String card,
  2. LoginLinkCreateOptions? options,
})

Updates the shipping status of the specified Issuing Card object to shipped.

Implementation

Future<IssuingCard> ship_card({
  required String card,
  LoginLinkCreateOptions? options,
}) async {
  final $uri = Uri.parse(
      '$_baseUri/v1/test_helpers/issuing/cards/$card/shipping/ship');
  final $request = _$http.Request(
    'POST',
    $uri,
  );
  if (options != null) {
    $request.body = options.encodeWith(coder.formData.encoder);
  }
  $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 IssuingCard.fromJson($json);

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