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 ServiceException. May throw ClientException. May throw ServiceUnavailableException. May throw InvalidRequestException. May throw IdempotentParameterMismatchException. May throw ForbiddenException. May throw CallRateLimitExceededException. May throw ResourceInUseException. May throw ResourceAlreadyExistsException. May throw InvalidParameterCombinationException. May throw ServiceQuotaExceededException.

Parameter distributions : The distributions of the distribution configuration.

Parameter name : The name of the distribution configuration.

Parameter clientToken : The idempotency token of the distribution configuration.

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 {
  ArgumentError.checkNotNull(distributions, 'distributions');
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    36,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    1024,
  );
  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);
}