public IRequest Marshall(DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest)
        {
            IRequest request = new DefaultRequest(describeWorkflowExecutionRequest, "AmazonSimpleWorkflow");
            string   target  = "SimpleWorkflowService.DescribeWorkflowExecution";

            request.Headers["X-Amz-Target"] = target;

            request.Headers["Content-Type"] = "application/x-amz-json-1.0";

            string uriResourcePath = "";

            request.ResourcePath = uriResourcePath;


            using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture))
            {
                JsonWriter writer = new JsonWriter(stringWriter);
                writer.WriteObjectStart();

                if (describeWorkflowExecutionRequest != null && describeWorkflowExecutionRequest.IsSetDomain())
                {
                    writer.WritePropertyName("domain");
                    writer.Write(describeWorkflowExecutionRequest.Domain);
                }

                if (describeWorkflowExecutionRequest != null)
                {
                    WorkflowExecution execution = describeWorkflowExecutionRequest.Execution;
                    if (execution != null)
                    {
                        writer.WritePropertyName("execution");
                        writer.WriteObjectStart();
                        if (execution != null && execution.IsSetWorkflowId())
                        {
                            writer.WritePropertyName("workflowId");
                            writer.Write(execution.WorkflowId);
                        }
                        if (execution != null && execution.IsSetRunId())
                        {
                            writer.WritePropertyName("runId");
                            writer.Write(execution.RunId);
                        }
                        writer.WriteObjectEnd();
                    }
                }

                writer.WriteObjectEnd();

                string snippet = stringWriter.ToString();
                request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
            }


            return(request);
        }
Beispiel #2
0
        public IRequest Marshall(GetWorkflowExecutionHistoryRequest getWorkflowExecutionHistoryRequest)
        {
            IRequest request = new DefaultRequest(getWorkflowExecutionHistoryRequest, "AmazonSimpleWorkflow");
            string   target  = "SimpleWorkflowService.GetWorkflowExecutionHistory";

            request.Headers["X-Amz-Target"] = target;
            request.Headers["Content-Type"] = "application/x-amz-json-1.0";

            using (StringWriter stringWriter = new StringWriter())
            {
                JsonWriter writer = new JsonWriter(stringWriter);
                writer.WriteObjectStart();

                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetDomain())
                {
                    writer.WritePropertyName("domain");
                    writer.Write(getWorkflowExecutionHistoryRequest.Domain);
                }

                if (getWorkflowExecutionHistoryRequest != null)
                {
                    WorkflowExecution execution = getWorkflowExecutionHistoryRequest.Execution;
                    if (execution != null)
                    {
                        writer.WritePropertyName("execution");
                        writer.WriteObjectStart();
                        if (execution != null && execution.IsSetWorkflowId())
                        {
                            writer.WritePropertyName("workflowId");
                            writer.Write(execution.WorkflowId);
                        }
                        if (execution != null && execution.IsSetRunId())
                        {
                            writer.WritePropertyName("runId");
                            writer.Write(execution.RunId);
                        }
                        writer.WriteObjectEnd();
                    }
                }
                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetNextPageToken())
                {
                    writer.WritePropertyName("nextPageToken");
                    writer.Write(getWorkflowExecutionHistoryRequest.NextPageToken);
                }
                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetMaximumPageSize())
                {
                    writer.WritePropertyName("maximumPageSize");
                    writer.Write(getWorkflowExecutionHistoryRequest.MaximumPageSize);
                }
                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetReverseOrder())
                {
                    writer.WritePropertyName("reverseOrder");
                    writer.Write(getWorkflowExecutionHistoryRequest.ReverseOrder);
                }

                writer.WriteObjectEnd();

                string snippet = stringWriter.ToString();
                request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
                return(request);
            }
        }
