Beispiel #1
0
        public AddTagsToStreamResponse AddTagsToStream(Dictionary <string, string> tags, string streamName = null)
        {
            if (string.IsNullOrEmpty(streamName) && string.IsNullOrEmpty(_streamName))
            {
                throw new Exception("Please specify a stream name to add tags");
            }

            if (tags == null || tags.Count == 0 || tags.Count > 10)
            {
                throw new Exception("Please create a tag dictionary that's between 0 and 10 in size");
            }

            var addTagsRequest = new AddTagsToStreamRequest()
            {
                StreamName = streamName ?? _streamName,
                Tags       = tags
            };

            var response = _client.AddTagsToStream(addTagsRequest);

            return(response);
        }