postIntegrationsConnectorsByProviderCredential method
Future<CredentialOut?>
postIntegrationsConnectorsByProviderCredential(
- String provider,
- CredentialIn credentialIn
Is the direct intake path: a customer-held token/setup-token (Verify) or an externally obtained OAuth bundle from the CLI's local PKCE (Adopt).
Is the direct intake path: a customer-held token/setup-token (Verify) or an externally obtained OAuth bundle from the CLI's local PKCE (Adopt). ALWAYS verify-before-store: a bad credential is refused and NOTHING is persisted (connectByCredential's fail-closed order).
Parameters:
-
String provider (required): Provider is the user-scoped provider's registry id, from the path.
-
CredentialIn credentialIn (required):
Implementation
Future<CredentialOut?> postIntegrationsConnectorsByProviderCredential(String provider, CredentialIn credentialIn,) async {
final response = await postIntegrationsConnectorsByProviderCredentialWithHttpInfo(provider, credentialIn,);
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), 'CredentialOut',) as CredentialOut;
}
return null;
}