Exemple #1
0
        /// <summary>
        /// Given a data set type and a from date, asynchronously publishes the requested customer
        /// support data to the specified S3 bucket and notifies the specified SNS topic once
        /// the data is available. Returns a unique request identifier that can be used to correlate
        /// requests with notifications from the SNS topic. Data sets will be published in comma-separated
        /// values (CSV) format with the file name {data_set_type}_YYYY-MM-DD'T'HH-mm-ss'Z'.csv.
        /// If a file with the same name already exists (e.g. if the same data set is requested
        /// twice), the original file will be overwritten by the new file. Requires a Role with
        /// an attached permissions policy providing Allow permissions for the following actions:
        /// s3:PutObject, s3:GetBucketLocation, sns:GetTopicAttributes, sns:Publish, iam:GetRolePolicy.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the StartSupportDataExport service method.</param>
        ///
        /// <returns>The response from the StartSupportDataExport service method, as returned by AWSMarketplaceCommerceAnalytics.</returns>
        /// <exception cref="Amazon.AWSMarketplaceCommerceAnalytics.Model.MarketplaceCommerceAnalyticsException">
        /// This exception is thrown when an internal service error occurs.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/marketplacecommerceanalytics-2015-07-01/StartSupportDataExport">REST API Reference for StartSupportDataExport Operation</seealso>
        public virtual StartSupportDataExportResponse StartSupportDataExport(StartSupportDataExportRequest request)
        {
            var marshaller   = new StartSupportDataExportRequestMarshaller();
            var unmarshaller = StartSupportDataExportResponseUnmarshaller.Instance;

            return(Invoke <StartSupportDataExportRequest, StartSupportDataExportResponse>(request, marshaller, unmarshaller));
        }
Exemple #2
0
        public void StartSupportDataExport_MarketplaceCommerceAnalyticsExceptionMarshallTest()
        {
            var operation = service_model.FindOperation("StartSupportDataExport");

            var request         = InstantiateClassGenerator.Execute <StartSupportDataExportRequest>();
            var marshaller      = new StartSupportDataExportRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <StartSupportDataExportRequest>(request, jsonRequest);

            var exception    = operation.Exceptions.First(e => e.Name.Equals("MarketplaceCommerceAnalyticsException"));
            var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute();
            var webResponse  = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString()                                  },
                    { "x-amz-crc32",      "0"                                                        },
                    { "x-amzn-ErrorType", "MarketplaceCommerceAnalyticsException"                    },
                    { "Content-Length",   UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString() }
                }
            };
            var context  = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true);
            var response = StartSupportDataExportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK);

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Exemple #3
0
        public void StartSupportDataExportMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <StartSupportDataExportRequest>();
            var marshaller = new StartSupportDataExportRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <StartSupportDataExportRequest>(request, jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("StartSupportDataExport").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = StartSupportDataExportResponseUnmarshaller.Instance.Unmarshall(context)
                           as StartSupportDataExportResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Exemple #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the StartSupportDataExport operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartSupportDataExport 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/marketplacecommerceanalytics-2015-07-01/StartSupportDataExport">REST API Reference for StartSupportDataExport Operation</seealso>
        public virtual Task <StartSupportDataExportResponse> StartSupportDataExportAsync(StartSupportDataExportRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new StartSupportDataExportRequestMarshaller();
            var unmarshaller = StartSupportDataExportResponseUnmarshaller.Instance;

            return(InvokeAsync <StartSupportDataExportRequest, StartSupportDataExportResponse>(request, marshaller,
                                                                                               unmarshaller, cancellationToken));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartSupportDataExport operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StartSupportDataExport operation on AmazonAWSMarketplaceCommerceAnalyticsClient.</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 EndStartSupportDataExport
        ///         operation.</returns>
        public IAsyncResult BeginStartSupportDataExport(StartSupportDataExportRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new StartSupportDataExportRequestMarshaller();
            var unmarshaller = StartSupportDataExportResponseUnmarshaller.Instance;

            return(BeginInvoke <StartSupportDataExportRequest>(request, marshaller, unmarshaller,
                                                               callback, state));
        }
        public void StartSupportDataExportMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<StartSupportDataExportRequest>();
            var marshaller = new StartSupportDataExportRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<StartSupportDataExportRequest>(request,jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("StartSupportDataExport").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = StartSupportDataExportResponseUnmarshaller.Instance.Unmarshall(context)
                as StartSupportDataExportResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartSupportDataExport operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartSupportDataExport operation on AmazonAWSMarketplaceCommerceAnalyticsClient.</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 EndStartSupportDataExport
        ///         operation.</returns>
        public IAsyncResult BeginStartSupportDataExport(StartSupportDataExportRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new StartSupportDataExportRequestMarshaller();
            var unmarshaller = StartSupportDataExportResponseUnmarshaller.Instance;

            return BeginInvoke<StartSupportDataExportRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Given a data set type and a from date, asynchronously publishes the requested customer
        /// support data to the specified S3 bucket and notifies the specified SNS topic once
        /// the data is available. Returns a unique request identifier that can be used to correlate
        /// requests with notifications from the SNS topic. Data sets will be published in comma-separated
        /// values (CSV) format with the file name {data_set_type}_YYYY-MM-DD'T'HH-mm-ss'Z'.csv.
        /// If a file with the same name already exists (e.g. if the same data set is requested
        /// twice), the original file will be overwritten by the new file. Requires a Role with
        /// an attached permissions policy providing Allow permissions for the following actions:
        /// s3:PutObject, s3:GetBucketLocation, sns:GetTopicAttributes, sns:Publish, iam:GetRolePolicy.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the StartSupportDataExport service method.</param>
        /// 
        /// <returns>The response from the StartSupportDataExport service method, as returned by AWSMarketplaceCommerceAnalytics.</returns>
        /// <exception cref="Amazon.AWSMarketplaceCommerceAnalytics.Model.MarketplaceCommerceAnalyticsException">
        /// This exception is thrown when an internal service error occurs.
        /// </exception>
        public StartSupportDataExportResponse StartSupportDataExport(StartSupportDataExportRequest request)
        {
            var marshaller = new StartSupportDataExportRequestMarshaller();
            var unmarshaller = StartSupportDataExportResponseUnmarshaller.Instance;

            return Invoke<StartSupportDataExportRequest,StartSupportDataExportResponse>(request, marshaller, unmarshaller);
        }
        /// <summary>
        /// Initiates the asynchronous execution of the StartSupportDataExport operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the StartSupportDataExport 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<StartSupportDataExportResponse> StartSupportDataExportAsync(StartSupportDataExportRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new StartSupportDataExportRequestMarshaller();
            var unmarshaller = StartSupportDataExportResponseUnmarshaller.Instance;

            return InvokeAsync<StartSupportDataExportRequest,StartSupportDataExportResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }