コード例 #1
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ExecuteStatementResponse response = new ExecuteStatementResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Items", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Dictionary <string, AttributeValue>, DictionaryUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller> >(new DictionaryUnmarshaller <string, AttributeValue, StringUnmarshaller, AttributeValueUnmarshaller>(StringUnmarshaller.Instance, AttributeValueUnmarshaller.Instance));
                    response.Items = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NextToken", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextToken = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
コード例 #2
0
        internal JdbcDataEnumerator(JdbcConnection connection, ExecuteStatementResponse response)
        {
            Connection = connection;
            Response   = response;

            if (!string.IsNullOrEmpty(response.ResultSetId))
            {
                StreamingCall = Connection.Bridge.Reader.readResultSet();
            }
        }
コード例 #3
0
        internal JdbcDataReader(JdbcCommand command, ExecuteStatementResponse response)
        {
            Command  = command;
            Response = response;

            if (!(Command.Connection is JdbcConnection jdbcConnection))
            {
                throw new InvalidOperationException();
            }

            _enumerator = new JdbcDataEnumerator(jdbcConnection, response);
        }
コード例 #4
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ExecuteStatementResponse response = new ExecuteStatementResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("ClusterIdentifier", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.ClusterIdentifier = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("CreatedAt", targetDepth))
                {
                    var unmarshaller = DateTimeUnmarshaller.Instance;
                    response.CreatedAt = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Database", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Database = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("DbUser", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.DbUser = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Id", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.Id = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("SecretArn", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.SecretArn = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
コード例 #5
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ExecuteStatementResponse response = new ExecuteStatementResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("columnMetadata", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <ColumnMetadata, ColumnMetadataUnmarshaller>(ColumnMetadataUnmarshaller.Instance);
                    response.ColumnMetadata = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("generatedFields", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Field, FieldUnmarshaller>(FieldUnmarshaller.Instance);
                    response.GeneratedFields = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("numberOfRecordsUpdated", targetDepth))
                {
                    var unmarshaller = LongUnmarshaller.Instance;
                    response.NumberOfRecordsUpdated = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("records", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <List <Field>, ListUnmarshaller <Field, FieldUnmarshaller> >(new ListUnmarshaller <Field, FieldUnmarshaller>(FieldUnmarshaller.Instance));
                    response.Records = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }