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


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

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("UpdateJobResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
        /// <summary>
        /// <para> You use this operation to change the parameters specified in
        /// the original manifest file by supplying a new manifest file. The
        /// manifest file attached to this request replaces the original manifest
        /// file. You can only use the operation after a CreateJob request but
        /// before the data transfer starts and you can only use it on jobs you
        /// own. </para>
        /// </summary>
        ///
        /// <param name="updateJobRequest">Container for the necessary parameters
        ///           to execute the UpdateJob service method on AmazonImportExport.</param>
        ///
        /// <returns>The response from the UpdateJob service method, as returned
        ///         by AmazonImportExport.</returns>
        ///
        /// <exception cref="MalformedManifestException"/>
        /// <exception cref="BucketPermissionException"/>
        /// <exception cref="InvalidAddressException"/>
        /// <exception cref="InvalidParameterException"/>
        /// <exception cref="UnableToUpdateJobIdException"/>
        /// <exception cref="MultipleRegionsException"/>
        /// <exception cref="MissingParameterException"/>
        /// <exception cref="InvalidFileSystemException"/>
        /// <exception cref="CanceledJobIdException"/>
        /// <exception cref="MissingCustomsException"/>
        /// <exception cref="NoSuchBucketException"/>
        /// <exception cref="ExpiredJobIdException"/>
        /// <exception cref="InvalidAccessKeyIdException"/>
        /// <exception cref="InvalidCustomsException"/>
        /// <exception cref="InvalidManifestFieldException"/>
        /// <exception cref="MissingManifestFieldException"/>
        /// <exception cref="InvalidJobIdException"/>
        public UpdateJobResponse UpdateJob(UpdateJobRequest updateJobRequest)
        {
            IRequest <UpdateJobRequest> request  = new UpdateJobRequestMarshaller().Marshall(updateJobRequest);
            UpdateJobResponse           response = Invoke <UpdateJobRequest, UpdateJobResponse> (request, this.signer, UpdateJobResponseUnmarshaller.GetInstance());

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


            return response;
        }
示例#5
0
        private static void UnmarshallResult(XmlUnmarshallerContext context, UpdateJobResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("Success", targetDepth))
                    {
                        var unmarshaller = BoolUnmarshaller.Instance;
                        response.Success = unmarshaller.Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("WarningMessage", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.WarningMessage = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return;
        }
        public static UpdateJobResponse Unmarshall(UnmarshallerContext context)
        {
            UpdateJobResponse updateJobResponse = new UpdateJobResponse();

            updateJobResponse.HttpResponse = context.HttpResponse;
            updateJobResponse.RequestId    = context.StringValue("UpdateJob.RequestId");

            return(updateJobResponse);
        }
示例#7
0
        public static UpdateJobResponse Unmarshall(UnmarshallerContext _ctx)
        {
            UpdateJobResponse updateJobResponse = new UpdateJobResponse();

            updateJobResponse.HttpResponse = _ctx.HttpResponse;
            updateJobResponse.RequestId    = _ctx.StringValue("UpdateJob.RequestId");
            updateJobResponse.Success      = _ctx.BooleanValue("UpdateJob.Success");
            updateJobResponse.Code         = _ctx.StringValue("UpdateJob.Code");
            updateJobResponse.ErrorMessage = _ctx.StringValue("UpdateJob.ErrorMessage");

            return(updateJobResponse);
        }
        public static UpdateJobResponse Unmarshall(UnmarshallerContext context)
        {
            UpdateJobResponse updateJobResponse = new UpdateJobResponse();

            updateJobResponse.HttpResponse = context.HttpResponse;
            updateJobResponse.RequestId    = context.StringValue("UpdateJob.RequestId");
            updateJobResponse.Code         = context.IntegerValue("UpdateJob.Code");
            updateJobResponse.Success      = context.BooleanValue("UpdateJob.Success");
            updateJobResponse.Message      = context.StringValue("UpdateJob.Message");

            return(updateJobResponse);
        }
示例#9
0
 public void Handle(NetworkStream stream, RequestHeaders headers, TcpClient client)
 {
     if (client.Connected)
     {
         var jobGuid           = _jobRepository.CreateJob(headers);
         var createJobResponse = new UpdateJobResponse
         {
             JobGuid = jobGuid,
             Status  = JobStatus.Received
         };
         var    jsonResponse    = JsonConvert.SerializeObject(createJobResponse);
         byte[] responseMessage = Encoding.ASCII.GetBytes(jsonResponse);
         stream.Write(responseMessage, 0, responseMessage.Length);
     }
 }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            UpdateJobResponse response = new UpdateJobResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("JobName", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.JobName = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
示例#11
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            UpdateJobResponse response = new UpdateJobResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("UpdateJobResult", 2))
                    {
                        response.UpdateJobResult = UpdateJobResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }
 protected override void ExpectResponse(UpdateJobResponse response) => response.ShouldBeValid();