/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace Batch { namespace Model { JobSummary::JobSummary() : m_jobArnHasBeenSet(false), m_jobIdHasBeenSet(false), m_jobNameHasBeenSet(false), m_createdAt(0), m_createdAtHasBeenSet(false), m_status(JobStatus::NOT_SET), m_statusHasBeenSet(false), m_statusReasonHasBeenSet(false), m_startedAt(0), m_startedAtHasBeenSet(false), m_stoppedAt(0), m_stoppedAtHasBeenSet(false), m_containerHasBeenSet(false), m_arrayPropertiesHasBeenSet(false), m_nodePropertiesHasBeenSet(false), m_jobDefinitionHasBeenSet(false) { } JobSummary::JobSummary(JsonView jsonValue) : m_jobArnHasBeenSet(false), m_jobIdHasBeenSet(false), m_jobNameHasBeenSet(false), m_createdAt(0), m_createdAtHasBeenSet(false), m_status(JobStatus::NOT_SET), m_statusHasBeenSet(false), m_statusReasonHasBeenSet(false), m_startedAt(0), m_startedAtHasBeenSet(false), m_stoppedAt(0), m_stoppedAtHasBeenSet(false), m_containerHasBeenSet(false), m_arrayPropertiesHasBeenSet(false), m_nodePropertiesHasBeenSet(false), m_jobDefinitionHasBeenSet(false) { *this = jsonValue; } JobSummary& JobSummary::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("jobArn")) { m_jobArn = jsonValue.GetString("jobArn"); m_jobArnHasBeenSet = true; } if(jsonValue.ValueExists("jobId")) { m_jobId = jsonValue.GetString("jobId"); m_jobIdHasBeenSet = true; } if(jsonValue.ValueExists("jobName")) { m_jobName = jsonValue.GetString("jobName"); m_jobNameHasBeenSet = true; } if(jsonValue.ValueExists("createdAt")) { m_createdAt = jsonValue.GetInt64("createdAt"); m_createdAtHasBeenSet = true; } if(jsonValue.ValueExists("status")) { m_status = JobStatusMapper::GetJobStatusForName(jsonValue.GetString("status")); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("statusReason")) { m_statusReason = jsonValue.GetString("statusReason"); m_statusReasonHasBeenSet = true; } if(jsonValue.ValueExists("startedAt")) { m_startedAt = jsonValue.GetInt64("startedAt"); m_startedAtHasBeenSet = true; } if(jsonValue.ValueExists("stoppedAt")) { m_stoppedAt = jsonValue.GetInt64("stoppedAt"); m_stoppedAtHasBeenSet = true; } if(jsonValue.ValueExists("container")) { m_container = jsonValue.GetObject("container"); m_containerHasBeenSet = true; } if(jsonValue.ValueExists("arrayProperties")) { m_arrayProperties = jsonValue.GetObject("arrayProperties"); m_arrayPropertiesHasBeenSet = true; } if(jsonValue.ValueExists("nodeProperties")) { m_nodeProperties = jsonValue.GetObject("nodeProperties"); m_nodePropertiesHasBeenSet = true; } if(jsonValue.ValueExists("jobDefinition")) { m_jobDefinition = jsonValue.GetString("jobDefinition"); m_jobDefinitionHasBeenSet = true; } return *this; } JsonValue JobSummary::Jsonize() const { JsonValue payload; if(m_jobArnHasBeenSet) { payload.WithString("jobArn", m_jobArn); } if(m_jobIdHasBeenSet) { payload.WithString("jobId", m_jobId); } if(m_jobNameHasBeenSet) { payload.WithString("jobName", m_jobName); } if(m_createdAtHasBeenSet) { payload.WithInt64("createdAt", m_createdAt); } if(m_statusHasBeenSet) { payload.WithString("status", JobStatusMapper::GetNameForJobStatus(m_status)); } if(m_statusReasonHasBeenSet) { payload.WithString("statusReason", m_statusReason); } if(m_startedAtHasBeenSet) { payload.WithInt64("startedAt", m_startedAt); } if(m_stoppedAtHasBeenSet) { payload.WithInt64("stoppedAt", m_stoppedAt); } if(m_containerHasBeenSet) { payload.WithObject("container", m_container.Jsonize()); } if(m_arrayPropertiesHasBeenSet) { payload.WithObject("arrayProperties", m_arrayProperties.Jsonize()); } if(m_nodePropertiesHasBeenSet) { payload.WithObject("nodeProperties", m_nodeProperties.Jsonize()); } if(m_jobDefinitionHasBeenSet) { payload.WithString("jobDefinition", m_jobDefinition); } return payload; } } // namespace Model } // namespace Batch } // namespace Aws