Ejemplo n.º 1
0
        public static DescribeStreamProcessorResponse DescribeStreamProcessor(String streamProcessorName)
        {
            DescribeStreamProcessorResponse describeStreamProcessorResponse = null;

            try
            {
                AmazonRekognitionClient rekognitionClient;
                using (rekognitionClient = new AmazonRekognitionClient(MyAWSConfigs.KinesisRegion))
                {
                    describeStreamProcessorResponse = rekognitionClient
                                                      .DescribeStreamProcessor(new DescribeStreamProcessorRequest()
                    {
                        Name = streamProcessorName,
                    });
                }
            }
            catch (AmazonRekognitionException e)
            {
                Console.WriteLine("AmazonRekognitionException: " + e);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: " + e);
            }

            return(describeStreamProcessorResponse);
        }
Ejemplo n.º 2
0
        public StreamProcessor DescribeStreamProcessor()
        {
            DescribeStreamProcessorResponse describeStreamProcessorResult = rekognitionClient
                                                                            .DescribeStreamProcessor(new DescribeStreamProcessorRequest()
            {
                Name = streamProcessorName,
            });

            StreamProcessor sp = new StreamProcessor()
            {
                Name   = describeStreamProcessorResult.Name,
                Status = describeStreamProcessorResult.Status,
            };

            return(sp);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeStreamProcessorResponse response = new DescribeStreamProcessorResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("CreationTimestamp", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreationTimestamp = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Input", targetDepth))
                {
                    var unmarshaller = StreamProcessorInputUnmarshaller.Instance;
                    response.Input = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("LastUpdateTimestamp", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.LastUpdateTimestamp = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Name", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Name = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Output", targetDepth))
                {
                    var unmarshaller = StreamProcessorOutputUnmarshaller.Instance;
                    response.Output = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("RoleArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.RoleArn = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Settings", targetDepth))
                {
                    var unmarshaller = StreamProcessorSettingsUnmarshaller.Instance;
                    response.Settings = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Status", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Status = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("StatusMessage", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.StatusMessage = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("StreamProcessorArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.StreamProcessorArn = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }