Ejemplo n.º 1
0
        public IRequestContext Marshall(DeleteMessageBatchRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);

            if (input.IsSetBatchEntry())
            {
                var number = 1;
                foreach (var item in input.DeleteMessageBatchRequestEntry)
                {
                    if (!string.IsNullOrWhiteSpace(item.Id) && !string.IsNullOrWhiteSpace(item.ReceiptHandle))
                    {
                        context.AddParametr($"DeleteMessageBatchRequestEntry.{number}.Id", item.Id);
                        context.AddParametr($"DeleteMessageBatchRequestEntry.{number}.ReceiptHandle", item.ReceiptHandle);
                        number++;
                    }
                }
            }

            return(context);
        }
        public IRequestContext Marshall(PurgeQueueRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);

            return(context);
        }
        public IRequestContext Marshall(DeleteMessageRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);
            context.AddParametr("ReceiptHandle", input.ReceiptHandle);

            return(context);
        }
        public IRequestContext Marshall(ChangeMessageVisibilityRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);
            context.AddParametr("ReceiptHandle", input.ReceiptHandle);
            context.AddParametr("VisibilityTimeout", input.VisibilityTimeout.ToString());

            return(context);
        }
        public IRequestContext Marshall(ListQueuesRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            if (!string.IsNullOrWhiteSpace(input.QueueNamePrefix))
            {
                context.AddParametr("QueueNamePrefix", input.QueueNamePrefix);
            }

            return(context);
        }
        public IRequestContext Marshall(CreateQueueRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueName", input.QueueName);

            if (input.Attributes != null && input.Attributes.Count > 0)
            {
                RequestAttributesBuilder.NamedAttributes(context, input.Attributes);
            }

            return(context);
        }
Ejemplo n.º 7
0
        public IRequestContext Marshall(SendMessageRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);
            context.AddParametr("MessageBody", input.MessageBody);

            if (input.MessageAttribute != null && input.MessageAttribute.Count > 0)
            {
                RequestAttributesBuilder.MessageAttributes(context, input.MessageAttribute);
            }

            if (input.DelaySeconds.HasValue)
            {
                context.AddParametr("DelaySeconds", input.DelaySeconds.ToString());
            }

            if (!string.IsNullOrWhiteSpace(input.MessageDeduplicationId))
            {
                context.AddParametr("MessageDeduplicationId", input.MessageDeduplicationId);
            }
            if (!string.IsNullOrWhiteSpace(input.MessageDeduplicationId))
            {
                context.AddParametr("MessageGroupId", input.MessageGroupId);
            }

            return(context);
        }
        public IRequestContext Marshall(SendMessageBatchRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);

            if (input.IsSetBatchEntry())
            {
                var number = 1;
                foreach (var item in input.SendMessageBatchRequestEntry)
                {
                    context.AddParametr($"SendMessageBatchRequestEntry.{number}.Id", item.Id);
                    context.AddParametr($"SendMessageBatchRequestEntry.{number}.MessageBody", item.MessageBody);

                    if (item.IsSetMessageAttribute())
                    {
                        RequestAttributesBuilder.MessageAttributesBatchEntry(number, context, item.MessageAttribute);
                    }

                    if (item.DelaySeconds.HasValue)
                    {
                        context.AddParametr($"SendMessageBatchRequestEntry.{number}.DelaySeconds", item.DelaySeconds.ToString());
                    }

                    if (!string.IsNullOrWhiteSpace(item.MessageDeduplicationId))
                    {
                        context.AddParametr($"SendMessageBatchRequestEntry.{number}.MessageDeduplicationId", item.MessageDeduplicationId);
                    }
                    if (!string.IsNullOrWhiteSpace(item.MessageDeduplicationId))
                    {
                        context.AddParametr($"SendMessageBatchRequestEntry.{number}.MessageGroupId", item.MessageGroupId);
                    }

                    number++;
                }
            }
            return(context);
        }
Ejemplo n.º 9
0
        public IRequestContext Marshall(ReceiveMessageRequest input)
        {
            IRequestContext context = new RequestContext();

            context.AddParametr("Action", input.ActionName);
            context.AddParametr("Version", YandexMqConfig.DEFAULT_SERVICE_VERSION);

            context.AddParametr("QueueUrl", input.QueueUrl);

            if (input.MaxNumberOfMessages.HasValue)
            {
                context.AddParametr("MaxNumberOfMessages", input.MaxNumberOfMessages.ToString());
            }
            if (!string.IsNullOrWhiteSpace(input.ReceiveRequestAttemptId))
            {
                context.AddParametr("ReceiveRequestAttemptId", input.ReceiveRequestAttemptId);
            }
            if (input.VisibilityTimeout.HasValue)
            {
                context.AddParametr("VisibilityTimeout", input.VisibilityTimeout.ToString());
            }
            if (input.WaitTimeSeconds.HasValue)
            {
                context.AddParametr("WaitTimeSeconds", input.WaitTimeSeconds.ToString());
            }

            if (input.IsSetAttributeNames())
            {
                RequestAttributesBuilder.ListAttributes(context, input.AttributeNames);
            }
            if (input.IsSetMessageAttributeName())
            {
                RequestAttributesBuilder.ListMessageAttributes(context, input.MessageAttributeName);
            }

            return(context);
        }