updateConnection method

Future<void> updateConnection({
  1. required ConnectionInput connectionInput,
  2. required String name,
  3. String? catalogId,
})

Updates a connection definition in the Data Catalog.

May throw InvalidInputException. May throw EntityNotFoundException. May throw OperationTimeoutException. May throw InvalidInputException. May throw GlueEncryptionException.

Parameter connectionInput : A ConnectionInput object that redefines the connection in question.

Parameter name : The name of the connection definition to update.

Parameter catalogId : The ID of the Data Catalog in which the connection resides. If none is provided, the AWS account ID is used by default.

Implementation

Future<void> updateConnection({
  required ConnectionInput connectionInput,
  required String name,
  String? catalogId,
}) async {
  ArgumentError.checkNotNull(connectionInput, 'connectionInput');
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'catalogId',
    catalogId,
    1,
    255,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.UpdateConnection'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConnectionInput': connectionInput,
      'Name': name,
      if (catalogId != null) 'CatalogId': catalogId,
    },
  );
}