public static GetDeploymentResponse Unmarshall(UnmarshallerContext context) { GetDeploymentResponse getDeploymentResponse = new GetDeploymentResponse(); getDeploymentResponse.HttpResponse = context.HttpResponse; getDeploymentResponse.RequestId = context.StringValue("GetDeployment.RequestId"); getDeploymentResponse.Success = context.BooleanValue("GetDeployment.Success"); getDeploymentResponse.ErrorCode = context.StringValue("GetDeployment.ErrorCode"); getDeploymentResponse.ErrorMessage = context.StringValue("GetDeployment.ErrorMessage"); getDeploymentResponse.HttpStatusCode = context.IntegerValue("GetDeployment.HttpStatusCode"); GetDeploymentResponse.GetDeployment_Data data = new GetDeploymentResponse.GetDeployment_Data(); GetDeploymentResponse.GetDeployment_Data.GetDeployment_Deployment deployment = new GetDeploymentResponse.GetDeployment_Data.GetDeployment_Deployment(); deployment.Name = context.StringValue("GetDeployment.Data.Deployment.Name"); deployment.CreatorId = context.StringValue("GetDeployment.Data.Deployment.CreatorId"); deployment.HandlerId = context.StringValue("GetDeployment.Data.Deployment.HandlerId"); deployment.CreateTime = context.LongValue("GetDeployment.Data.Deployment.CreateTime"); deployment.ExecuteTime = context.LongValue("GetDeployment.Data.Deployment.ExecuteTime"); deployment.Status = context.IntegerValue("GetDeployment.Data.Deployment.Status"); deployment.FromEnvironment = context.IntegerValue("GetDeployment.Data.Deployment.FromEnvironment"); deployment.ToEnvironment = context.IntegerValue("GetDeployment.Data.Deployment.ToEnvironment"); deployment.ErrorMessage = context.StringValue("GetDeployment.Data.Deployment.ErrorMessage"); data.Deployment = deployment; getDeploymentResponse.Data = data; return(getDeploymentResponse); }
/// <summary> /// Gets the deployment info /// </summary> /// <param name="deploymentID">A deployment ID associated with the applicable IAM user or AWS account.</param> /// <param name="settings">The <see cref="DeploySettings"/> used during the request to AWS.</param> /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param> public async Task <DeploymentInfo> GetDeploymentInfo(string deploymentID, DeploySettings settings, CancellationToken cancellationToken = default(CancellationToken)) { if (String.IsNullOrEmpty(deploymentID)) { throw new ArgumentNullException("deploymentID"); } // Create Request AmazonCodeDeployClient client = this.CreateClient(settings); GetDeploymentRequest request = new GetDeploymentRequest(); request.DeploymentId = deploymentID; // Check Response GetDeploymentResponse response = await client.GetDeploymentAsync(request, cancellationToken); if (response.HttpStatusCode == HttpStatusCode.OK) { _Log.Verbose("Successfully found deployment info '{0}'", deploymentID); return(response.DeploymentInfo); } else { _Log.Error("Failed to get deployment info '{0}'", deploymentID); return(null); } }
static void GetDeploymentStatus(string deploymentId, string region = "") { GetDeploymentResponse response = CodeDeployUtil.GetDeployment(deploymentId, region); if (response != null) { Log.Information("{0} {1} - CompleteTime: {2}", deploymentId, response.DeploymentInfo.Status, response.DeploymentInfo.CompleteTime); } }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetDeploymentResponse response = new GetDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("autoDeployed", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.AutoDeployed = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatusMessage", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatusMessage = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } } 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) { GetDeploymentResponse response = new GetDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("deploymentInfo", targetDepth)) { var unmarshaller = DeploymentInfoUnmarshaller.Instance; response.DeploymentInfo = unmarshaller.Unmarshall(context); continue; } } 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) { GetDeploymentResponse response = new GetDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("apiSummary", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller <string, Dictionary <string, MethodSnapshot>, StringUnmarshaller, DictionaryUnmarshaller <string, MethodSnapshot, StringUnmarshaller, MethodSnapshotUnmarshaller> >(StringUnmarshaller.Instance, new DictionaryUnmarshaller <string, MethodSnapshot, StringUnmarshaller, MethodSnapshotUnmarshaller>(StringUnmarshaller.Instance, MethodSnapshotUnmarshaller.Instance)); response.ApiSummary = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("createdDate", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreatedDate = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("id", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Id = unmarshaller.Unmarshall(context); continue; } } 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) { GetDeploymentResponse response = new GetDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("components", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller <string, ComponentDeploymentSpecification, StringUnmarshaller, ComponentDeploymentSpecificationUnmarshaller>(StringUnmarshaller.Instance, ComponentDeploymentSpecificationUnmarshaller.Instance); response.Components = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("creationTimestamp", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CreationTimestamp = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentPolicies", targetDepth)) { var unmarshaller = DeploymentPoliciesUnmarshaller.Instance; response.DeploymentPolicies = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("deploymentStatus", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStatus = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("iotJobArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IotJobArn = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("iotJobConfiguration", targetDepth)) { var unmarshaller = DeploymentIoTJobConfigurationUnmarshaller.Instance; response.IotJobConfiguration = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("iotJobId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.IotJobId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("isLatestForTarget", targetDepth)) { var unmarshaller = BoolUnmarshaller.Instance; response.IsLatestForTarget = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("revisionId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.RevisionId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("tags", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller <string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.Tags = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("targetArn", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TargetArn = unmarshaller.Unmarshall(context); continue; } } 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) { GetDeploymentResponse response = new GetDeploymentResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("ApplicationId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ApplicationId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("CompletedAt", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.CompletedAt = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ConfigurationLocationUri", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConfigurationLocationUri = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ConfigurationName", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConfigurationName = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ConfigurationProfileId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConfigurationProfileId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("ConfigurationVersion", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.ConfigurationVersion = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DeploymentDurationInMinutes", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.DeploymentDurationInMinutes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DeploymentNumber", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.DeploymentNumber = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("DeploymentStrategyId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.DeploymentStrategyId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Description", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.Description = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EnvironmentId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.EnvironmentId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("EventLog", targetDepth)) { var unmarshaller = new ListUnmarshaller <DeploymentEvent, DeploymentEventUnmarshaller>(DeploymentEventUnmarshaller.Instance); response.EventLog = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("FinalBakeTimeInMinutes", targetDepth)) { var unmarshaller = IntUnmarshaller.Instance; response.FinalBakeTimeInMinutes = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GrowthFactor", targetDepth)) { var unmarshaller = FloatUnmarshaller.Instance; response.GrowthFactor = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("GrowthType", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.GrowthType = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("PercentageComplete", targetDepth)) { var unmarshaller = FloatUnmarshaller.Instance; response.PercentageComplete = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("StartedAt", targetDepth)) { var unmarshaller = DateTimeUnmarshaller.Instance; response.StartedAt = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("State", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.State = unmarshaller.Unmarshall(context); continue; } } return(response); }