List invalidation batches.
/// <summary> /// Initiates the asynchronous execution of the ListInvalidations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInvalidations 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 EndListInvalidations /// operation.</returns> public IAsyncResult BeginListInvalidations(ListInvalidationsRequest request, AsyncCallback callback, object state) { var marshaller = new ListInvalidationsRequestMarshaller(); var unmarshaller = ListInvalidationsResponseUnmarshaller.Instance; return BeginInvoke<ListInvalidationsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the ListInvalidations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInvalidations 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<ListInvalidationsResponse> ListInvalidationsAsync(ListInvalidationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListInvalidationsRequestMarshaller(); var unmarshaller = ListInvalidationsResponseUnmarshaller.Instance; return InvokeAsync<ListInvalidationsRequest,ListInvalidationsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// List invalidation batches. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListInvalidations service method.</param> /// /// <returns>The response from the ListInvalidations service method, as returned by CloudFront.</returns> /// <exception cref="Amazon.CloudFront.Model.AccessDeniedException"> /// Access denied. /// </exception> /// <exception cref="Amazon.CloudFront.Model.InvalidArgumentException"> /// The argument is invalid. /// </exception> /// <exception cref="Amazon.CloudFront.Model.NoSuchDistributionException"> /// The specified distribution does not exist. /// </exception> public ListInvalidationsResponse ListInvalidations(ListInvalidationsRequest request) { var marshaller = new ListInvalidationsRequestMarshaller(); var unmarshaller = ListInvalidationsResponseUnmarshaller.Instance; return Invoke<ListInvalidationsRequest,ListInvalidationsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// List invalidation batches. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListInvalidations service method.</param> /// /// <returns>The response from the ListInvalidations service method, as returned by CloudFront.</returns> /// <exception cref="AccessDeniedException"> /// Access denied. /// </exception> /// <exception cref="InvalidArgumentException"> /// The argument is invalid. /// </exception> /// <exception cref="NoSuchDistributionException"> /// The specified distribution does not exist. /// </exception> public ListInvalidationsResponse ListInvalidations(ListInvalidationsRequest request) { var task = ListInvalidationsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Paginator for ListInvalidations operation ///</summary> public IListInvalidationsPaginator ListInvalidations(ListInvalidationsRequest request) { return(new ListInvalidationsPaginator(this.client, request)); }
IAsyncResult invokeListInvalidations(ListInvalidationsRequest listInvalidationsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ListInvalidationsRequestMarshaller().Marshall(listInvalidationsRequest); var unmarshaller = ListInvalidationsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the ListInvalidations operation. /// <seealso cref="Amazon.CloudFront.AmazonCloudFront.ListInvalidations"/> /// </summary> /// /// <param name="listInvalidationsRequest">Container for the necessary parameters to execute the ListInvalidations 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 EndListInvalidations /// operation.</returns> public IAsyncResult BeginListInvalidations(ListInvalidationsRequest listInvalidationsRequest, AsyncCallback callback, object state) { return invokeListInvalidations(listInvalidationsRequest, callback, state, false); }
/// <summary> /// <para> List invalidation batches. </para> /// </summary> /// /// <param name="listInvalidationsRequest">Container for the necessary parameters to execute the ListInvalidations service method on /// AmazonCloudFront.</param> /// /// <returns>The response from the ListInvalidations service method, as returned by AmazonCloudFront.</returns> /// /// <exception cref="T:Amazon.CloudFront.Model.NoSuchDistributionException" /> /// <exception cref="T:Amazon.CloudFront.Model.InvalidArgumentException" /> /// <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<ListInvalidationsResponse> ListInvalidationsAsync(ListInvalidationsRequest listInvalidationsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListInvalidationsRequestMarshaller(); var unmarshaller = ListInvalidationsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ListInvalidationsRequest, ListInvalidationsResponse>(listInvalidationsRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para> List invalidation batches. </para> /// </summary> /// /// <param name="listInvalidationsRequest">Container for the necessary parameters to execute the ListInvalidations service method on /// AmazonCloudFront.</param> /// /// <returns>The response from the ListInvalidations service method, as returned by AmazonCloudFront.</returns> /// /// <exception cref="NoSuchDistributionException"/> /// <exception cref="InvalidArgumentException"/> /// <exception cref="AccessDeniedException"/> public ListInvalidationsResponse ListInvalidations(ListInvalidationsRequest listInvalidationsRequest) { IAsyncResult asyncResult = invokeListInvalidations(listInvalidationsRequest, null, null, true); return EndListInvalidations(asyncResult); }
internal ListInvalidationsPaginator(IAmazonCloudFront client, ListInvalidationsRequest request) { this._client = client; this._request = request; }
internal ListInvalidationsResponse ListInvalidations(ListInvalidationsRequest request) { var task = ListInvalidationsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.CloudFront.Model.ListInvalidationsResponse CallAWSServiceOperation(IAmazonCloudFront client, Amazon.CloudFront.Model.ListInvalidationsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon CloudFront", "ListInvalidations"); try { #if DESKTOP return(client.ListInvalidations(request)); #elif CORECLR return(client.ListInvalidationsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; // create request and set iteration invariants var request = new Amazon.CloudFront.Model.ListInvalidationsRequest(); if (cmdletContext.DistributionId != null) { request.DistributionId = cmdletContext.DistributionId; } // Initialize loop variants and commence piping System.String _nextToken = null; int? _emitLimit = null; int _retrievedSoFar = 0; if (AutoIterationHelpers.HasValue(cmdletContext.Marker)) { _nextToken = cmdletContext.Marker; } if (cmdletContext.MaxItem.HasValue) { _emitLimit = cmdletContext.MaxItem; } var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.Marker)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.Marker = _nextToken; if (_emitLimit.HasValue) { request.MaxItems = AutoIterationHelpers.ConvertEmitLimitToString(_emitLimit.Value); } CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; int _receivedThisCall = response.InvalidationList.Items.Count; _nextToken = response.InvalidationList.NextMarker; _retrievedSoFar += _receivedThisCall; if (_emitLimit.HasValue) { _emitLimit -= _receivedThisCall; } } catch (Exception e) { if (_retrievedSoFar == 0 || !_emitLimit.HasValue) { output = new CmdletOutput { ErrorResponse = e }; } else { break; } } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 1)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute // create request and set iteration invariants var request = new Amazon.CloudFront.Model.ListInvalidationsRequest(); if (cmdletContext.DistributionId != null) { request.DistributionId = cmdletContext.DistributionId; } if (cmdletContext.MaxItem != null) { request.MaxItems = AutoIterationHelpers.ConvertEmitLimitToServiceTypeString(cmdletContext.MaxItem.Value); } // Initialize loop variant and commence piping var _nextToken = cmdletContext.Marker; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.Marker)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.Marker = _nextToken; CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; _nextToken = response.InvalidationList.NextMarker; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
IAsyncResult invokeListInvalidations(ListInvalidationsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ListInvalidationsRequestMarshaller(); var unmarshaller = ListInvalidationsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the ListInvalidations operation. /// <seealso cref="Amazon.CloudFront.IAmazonCloudFront.ListInvalidations"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInvalidations 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<ListInvalidationsResponse> ListInvalidationsAsync(ListInvalidationsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListInvalidationsRequestMarshaller(); var unmarshaller = ListInvalidationsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ListInvalidationsRequest, ListInvalidationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }