/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::IoT::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; CreateProvisioningTemplateVersionResult::CreateProvisioningTemplateVersionResult() : m_versionId(0), m_isDefaultVersion(false) { } CreateProvisioningTemplateVersionResult::CreateProvisioningTemplateVersionResult(const Aws::AmazonWebServiceResult& result) : m_versionId(0), m_isDefaultVersion(false) { *this = result; } CreateProvisioningTemplateVersionResult& CreateProvisioningTemplateVersionResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("templateArn")) { m_templateArn = jsonValue.GetString("templateArn"); } if(jsonValue.ValueExists("templateName")) { m_templateName = jsonValue.GetString("templateName"); } if(jsonValue.ValueExists("versionId")) { m_versionId = jsonValue.GetInteger("versionId"); } if(jsonValue.ValueExists("isDefaultVersion")) { m_isDefaultVersion = jsonValue.GetBool("isDefaultVersion"); } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }