updateStreamingDistribution2020_05_31 method

Future<UpdateStreamingDistributionResult> updateStreamingDistribution2020_05_31({
  1. required String id,
  2. required StreamingDistributionConfig streamingDistributionConfig,
  3. String? ifMatch,
})

Update a streaming distribution.

May throw AccessDenied. May throw CNAMEAlreadyExists. May throw IllegalUpdate. May throw InvalidIfMatchVersion. May throw MissingBody. May throw NoSuchStreamingDistribution. May throw PreconditionFailed. May throw TooManyStreamingDistributionCNAMEs. May throw InvalidArgument. May throw InvalidOriginAccessIdentity. May throw TooManyTrustedSigners. May throw TrustedSignerDoesNotExist. May throw InconsistentQuantities.

Parameter id : The streaming distribution's id.

Parameter streamingDistributionConfig : The streaming distribution's configuration information.

Parameter ifMatch : The value of the ETag header that you received when retrieving the streaming distribution's configuration. For example: E2QWRUHAPOMQZL.

Implementation

Future<UpdateStreamingDistributionResult>
    updateStreamingDistribution2020_05_31({
  required String id,
  required StreamingDistributionConfig streamingDistributionConfig,
  String? ifMatch,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  ArgumentError.checkNotNull(
      streamingDistributionConfig, 'streamingDistributionConfig');
  final headers = <String, String>{
    if (ifMatch != null) 'If-Match': ifMatch.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri:
        '/2020-05-31/streaming-distribution/${Uri.encodeComponent(id)}/config',
    headers: headers,
    payload: streamingDistributionConfig.toXml('StreamingDistributionConfig'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return UpdateStreamingDistributionResult(
    streamingDistribution: StreamingDistribution.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}