createCloudConnector method

Future<CreateCloudConnectorResponse> createCloudConnector({
  1. required EndpointConfig endpointConfig,
  2. required String name,
  3. String? clientToken,
  4. String? description,
  5. EndpointType? endpointType,
})

Creates a C2C (cloud-to-cloud) connector.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter endpointConfig : The configuration details for the cloud connector endpoint, including connection parameters and authentication requirements.

Parameter name : The display name of the C2C connector.

Parameter clientToken : An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

Parameter description : A description of the C2C connector.

Parameter endpointType : The type of endpoint used for the cloud connector, which defines how the connector communicates with external services.

Implementation

Future<CreateCloudConnectorResponse> createCloudConnector({
  required EndpointConfig endpointConfig,
  required String name,
  String? clientToken,
  String? description,
  EndpointType? endpointType,
}) async {
  final $payload = <String, dynamic>{
    'EndpointConfig': endpointConfig,
    'Name': name,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (endpointType != null) 'EndpointType': endpointType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/cloud-connectors',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCloudConnectorResponse.fromJson(response);
}