internal virtual TagResourceResponse TagResource(TagResourceRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TagResourceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;

            return(Invoke <TagResourceResponse>(request, options));
        }
Beispiel #2
0
        /// <summary>
        /// Applies the specified tags to the specified resource.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the TagResource 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 TagResource service method, as returned by FIS.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/fis-2020-12-01/TagResource">REST API Reference for TagResource Operation</seealso>
        public virtual Task <TagResourceResponse> TagResourceAsync(TagResourceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TagResourceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;

            return(InvokeAsync <TagResourceResponse>(request, options, cancellationToken));
        }
Beispiel #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the TagResource operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the TagResource operation on AmazonIoTSecureTunnelingClient.</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 EndTagResource
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/iotsecuretunneling-2018-10-05/TagResource">REST API Reference for TagResource Operation</seealso>
        public virtual IAsyncResult BeginTagResource(TagResourceRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TagResourceRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TagResourceResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
Beispiel #4
0
        protected override void Given()
        {
            _tags = new Dictionary <string, string>
            {
                ["TagOne"] = "Tag-One",
                ["TagTwo"] = "Tag-Two"
            };

            Sns.FindTopicAsync(Arg.Any <string>())
            .Returns(new Topic {
                TopicArn = TopicArn
            });

            Sns.When(x => x.TagResourceAsync(Arg.Any <TagResourceRequest>()))
            .Do(x => _actualCreateRequest = x.Arg <TagResourceRequest>());
        }
        public async Task ApplyTagsAsync()
        {
            if (!Tags.Any())
            {
                return;
            }

            Tag CreateTag(KeyValuePair <string, string> tag) => new()
            {
                Key = tag.Key, Value = tag.Value
            };

            var tagRequest = new TagResourceRequest
            {
                ResourceArn = Arn,
                Tags        = Tags.Select(CreateTag).ToList()
            };

            await Client.TagResourceAsync(tagRequest).ConfigureAwait(false);

            _logger.LogInformation("Added {TagCount} tags to topic {TopicName}", tagRequest.Tags.Count, TopicName);
        }
 public void TagResourceAsync(TagResourceRequest request, AmazonServiceCallback <TagResourceRequest, TagResourceResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }
Beispiel #7
0
 Task <TagResourceResponse> IAmazonDynamoDB.TagResourceAsync(TagResourceRequest request, CancellationToken cancellationToken)
 {
     throw new NotSupportedException();
 }
Beispiel #8
0
 /// <summary>
 /// TagResource is an upsert operation. It always updates or adds tags on the given resource.
 /// </summary>
 /// <returns>requestId</returns>
 /// <param name="tagResourceRequest">tag resource request.</param>
 public TagResourceResponse TagResource(TagResourceRequest tagResourceRequest)
 {
     return(this.DoRequestCommon <TagResourceResponse>(tagResourceRequest.GenHttpRequest(Config)));
 }
Beispiel #9
0
 public Task <TagResourceResponse> TagResourceAsync(TagResourceRequest request, CancellationToken cancellationToken = default(CancellationToken))
 {
     throw new NotImplementedException();
 }
Beispiel #10
0
 public TagResourceResponse TagResource(TagResourceRequest request)
 {
     throw new NotImplementedException();
 }