Example #1
0
        public void TagResourcesMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <TagResourcesRequest>();
            var marshaller = new TagResourcesRequestMarshaller();

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

            Comparer.CompareObjectToJson <TagResourcesRequest>(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("TagResources").ResponseStructure).Execute();

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

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Example #2
0
        /// <summary>
        /// Applies one or more tags to the specified resources. Note the following:
        ///
        ///  <ul> <li>
        /// <para>
        /// Not all resources can have tags. For a list of resources that support tagging, see
        /// <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/supported-resources.html">Supported
        /// Resources</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.
        /// </para>
        ///  </li> <li>
        /// <para>
        /// Each resource can have up to 50 tags. For other limits, see <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions">Tag
        /// Restrictions</a> in the <i>Amazon EC2 User Guide for Linux Instances</i>.
        /// </para>
        ///  </li> <li>
        /// <para>
        /// You can only tag resources that are located in the specified region for the AWS account.
        /// </para>
        ///  </li> <li>
        /// <para>
        /// To add tags to a resource, you need the necessary permissions for the service that
        /// the resource belongs to as well as permissions for adding tags. For more information,
        /// see <a href="http://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/obtaining-permissions-for-tagging.html">Obtaining
        /// Permissions for Tagging</a> in the <i>AWS Resource Groups and Tag Editor User Guide</i>.
        /// </para>
        ///  </li> </ul>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the TagResources service method.</param>
        ///
        /// <returns>The response from the TagResources service method, as returned by ResourceGroupsTaggingAPI.</returns>
        /// <exception cref="Amazon.ResourceGroupsTaggingAPI.Model.InternalServiceException">
        /// The request processing failed because of an unknown error, exception, or failure.
        /// You can retry the request.
        /// </exception>
        /// <exception cref="Amazon.ResourceGroupsTaggingAPI.Model.InvalidParameterException">
        /// A parameter is missing or a malformed string or invalid or out-of-range value was
        /// supplied for the request parameter.
        /// </exception>
        /// <exception cref="Amazon.ResourceGroupsTaggingAPI.Model.ThrottledException">
        /// The request was denied to limit the frequency of submitted requests.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/TagResources">REST API Reference for TagResources Operation</seealso>
        public virtual TagResourcesResponse TagResources(TagResourcesRequest request)
        {
            var marshaller   = new TagResourcesRequestMarshaller();
            var unmarshaller = TagResourcesResponseUnmarshaller.Instance;

            return(Invoke <TagResourcesRequest, TagResourcesResponse>(request, marshaller, unmarshaller));
        }
Example #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the TagResources operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the TagResources 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/resourcegroupstaggingapi-2017-01-26/TagResources">REST API Reference for TagResources Operation</seealso>
        public virtual Task <TagResourcesResponse> TagResourcesAsync(TagResourcesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new TagResourcesRequestMarshaller();
            var unmarshaller = TagResourcesResponseUnmarshaller.Instance;

            return(InvokeAsync <TagResourcesRequest, TagResourcesResponse>(request, marshaller,
                                                                           unmarshaller, cancellationToken));
        }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the TagResources operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the TagResources operation on AmazonResourceGroupsTaggingAPIClient.</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 EndTagResources
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/TagResources">REST API Reference for TagResources Operation</seealso>
        public IAsyncResult BeginTagResources(TagResourcesRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = new TagResourcesRequestMarshaller();
            var unmarshaller = TagResourcesResponseUnmarshaller.Instance;

            return(BeginInvoke <TagResourcesRequest>(request, marshaller, unmarshaller,
                                                     callback, state));
        }