postIntegrationsConnectorsByProviderDevice method

Future<DeviceStartOut?> postIntegrationsConnectorsByProviderDevice(
  1. String provider,
  2. DeviceStartIn deviceStartIn
)

Begins a device sign-in and returns the code to show the user plus how to poll for completion.

Begins a device sign-in and returns the code to show the user plus how to poll for completion. KMS readiness is checked NOW rather than dead-ending the user at poll-done (connect() parity), and the per-provider connector cap is checked before the provider is called. The provider's device code is persisted only in the encrypted grants table and is NEVER returned.

Parameters:

  • String provider (required): Provider is the user-scoped provider's registry id, from the path.

  • DeviceStartIn deviceStartIn (required):

Implementation

Future<DeviceStartOut?> postIntegrationsConnectorsByProviderDevice(String provider, DeviceStartIn deviceStartIn,) async {
  final response = await postIntegrationsConnectorsByProviderDeviceWithHttpInfo(provider, deviceStartIn,);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceStartOut',) as DeviceStartOut;

  }
  return null;
}