/// <summary>
        /// Allows you to programatically update your report preferences.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ModifyReportDefinition service method.</param>
        /// 
        /// <returns>The response from the ModifyReportDefinition service method, as returned by CostAndUsageReport.</returns>
        /// <exception cref="Amazon.CostAndUsageReport.Model.InternalErrorException">
        /// An error on the server occurred during the processing of your request. Try again later.
        /// </exception>
        /// <exception cref="Amazon.CostAndUsageReport.Model.ValidationException">
        /// The input fails to satisfy the constraints specified by an AWS service.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cur-2017-01-06/ModifyReportDefinition">REST API Reference for ModifyReportDefinition Operation</seealso>
        public virtual ModifyReportDefinitionResponse ModifyReportDefinition(ModifyReportDefinitionRequest request)
        {
            var options = new InvokeOptions();
            options.RequestMarshaller = ModifyReportDefinitionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ModifyReportDefinitionResponseUnmarshaller.Instance;

            return Invoke<ModifyReportDefinitionResponse>(request, options);
        }
Пример #2
0
        /// <summary>
        /// Initiates the asynchronous execution of the ModifyReportDefinition operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ModifyReportDefinition operation on AmazonCostAndUsageReportClient.</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 EndModifyReportDefinition
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cur-2017-01-06/ModifyReportDefinition">REST API Reference for ModifyReportDefinition Operation</seealso>
        public virtual IAsyncResult BeginModifyReportDefinition(ModifyReportDefinitionRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ModifyReportDefinitionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ModifyReportDefinitionResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
Пример #3
0
        /// <summary>
        /// Allows you to programatically update your report preferences.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ModifyReportDefinition 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 ModifyReportDefinition service method, as returned by CostAndUsageReport.</returns>
        /// <exception cref="Amazon.CostAndUsageReport.Model.InternalErrorException">
        /// An error on the server occurred during the processing of your request. Try again later.
        /// </exception>
        /// <exception cref="Amazon.CostAndUsageReport.Model.ValidationException">
        /// The input fails to satisfy the constraints specified by an AWS service.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cur-2017-01-06/ModifyReportDefinition">REST API Reference for ModifyReportDefinition Operation</seealso>
        public virtual Task <ModifyReportDefinitionResponse> ModifyReportDefinitionAsync(ModifyReportDefinitionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ModifyReportDefinitionRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ModifyReportDefinitionResponseUnmarshaller.Instance;

            return(InvokeAsync <ModifyReportDefinitionResponse>(request, options, cancellationToken));
        }
Пример #4
0
        /// <summary>
        /// Allows you to programatically update your report preferences.
        /// ModifyReportDefinition /#X-Amz-Target=AWSOrigamiServiceGatewayService.ModifyReportDefinition
        /// </summary>
        /// <returns>Success</returns>
        public async Task <ModifyReportDefinitionResponse> ModifyReportDefinitionAsync(ModifyReportDefinitionRequest requestBody, Action <System.Net.Http.Headers.HttpRequestHeaders> handleHeaders = null)
        {
            var requestUri = "/#X-Amz-Target=AWSOrigamiServiceGatewayService.ModifyReportDefinition";

            using (var request = new HttpRequestMessage(HttpMethod.Post, requestUri))
            {
                using (var requestWriter = new System.IO.StringWriter())
                {
                    var requestSerializer = JsonSerializer.Create(jsonSerializerSettings);
                    requestSerializer.Serialize(requestWriter, requestBody);
                    var content = new StringContent(requestWriter.ToString(), System.Text.Encoding.UTF8, "application/json");
                    request.Content = content;
                    if (handleHeaders != null)
                    {
                        handleHeaders(request.Headers);
                    }

                    var responseMessage = await client.SendAsync(request);

                    try
                    {
                        responseMessage.EnsureSuccessStatusCodeEx();
                        var stream = await responseMessage.Content.ReadAsStreamAsync();

                        using (JsonReader jsonReader = new JsonTextReader(new System.IO.StreamReader(stream)))
                        {
                            var serializer = new JsonSerializer();
                            return(serializer.Deserialize <ModifyReportDefinitionResponse>(jsonReader));
                        }
                    }
                    finally
                    {
                        responseMessage.Dispose();
                    }
                }
            }
        }