/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::RolesAnywhere::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateTrustAnchorRequest::CreateTrustAnchorRequest() : m_enabled(false), m_enabledHasBeenSet(false), m_nameHasBeenSet(false), m_notificationSettingsHasBeenSet(false), m_sourceHasBeenSet(false), m_tagsHasBeenSet(false) { } Aws::String CreateTrustAnchorRequest::SerializePayload() const { JsonValue payload; if(m_enabledHasBeenSet) { payload.WithBool("enabled", m_enabled); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_notificationSettingsHasBeenSet) { Aws::Utils::Array notificationSettingsJsonList(m_notificationSettings.size()); for(unsigned notificationSettingsIndex = 0; notificationSettingsIndex < notificationSettingsJsonList.GetLength(); ++notificationSettingsIndex) { notificationSettingsJsonList[notificationSettingsIndex].AsObject(m_notificationSettings[notificationSettingsIndex].Jsonize()); } payload.WithArray("notificationSettings", std::move(notificationSettingsJsonList)); } if(m_sourceHasBeenSet) { payload.WithObject("source", m_source.Jsonize()); } if(m_tagsHasBeenSet) { Aws::Utils::Array 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.View().WriteReadable(); }