Beispiel #3
0
        public IRequest Marshall(GetWorkflowExecutionHistoryRequest getWorkflowExecutionHistoryRequest)
        {
            IRequest request = new DefaultRequest(getWorkflowExecutionHistoryRequest, "AmazonSimpleWorkflow");
            string   target  = "SimpleWorkflowService.GetWorkflowExecutionHistory";

            request.Headers["X-Amz-Target"] = target;

            request.Headers["Content-Type"] = "application/x-amz-json-1.0";


            string uriResourcePath = "";

            if (uriResourcePath.Contains("?"))
            {
                int    queryPosition = uriResourcePath.IndexOf("?", StringComparison.OrdinalIgnoreCase);
                string queryString   = uriResourcePath.Substring(queryPosition + 1);
                uriResourcePath = uriResourcePath.Substring(0, queryPosition);

                foreach (string s in queryString.Split('&', ';'))
                {
                    string[] nameValuePair = s.Split('=');
                    if (nameValuePair.Length == 2 && nameValuePair[1].Length > 0)
                    {
                        request.Parameters.Add(nameValuePair[0], nameValuePair[1]);
                    }
                    else
                    {
                        request.Parameters.Add(nameValuePair[0], null);
                    }
                }
            }

            request.ResourcePath = uriResourcePath;


            using (StringWriter stringWriter = new StringWriter(System.Globalization.CultureInfo.InvariantCulture))
            {
                JsonWriter writer = new JsonWriter(stringWriter);
                writer.WriteObjectStart();

                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetDomain())
                {
                    writer.WritePropertyName("domain");
                    writer.Write(getWorkflowExecutionHistoryRequest.Domain);
                }

                if (getWorkflowExecutionHistoryRequest != null)
                {
                    WorkflowExecution execution = getWorkflowExecutionHistoryRequest.Execution;
                    if (execution != null)
                    {
                        writer.WritePropertyName("execution");
                        writer.WriteObjectStart();
                        if (execution != null && execution.IsSetWorkflowId())
                        {
                            writer.WritePropertyName("workflowId");
                            writer.Write(execution.WorkflowId);
                        }
                        if (execution != null && execution.IsSetRunId())
                        {
                            writer.WritePropertyName("runId");
                            writer.Write(execution.RunId);
                        }
                        writer.WriteObjectEnd();
                    }
                }
                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetNextPageToken())
                {
                    writer.WritePropertyName("nextPageToken");
                    writer.Write(getWorkflowExecutionHistoryRequest.NextPageToken);
                }
                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetMaximumPageSize())
                {
                    writer.WritePropertyName("maximumPageSize");
                    writer.Write(getWorkflowExecutionHistoryRequest.MaximumPageSize);
                }
                if (getWorkflowExecutionHistoryRequest != null && getWorkflowExecutionHistoryRequest.IsSetReverseOrder())
                {
                    writer.WritePropertyName("reverseOrder");
                    writer.Write(getWorkflowExecutionHistoryRequest.ReverseOrder);
                }

                writer.WriteObjectEnd();

                string snippet = stringWriter.ToString();
                request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
            }


            return(request);
        }
        public IRequest Marshall(DescribeWorkflowExecutionRequest describeWorkflowExecutionRequest)
        {
            IRequest request = new DefaultRequest(describeWorkflowExecutionRequest, "AmazonSimpleWorkflow");
            string   target  = "SimpleWorkflowService.DescribeWorkflowExecution";

            request.Headers["X-Amz-Target"] = target;
            request.Headers["Content-Type"] = "application/x-amz-json-1.0";



            string uriResourcePath = "";

            if (uriResourcePath.Contains("?"))
            {
                string queryString = uriResourcePath.Substring(uriResourcePath.IndexOf("?") + 1);
                uriResourcePath = uriResourcePath.Substring(0, uriResourcePath.IndexOf("?"));

                foreach (string s in queryString.Split('&', ';'))
                {
                    string[] nameValuePair = s.Split('=');
                    if (nameValuePair.Length == 2 && nameValuePair[1].Length > 0)
                    {
                        request.Parameters.Add(nameValuePair[0], nameValuePair[1]);
                    }
                    else
                    {
                        request.Parameters.Add(nameValuePair[0], null);
                    }
                }
            }

            request.ResourcePath = uriResourcePath;


            using (StringWriter stringWriter = new StringWriter())
            {
                JsonWriter writer = new JsonWriter(stringWriter);
                writer.WriteObjectStart();

                if (describeWorkflowExecutionRequest != null && describeWorkflowExecutionRequest.IsSetDomain())
                {
                    writer.WritePropertyName("domain");
                    writer.Write(describeWorkflowExecutionRequest.Domain);
                }

                if (describeWorkflowExecutionRequest != null)
                {
                    WorkflowExecution execution = describeWorkflowExecutionRequest.Execution;
                    if (execution != null)
                    {
                        writer.WritePropertyName("execution");
                        writer.WriteObjectStart();
                        if (execution != null && execution.IsSetWorkflowId())
                        {
                            writer.WritePropertyName("workflowId");
                            writer.Write(execution.WorkflowId);
                        }
                        if (execution != null && execution.IsSetRunId())
                        {
                            writer.WritePropertyName("runId");
                            writer.Write(execution.RunId);
                        }
                        writer.WriteObjectEnd();
                    }
                }

                writer.WriteObjectEnd();

                string snippet = stringWriter.ToString();
                request.Content = System.Text.Encoding.UTF8.GetBytes(snippet);
            }


            return(request);
        }