Update a distribution.
/// <summary> /// Update a distribution. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDistribution service method.</param> /// /// <returns>The response from the UpdateDistribution service method, as returned by CloudFront.</returns> /// <exception cref="Amazon.CloudFront.Model.AccessDeniedException"> /// Access denied. /// </exception> /// <exception cref="Amazon.CloudFront.Model.CNAMEAlreadyExistsException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.IllegalUpdateException"> /// Origin and CallerReference cannot be updated. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InconsistentQuantitiesException"> /// The value of Quantity and the size of Items do not match. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidArgumentException"> /// The argument is invalid. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidDefaultRootObjectException"> /// The default root object file name is too big or contains an invalid character. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidErrorCodeException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidForwardCookiesException"> /// Your request contains forward cookies option which doesn't match with the expectation /// for the whitelisted list of cookie names. Either list of cookie names has been specified /// when not allowed or list of cookie names is missing when expected. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidGeoRestrictionParameterException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidHeadersForS3OriginException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidIfMatchVersionException"> /// The If-Match version is missing or not valid for the distribution. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidLocationCodeException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidMinimumProtocolVersionException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidOriginAccessIdentityException"> /// The origin access identity is not valid or doesn't exist. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidRelativePathException"> /// The relative path is too big, is not URL-encoded, or does not begin with a slash (/). /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidRequiredProtocolException"> /// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS protocol /// in your request, or omit the RequiredProtocols element from your distribution configuration. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidResponseCodeException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidTTLOrderException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidViewerCertificateException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.MissingBodyException"> /// This operation requires a body. Ensure that the body is present and the Content-Type /// header is set. /// </exception> /// <exception cref="Amazon.CloudFront.Model.NoSuchDistributionException"> /// The specified distribution does not exist. /// </exception> /// <exception cref="Amazon.CloudFront.Model.NoSuchOriginException"> /// No origin exists with the specified Origin Id. /// </exception> /// <exception cref="Amazon.CloudFront.Model.PreconditionFailedException"> /// The precondition given in one or more of the request-header fields evaluated to false. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyCacheBehaviorsException"> /// You cannot create anymore cache behaviors for the distribution. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyCertificatesException"> /// You cannot create anymore custom ssl certificates. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyCookieNamesInWhiteListException"> /// Your request contains more cookie names in the whitelist than are allowed per cache /// behavior. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyDistributionCNAMEsException"> /// Your request contains more CNAMEs than are allowed per distribution. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyHeadersInForwardedValuesException"> /// /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyOriginsException"> /// You cannot create anymore origins for the distribution. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TooManyTrustedSignersException"> /// Your request contains more trusted signers than are allowed per distribution. /// </exception> /// <exception cref="Amazon.CloudFront.Model.TrustedSignerDoesNotExistException"> /// One or more of your trusted signers do not exist. /// </exception> public UpdateDistributionResponse UpdateDistribution(UpdateDistributionRequest request) { var marshaller = new UpdateDistributionRequestMarshaller(); var unmarshaller = UpdateDistributionResponseUnmarshaller.Instance; return Invoke<UpdateDistributionRequest,UpdateDistributionResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the UpdateDistribution operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateDistribution operation on AmazonCloudFrontClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateDistribution /// operation.</returns> public IAsyncResult BeginUpdateDistribution(UpdateDistributionRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateDistributionRequestMarshaller(); var unmarshaller = UpdateDistributionResponseUnmarshaller.Instance; return BeginInvoke<UpdateDistributionRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Update a distribution. /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateDistribution service method.</param> /// /// <returns>The response from the UpdateDistribution service method, as returned by CloudFront.</returns> /// <exception cref="AccessDeniedException"> /// Access denied. /// </exception> /// <exception cref="CNAMEAlreadyExistsException"> /// /// </exception> /// <exception cref="IllegalUpdateException"> /// Origin and CallerReference cannot be updated. /// </exception> /// <exception cref="InconsistentQuantitiesException"> /// The value of Quantity and the size of Items do not match. /// </exception> /// <exception cref="InvalidArgumentException"> /// The argument is invalid. /// </exception> /// <exception cref="InvalidDefaultRootObjectException"> /// The default root object file name is too big or contains an invalid character. /// </exception> /// <exception cref="InvalidErrorCodeException"> /// /// </exception> /// <exception cref="InvalidForwardCookiesException"> /// Your request contains forward cookies option which doesn't match with the expectation /// for the whitelisted list of cookie names. Either list of cookie names has been /// specified when not allowed or list of cookie names is missing when expected. /// </exception> /// <exception cref="InvalidGeoRestrictionParameterException"> /// /// </exception> /// <exception cref="InvalidHeadersForS3OriginException"> /// /// </exception> /// <exception cref="InvalidIfMatchVersionException"> /// The If-Match version is missing or not valid for the distribution. /// </exception> /// <exception cref="InvalidLocationCodeException"> /// /// </exception> /// <exception cref="InvalidOriginAccessIdentityException"> /// The origin access identity is not valid or doesn't exist. /// </exception> /// <exception cref="InvalidRelativePathException"> /// The relative path is too big, is not URL-encoded, or does not begin with a slash /// (/). /// </exception> /// <exception cref="InvalidRequiredProtocolException"> /// This operation requires the HTTPS protocol. Ensure that you specify the HTTPS protocol /// in your request, or omit the RequiredProtocols element from your distribution configuration. /// </exception> /// <exception cref="InvalidResponseCodeException"> /// /// </exception> /// <exception cref="InvalidViewerCertificateException"> /// /// </exception> /// <exception cref="MissingBodyException"> /// This operation requires a body. Ensure that the body is present and the Content-Type /// header is set. /// </exception> /// <exception cref="NoSuchDistributionException"> /// The specified distribution does not exist. /// </exception> /// <exception cref="NoSuchOriginException"> /// No origin exists with the specified Origin Id. /// </exception> /// <exception cref="PreconditionFailedException"> /// The precondition given in one or more of the request-header fields evaluated to false. /// </exception> /// <exception cref="TooManyCacheBehaviorsException"> /// You cannot create anymore cache behaviors for the distribution. /// </exception> /// <exception cref="TooManyCertificatesException"> /// You cannot create anymore custom ssl certificates. /// </exception> /// <exception cref="TooManyCookieNamesInWhiteListException"> /// Your request contains more cookie names in the whitelist than are allowed per cache /// behavior. /// </exception> /// <exception cref="TooManyDistributionCNAMEsException"> /// Your request contains more CNAMEs than are allowed per distribution. /// </exception> /// <exception cref="TooManyHeadersInForwardedValuesException"> /// /// </exception> /// <exception cref="TooManyOriginsException"> /// You cannot create anymore origins for the distribution. /// </exception> /// <exception cref="TooManyTrustedSignersException"> /// Your request contains more trusted signers than are allowed per distribution. /// </exception> /// <exception cref="TrustedSignerDoesNotExistException"> /// One or more of your trusted signers do not exist. /// </exception> public UpdateDistributionResponse UpdateDistribution(UpdateDistributionRequest request) { var task = UpdateDistributionAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the UpdateDistribution operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateDistribution operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdateDistributionResponse> UpdateDistributionAsync(UpdateDistributionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateDistributionRequestMarshaller(); var unmarshaller = UpdateDistributionResponseUnmarshaller.Instance; return InvokeAsync<UpdateDistributionRequest,UpdateDistributionResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeUpdateDistribution(UpdateDistributionRequest updateDistributionRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new UpdateDistributionRequestMarshaller().Marshall(updateDistributionRequest); var unmarshaller = UpdateDistributionResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the UpdateDistribution operation. /// <seealso cref="Amazon.CloudFront.AmazonCloudFront.UpdateDistribution"/> /// </summary> /// /// <param name="updateDistributionRequest">Container for the necessary parameters to execute the UpdateDistribution operation on /// AmazonCloudFront.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking /// EndUpdateDistribution operation.</returns> public IAsyncResult BeginUpdateDistribution(UpdateDistributionRequest updateDistributionRequest, AsyncCallback callback, object state) { return invokeUpdateDistribution(updateDistributionRequest, callback, state, false); }
/// <summary> /// <para> Update a distribution. </para> /// </summary> /// /// <param name="updateDistributionRequest">Container for the necessary parameters to execute the UpdateDistribution service method on /// AmazonCloudFront.</param> /// /// <returns>The response from the UpdateDistribution service method, as returned by AmazonCloudFront.</returns> /// /// <exception cref="TooManyCookieNamesInWhiteListException"/> /// <exception cref="InvalidDefaultRootObjectException"/> /// <exception cref="InvalidIfMatchVersionException"/> /// <exception cref="InvalidResponseCodeException"/> /// <exception cref="IllegalUpdateException"/> /// <exception cref="MissingBodyException"/> /// <exception cref="TooManyDistributionCNAMEsException"/> /// <exception cref="InvalidForwardCookiesException"/> /// <exception cref="NoSuchOriginException"/> /// <exception cref="PreconditionFailedException"/> /// <exception cref="CNAMEAlreadyExistsException"/> /// <exception cref="InconsistentQuantitiesException"/> /// <exception cref="InvalidArgumentException"/> /// <exception cref="InvalidOriginAccessIdentityException"/> /// <exception cref="TrustedSignerDoesNotExistException"/> /// <exception cref="TooManyCertificatesException"/> /// <exception cref="InvalidRelativePathException"/> /// <exception cref="TooManyCacheBehaviorsException"/> /// <exception cref="TooManyTrustedSignersException"/> /// <exception cref="InvalidErrorCodeException"/> /// <exception cref="NoSuchDistributionException"/> /// <exception cref="InvalidViewerCertificateException"/> /// <exception cref="AccessDeniedException"/> /// <exception cref="TooManyOriginsException"/> /// <exception cref="InvalidRequiredProtocolException"/> public UpdateDistributionResponse UpdateDistribution(UpdateDistributionRequest updateDistributionRequest) { IAsyncResult asyncResult = invokeUpdateDistribution(updateDistributionRequest, null, null, true); return EndUpdateDistribution(asyncResult); }
/// <summary> /// <para> Update a distribution. </para> /// </summary> /// /// <param name="updateDistributionRequest">Container for the necessary parameters to execute the UpdateDistribution service method on /// AmazonCloudFront.</param> /// /// <returns>The response from the UpdateDistribution service method, as returned by AmazonCloudFront.</returns> /// /// <exception cref="T:Amazon.CloudFront.Model.TooManyCookieNamesInWhiteListException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidGeoRestrictionParameterException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidResponseCodeException" /> /// <exception cref="T:Amazon.CloudFront.Model.MissingBodyException" /> /// <exception cref="T:Amazon.CloudFront.Model.TooManyDistributionCNAMEsException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidLocationCodeException" /> /// <exception cref="T:Amazon.CloudFront.Model.NoSuchOriginException" /> /// <exception cref="T:Amazon.CloudFront.Model.PreconditionFailedException" /> /// <exception cref="T:Amazon.CloudFront.Model.InconsistentQuantitiesException" /> /// <exception cref="T:Amazon.CloudFront.Model.CNAMEAlreadyExistsException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidArgumentException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidOriginAccessIdentityException" /> /// <exception cref="T:Amazon.CloudFront.Model.TooManyCacheBehaviorsException" /> /// <exception cref="T:Amazon.CloudFront.Model.TooManyTrustedSignersException" /> /// <exception cref="T:Amazon.CloudFront.Model.NoSuchDistributionException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidViewerCertificateException" /> /// <exception cref="T:Amazon.CloudFront.Model.TooManyOriginsException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidRequiredProtocolException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidDefaultRootObjectException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidIfMatchVersionException" /> /// <exception cref="T:Amazon.CloudFront.Model.IllegalUpdateException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidForwardCookiesException" /> /// <exception cref="T:Amazon.CloudFront.Model.TrustedSignerDoesNotExistException" /> /// <exception cref="T:Amazon.CloudFront.Model.TooManyCertificatesException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidRelativePathException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidErrorCodeException" /> /// <exception cref="T:Amazon.CloudFront.Model.AccessDeniedException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<UpdateDistributionResponse> UpdateDistributionAsync(UpdateDistributionRequest updateDistributionRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateDistributionRequestMarshaller(); var unmarshaller = UpdateDistributionResponseUnmarshaller.GetInstance(); return Invoke<IRequest, UpdateDistributionRequest, UpdateDistributionResponse>(updateDistributionRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal UpdateDistributionResponse UpdateDistribution(UpdateDistributionRequest request) { var task = UpdateDistributionAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
IAsyncResult invokeUpdateDistribution(UpdateDistributionRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new UpdateDistributionRequestMarshaller(); var unmarshaller = UpdateDistributionResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the UpdateDistribution operation. /// <seealso cref="Amazon.CloudFront.IAmazonCloudFront.UpdateDistribution"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateDistribution operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<UpdateDistributionResponse> UpdateDistributionAsync(UpdateDistributionRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateDistributionRequestMarshaller(); var unmarshaller = UpdateDistributionResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, UpdateDistributionRequest, UpdateDistributionResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }