createDistribution2020_05_31 method

Future<CreateDistributionResult> createDistribution2020_05_31({
  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.

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 TooManyOriginGroupsPerDistribution. 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 TooManyDistributionsWithSingleFunctionARN. May throw TooManyLambdaFunctionAssociations. May throw InvalidLambdaFunctionAssociation. May throw InvalidOriginReadTimeout. May throw InvalidOriginKeepaliveTimeout. May throw NoSuchFieldLevelEncryptionConfig. May throw IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior. May throw TooManyDistributionsAssociatedToFieldLevelEncryptionConfig. May throw NoSuchCachePolicy. May throw TooManyDistributionsAssociatedToCachePolicy. May throw NoSuchOriginRequestPolicy. May throw TooManyDistributionsAssociatedToOriginRequestPolicy. May throw TooManyDistributionsAssociatedToKeyGroup. May throw TooManyKeyGroupsAssociatedToDistribution. May throw TrustedKeyGroupDoesNotExist.

Parameter distributionConfig : The distribution's configuration information.

Implementation

Future<CreateDistributionResult> createDistribution2020_05_31({
  required DistributionConfig distributionConfig,
}) async {
  ArgumentError.checkNotNull(distributionConfig, 'distributionConfig');
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2020-05-31/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'),
  );
}