postIntegrationsByProviderDisconnect method

Future<DisconnectOut?> postIntegrationsByProviderDisconnect(
  1. String provider
)

Revokes (best-effort) and forgets an org's connection: it deletes every custodied KMS secret and the connection row.

Revokes (best-effort) and forgets an org's connection: it deletes every custodied KMS secret and the connection row. Idempotent — disconnecting a provider that was never connected still returns {disconnected:true}. Symmetric with connect: an AdminOnly connector needs the caller's own-org admin bit.

Parameters:

  • String provider (required): Provider is the registry id of the connector — "slack", "github", "cloudflare". Unknown ids are 404, as are the user-plane (/v1/integrations/connectors) providers, which this surface never resolves.

Implementation

Future<DisconnectOut?> postIntegrationsByProviderDisconnect(String provider,) async {
  final response = await postIntegrationsByProviderDisconnectWithHttpInfo(provider,);
  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), 'DisconnectOut',) as DisconnectOut;

  }
  return null;
}