/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include using namespace Aws::IoT::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws::Http; UpdatePackageVersionRequest::UpdatePackageVersionRequest() : m_packageNameHasBeenSet(false), m_versionNameHasBeenSet(false), m_descriptionHasBeenSet(false), m_attributesHasBeenSet(false), m_action(PackageVersionAction::NOT_SET), m_actionHasBeenSet(false), m_clientToken(Aws::Utils::UUID::PseudoRandomUUID()), m_clientTokenHasBeenSet(true) { } Aws::String UpdatePackageVersionRequest::SerializePayload() const { JsonValue payload; if(m_descriptionHasBeenSet) { payload.WithString("description", m_description); } if(m_attributesHasBeenSet) { JsonValue attributesJsonMap; for(auto& attributesItem : m_attributes) { attributesJsonMap.WithString(attributesItem.first, attributesItem.second); } payload.WithObject("attributes", std::move(attributesJsonMap)); } if(m_actionHasBeenSet) { payload.WithString("action", PackageVersionActionMapper::GetNameForPackageVersionAction(m_action)); } return payload.View().WriteReadable(); } void UpdatePackageVersionRequest::AddQueryStringParameters(URI& uri) const { Aws::StringStream ss; if(m_clientTokenHasBeenSet) { ss << m_clientToken; uri.AddQueryStringParameter("clientToken", ss.str()); ss.str(""); } }