﻿/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
*  http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/

#include <aws/backup/model/GetRecoveryPointRestoreMetadataResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::Backup::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

GetRecoveryPointRestoreMetadataResult::GetRecoveryPointRestoreMetadataResult()
{
}

GetRecoveryPointRestoreMetadataResult::GetRecoveryPointRestoreMetadataResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

GetRecoveryPointRestoreMetadataResult& GetRecoveryPointRestoreMetadataResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("BackupVaultArn"))
  {
    m_backupVaultArn = jsonValue.GetString("BackupVaultArn");

  }

  if(jsonValue.ValueExists("RecoveryPointArn"))
  {
    m_recoveryPointArn = jsonValue.GetString("RecoveryPointArn");

  }

  if(jsonValue.ValueExists("RestoreMetadata"))
  {
    Aws::Map<Aws::String, JsonView> restoreMetadataJsonMap = jsonValue.GetObject("RestoreMetadata").GetAllObjects();
    for(auto& restoreMetadataItem : restoreMetadataJsonMap)
    {
      m_restoreMetadata[restoreMetadataItem.first] = restoreMetadataItem.second.AsString();
    }
  }



  return *this;
}

{'avg_line_length': 30.227272727272727, 'max_line_length': 142, 'alphanum_fraction': 0.7714285714285715, 'licenses': ['Apache-2.0'], 'repository_name': '175703252/aws-sdk-cpp', 'path': 'aws-cpp-sdk-backup/source/model/GetRecoveryPointRestoreMetadataResult.cpp', 'size': 1997, 'lang': 'C++'}