updateStreamingDistribution2018_06_18 method

Future<UpdateStreamingDistributionResult> updateStreamingDistribution2018_06_18(
  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>
    updateStreamingDistribution2018_06_18({
  @_s.required String id,
  @_s.required StreamingDistributionConfig streamingDistributionConfig,
  String ifMatch,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  ArgumentError.checkNotNull(
      streamingDistributionConfig, 'streamingDistributionConfig');
  final headers = <String, String>{};
  ifMatch?.let((v) => headers['If-Match'] = v.toString());
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri:
        '/2018-06-18/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'),
  );
}