JsonValue PipelineDescription::Jsonize() const { JsonValue payload; if(m_pipelineIdHasBeenSet) { payload.WithString("pipelineId", m_pipelineId); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_fieldsHasBeenSet) { Array<JsonValue> fieldsJsonList(m_fields.size()); for(unsigned fieldsIndex = 0; fieldsIndex < fieldsJsonList.GetLength(); ++fieldsIndex) { fieldsJsonList[fieldsIndex].AsObject(m_fields[fieldsIndex].Jsonize()); } payload.WithArray("fields", std::move(fieldsJsonList)); } if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_tagsHasBeenSet) { Array<JsonValue> tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("tags", std::move(tagsJsonList)); } return payload; }
JsonValue EntityFilter::Jsonize() const { JsonValue payload; if(m_eventArnsHasBeenSet) { Array<JsonValue> eventArnsJsonList(m_eventArns.size()); for(unsigned eventArnsIndex = 0; eventArnsIndex < eventArnsJsonList.GetLength(); ++eventArnsIndex) { eventArnsJsonList[eventArnsIndex].AsString(m_eventArns[eventArnsIndex]); } payload.WithArray("eventArns", std::move(eventArnsJsonList)); } if(m_entityArnsHasBeenSet) { Array<JsonValue> entityArnsJsonList(m_entityArns.size()); for(unsigned entityArnsIndex = 0; entityArnsIndex < entityArnsJsonList.GetLength(); ++entityArnsIndex) { entityArnsJsonList[entityArnsIndex].AsString(m_entityArns[entityArnsIndex]); } payload.WithArray("entityArns", std::move(entityArnsJsonList)); } if(m_entityValuesHasBeenSet) { Array<JsonValue> entityValuesJsonList(m_entityValues.size()); for(unsigned entityValuesIndex = 0; entityValuesIndex < entityValuesJsonList.GetLength(); ++entityValuesIndex) { entityValuesJsonList[entityValuesIndex].AsString(m_entityValues[entityValuesIndex]); } payload.WithArray("entityValues", std::move(entityValuesJsonList)); } if(m_lastUpdatedTimesHasBeenSet) { Array<JsonValue> lastUpdatedTimesJsonList(m_lastUpdatedTimes.size()); for(unsigned lastUpdatedTimesIndex = 0; lastUpdatedTimesIndex < lastUpdatedTimesJsonList.GetLength(); ++lastUpdatedTimesIndex) { lastUpdatedTimesJsonList[lastUpdatedTimesIndex].AsObject(m_lastUpdatedTimes[lastUpdatedTimesIndex].Jsonize()); } payload.WithArray("lastUpdatedTimes", std::move(lastUpdatedTimesJsonList)); } if(m_tagsHasBeenSet) { Array<JsonValue> tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { JsonValue tagSetJsonMap; for(auto& tagSetItem : m_tags[tagsIndex]) { tagSetJsonMap.WithString(tagSetItem.first, tagSetItem.second); } tagsJsonList[tagsIndex].AsObject(std::move(tagSetJsonMap)); } payload.WithArray("tags", std::move(tagsJsonList)); } if(m_statusCodesHasBeenSet) { Array<JsonValue> statusCodesJsonList(m_statusCodes.size()); for(unsigned statusCodesIndex = 0; statusCodesIndex < statusCodesJsonList.GetLength(); ++statusCodesIndex) { statusCodesJsonList[statusCodesIndex].AsString(EntityStatusCodeMapper::GetNameForEntityStatusCode(m_statusCodes[statusCodesIndex])); } payload.WithArray("statusCodes", std::move(statusCodesJsonList)); } return payload; }
JsonValue Cluster::Jsonize() const { JsonValue payload; if(m_idHasBeenSet) { payload.WithString("Id", m_id); } if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_statusHasBeenSet) { payload.WithObject("Status", m_status.Jsonize()); } if(m_ec2InstanceAttributesHasBeenSet) { payload.WithObject("Ec2InstanceAttributes", m_ec2InstanceAttributes.Jsonize()); } if(m_logUriHasBeenSet) { payload.WithString("LogUri", m_logUri); } if(m_requestedAmiVersionHasBeenSet) { payload.WithString("RequestedAmiVersion", m_requestedAmiVersion); } if(m_runningAmiVersionHasBeenSet) { payload.WithString("RunningAmiVersion", m_runningAmiVersion); } if(m_releaseLabelHasBeenSet) { payload.WithString("ReleaseLabel", m_releaseLabel); } if(m_autoTerminateHasBeenSet) { payload.WithBool("AutoTerminate", m_autoTerminate); } if(m_terminationProtectedHasBeenSet) { payload.WithBool("TerminationProtected", m_terminationProtected); } if(m_visibleToAllUsersHasBeenSet) { payload.WithBool("VisibleToAllUsers", m_visibleToAllUsers); } if(m_applicationsHasBeenSet) { Array<JsonValue> applicationsJsonList(m_applications.size()); for(unsigned applicationsIndex = 0; applicationsIndex < applicationsJsonList.GetLength(); ++applicationsIndex) { applicationsJsonList[applicationsIndex].AsObject(m_applications[applicationsIndex].Jsonize()); } payload.WithArray("Applications", std::move(applicationsJsonList)); } if(m_tagsHasBeenSet) { Array<JsonValue> tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } if(m_serviceRoleHasBeenSet) { payload.WithString("ServiceRole", m_serviceRole); } if(m_normalizedInstanceHoursHasBeenSet) { payload.WithInteger("NormalizedInstanceHours", m_normalizedInstanceHours); } if(m_masterPublicDnsNameHasBeenSet) { payload.WithString("MasterPublicDnsName", m_masterPublicDnsName); } if(m_configurationsHasBeenSet) { Array<JsonValue> configurationsJsonList(m_configurations.size()); for(unsigned configurationsIndex = 0; configurationsIndex < configurationsJsonList.GetLength(); ++configurationsIndex) { configurationsJsonList[configurationsIndex].AsObject(m_configurations[configurationsIndex].Jsonize()); } payload.WithArray("Configurations", std::move(configurationsJsonList)); } return payload; }
JsonValue Project::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_sourceHasBeenSet) { payload.WithObject("source", m_source.Jsonize()); } if(m_secondarySourcesHasBeenSet) { Array<JsonValue> secondarySourcesJsonList(m_secondarySources.size()); for(unsigned secondarySourcesIndex = 0; secondarySourcesIndex < secondarySourcesJsonList.GetLength(); ++secondarySourcesIndex) { secondarySourcesJsonList[secondarySourcesIndex].AsObject(m_secondarySources[secondarySourcesIndex].Jsonize()); } payload.WithArray("secondarySources", std::move(secondarySourcesJsonList)); } if(m_artifactsHasBeenSet) { payload.WithObject("artifacts", m_artifacts.Jsonize()); } if(m_secondaryArtifactsHasBeenSet) { Array<JsonValue> secondaryArtifactsJsonList(m_secondaryArtifacts.size()); for(unsigned secondaryArtifactsIndex = 0; secondaryArtifactsIndex < secondaryArtifactsJsonList.GetLength(); ++secondaryArtifactsIndex) { secondaryArtifactsJsonList[secondaryArtifactsIndex].AsObject(m_secondaryArtifacts[secondaryArtifactsIndex].Jsonize()); } payload.WithArray("secondaryArtifacts", std::move(secondaryArtifactsJsonList)); } if(m_cacheHasBeenSet) { payload.WithObject("cache", m_cache.Jsonize()); } if(m_environmentHasBeenSet) { payload.WithObject("environment", m_environment.Jsonize()); } if(m_serviceRoleHasBeenSet) { payload.WithString("serviceRole", m_serviceRole); } if(m_timeoutInMinutesHasBeenSet) { payload.WithInteger("timeoutInMinutes", m_timeoutInMinutes); } if(m_encryptionKeyHasBeenSet) { payload.WithString("encryptionKey", m_encryptionKey); } if(m_tagsHasBeenSet) { Array<JsonValue> tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("tags", std::move(tagsJsonList)); } if(m_createdHasBeenSet) { payload.WithDouble("created", m_created.SecondsWithMSPrecision()); } if(m_lastModifiedHasBeenSet) { payload.WithDouble("lastModified", m_lastModified.SecondsWithMSPrecision()); } if(m_webhookHasBeenSet) { payload.WithObject("webhook", m_webhook.Jsonize()); } if(m_vpcConfigHasBeenSet) { payload.WithObject("vpcConfig", m_vpcConfig.Jsonize()); } if(m_badgeHasBeenSet) { payload.WithObject("badge", m_badge.Jsonize()); } if(m_logsConfigHasBeenSet) { payload.WithObject("logsConfig", m_logsConfig.Jsonize()); } return payload; }