createDistributionConfiguration method

Future<CreateDistributionConfigurationResponse> createDistributionConfiguration({
  1. required List<Distribution> distributions,
  2. required String name,
  3. String? clientToken,
  4. String? description,
  5. Map<String, String>? tags,
})

Creates a new distribution configuration. Distribution configurations define and configure the outputs of your pipeline.

May throw CallRateLimitExceededException. May throw ClientException. May throw ForbiddenException. May throw IdempotentParameterMismatchException. May throw InvalidParameterCombinationException. May throw InvalidRequestException. May throw ResourceAlreadyExistsException. May throw ResourceInUseException. May throw ServiceException. May throw ServiceQuotaExceededException. May throw ServiceUnavailableException.

Parameter distributions : The distributions of the distribution configuration.

Parameter name : The name of the distribution configuration.

Parameter clientToken : Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see Ensuring idempotency in the Amazon EC2 API Reference.

Parameter description : The description of the distribution configuration.

Parameter tags : The tags of the distribution configuration.

Implementation

Future<CreateDistributionConfigurationResponse>
    createDistributionConfiguration({
  required List<Distribution> distributions,
  required String name,
  String? clientToken,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'distributions': distributions,
    'name': name,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/CreateDistributionConfiguration',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDistributionConfigurationResponse.fromJson(response);
}