* gaflight_client_new: * @location: A #GAFlightLocation to be connected. * @options: (nullable): A #GAFlightClientOptions. * @error: (nullable): Return location for a #GError or %NULL. * * Returns: (nullable): The newly created client, %NULL on error. * * Since: 5.0.0 */
| 790 | * Since: 5.0.0 |
| 791 | */ |
| 792 | GAFlightClient * |
| 793 | gaflight_client_new(GAFlightLocation *location, |
| 794 | GAFlightClientOptions *options, |
| 795 | GError **error) |
| 796 | { |
| 797 | const auto flight_location = gaflight_location_get_raw(location); |
| 798 | arrow::Result<std::unique_ptr<arrow::flight::FlightClient>> result; |
| 799 | if (options) { |
| 800 | const auto flight_options = gaflight_client_options_get_raw(options); |
| 801 | result = arrow::flight::FlightClient::Connect(*flight_location, *flight_options); |
| 802 | } else { |
| 803 | result = arrow::flight::FlightClient::Connect(*flight_location); |
| 804 | } |
| 805 | if (garrow::check(error, result, "[flight-client][new]")) { |
| 806 | std::shared_ptr<arrow::flight::FlightClient> flight_client = std::move(*result); |
| 807 | return gaflight_client_new_raw(&flight_client); |
| 808 | } else { |
| 809 | return NULL; |
| 810 | } |
| 811 | } |
| 812 | |
| 813 | /** |
| 814 | * gaflight_client_close: |
nothing calls this directly
no test coverage detected