updateDistributionConfiguration method

Future<UpdateDistributionConfigurationResponse> updateDistributionConfiguration({
  1. required String distributionConfigurationArn,
  2. required List<Distribution> distributions,
  3. String? clientToken,
  4. String? description,
})

Updates 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 InvalidParameterCombinationException.

Parameter distributionConfigurationArn : The Amazon Resource Name (ARN) of the distribution configuration that you want to update.

Parameter distributions : The distributions of the distribution configuration.

Parameter clientToken : The idempotency token of the distribution configuration.

Parameter description : The description of the distribution configuration.

Implementation

Future<UpdateDistributionConfigurationResponse>
    updateDistributionConfiguration({
  required String distributionConfigurationArn,
  required List<Distribution> distributions,
  String? clientToken,
  String? description,
}) async {
  ArgumentError.checkNotNull(
      distributionConfigurationArn, 'distributionConfigurationArn');
  ArgumentError.checkNotNull(distributions, 'distributions');
  _s.validateStringLength(
    'clientToken',
    clientToken,
    1,
    36,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    1024,
  );
  final $payload = <String, dynamic>{
    'distributionConfigurationArn': distributionConfigurationArn,
    'distributions': distributions,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/UpdateDistributionConfiguration',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateDistributionConfigurationResponse.fromJson(response);
}