示例#1
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetReportDefinition operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the GetReportDefinition operation on AmazonApplicationCostProfilerClient.</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 EndGetReportDefinition
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/AWSApplicationCostProfiler-2020-09-10/GetReportDefinition">REST API Reference for GetReportDefinition Operation</seealso>
        public virtual IAsyncResult BeginGetReportDefinition(GetReportDefinitionRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetReportDefinitionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetReportDefinitionResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
示例#2
0
        /// <summary>
        /// Retrieves the definition of a report already configured in AWS Application Cost Profiler.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetReportDefinition service method.</param>
        ///
        /// <returns>The response from the GetReportDefinition service method, as returned by ApplicationCostProfiler.</returns>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.AccessDeniedException">
        /// You do not have permission to perform this action.
        /// </exception>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.InternalServerException">
        /// An internal server error occurred. Retry your request.
        /// </exception>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.ThrottlingException">
        /// The calls to AWS Application Cost Profiler API are throttled. The request was denied.
        /// </exception>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.ValidationException">
        /// The input fails to satisfy the constraints for the API.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/AWSApplicationCostProfiler-2020-09-10/GetReportDefinition">REST API Reference for GetReportDefinition Operation</seealso>
        public virtual GetReportDefinitionResponse GetReportDefinition(GetReportDefinitionRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetReportDefinitionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetReportDefinitionResponseUnmarshaller.Instance;

            return(Invoke <GetReportDefinitionResponse>(request, options));
        }
示例#3
0
        /// <summary>
        /// Retrieves the definition of a report already configured in AWS Application Cost Profiler.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the GetReportDefinition service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the GetReportDefinition service method, as returned by ApplicationCostProfiler.</returns>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.AccessDeniedException">
        /// You do not have permission to perform this action.
        /// </exception>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.InternalServerException">
        /// An internal server error occurred. Retry your request.
        /// </exception>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.ThrottlingException">
        /// The calls to AWS Application Cost Profiler API are throttled. The request was denied.
        /// </exception>
        /// <exception cref="Amazon.ApplicationCostProfiler.Model.ValidationException">
        /// The input fails to satisfy the constraints for the API.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/AWSApplicationCostProfiler-2020-09-10/GetReportDefinition">REST API Reference for GetReportDefinition Operation</seealso>
        public virtual Task <GetReportDefinitionResponse> GetReportDefinitionAsync(GetReportDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = GetReportDefinitionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = GetReportDefinitionResponseUnmarshaller.Instance;

            return(InvokeAsync <GetReportDefinitionResponse>(request, options, cancellationToken));
        }
        private void HandleOutput(GetReportDefinitionRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case LifecycleStateParamSet:
                response = client.Waiters.ForReportDefinition(request, waiterConfig, WaitForLifecycleState).Execute();
                break;

            case Default:
                response = client.GetReportDefinition(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.ReportDefinition);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetReportDefinitionRequest request;

            try
            {
                request = new GetReportDefinitionRequest
                {
                    ReportDefinitionId = ReportDefinitionId,
                    OpcRequestId       = OpcRequestId
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }