createDistribution2018_06_18 method

Future<CreateDistributionResult> createDistribution2018_06_18({
  1. required DistributionConfig distributionConfig,
})

Creates a new web distribution. You create a CloudFront distribution to tell CloudFront where you want content to be delivered from, and the details about how to track and manage content delivery. Send a POST request to the /CloudFront API version/distribution/distribution ID resource. If you are using Adobe Flash Media Server's RTMP protocol, you set up a different kind of CloudFront distribution. For more information, see CreateStreamingDistribution.

May throw CNAMEAlreadyExists. May throw DistributionAlreadyExists. May throw InvalidOrigin. May throw InvalidOriginAccessIdentity. May throw AccessDenied. May throw TooManyTrustedSigners. May throw TrustedSignerDoesNotExist. May throw InvalidViewerCertificate. May throw InvalidMinimumProtocolVersion. May throw MissingBody. May throw TooManyDistributionCNAMEs. May throw TooManyDistributions. May throw InvalidDefaultRootObject. May throw InvalidRelativePath. May throw InvalidErrorCode. May throw InvalidResponseCode. May throw InvalidArgument. May throw InvalidRequiredProtocol. May throw NoSuchOrigin. May throw TooManyOrigins. May throw TooManyCacheBehaviors. May throw TooManyCookieNamesInWhiteList. May throw InvalidForwardCookies. May throw TooManyHeadersInForwardedValues. May throw InvalidHeadersForS3Origin. May throw InconsistentQuantities. May throw TooManyCertificates. May throw InvalidLocationCode. May throw InvalidGeoRestrictionParameter. May throw InvalidProtocolSettings. May throw InvalidTTLOrder. May throw InvalidWebACLId. May throw TooManyOriginCustomHeaders. May throw TooManyQueryStringParameters. May throw InvalidQueryStringParameters. May throw TooManyDistributionsWithLambdaAssociations. May throw TooManyLambdaFunctionAssociations. May throw InvalidLambdaFunctionAssociation. May throw InvalidOriginReadTimeout. May throw InvalidOriginKeepaliveTimeout. May throw NoSuchFieldLevelEncryptionConfig. May throw IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior. May throw TooManyDistributionsAssociatedToFieldLevelEncryptionConfig.

Parameter distributionConfig : The distribution's configuration information.

Implementation

Future<CreateDistributionResult> createDistribution2018_06_18({
  required DistributionConfig distributionConfig,
}) async {
  ArgumentError.checkNotNull(distributionConfig, 'distributionConfig');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2018-06-18/distribution',
    payload: distributionConfig.toXml('DistributionConfig'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreateDistributionResult(
    distribution: Distribution.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}