/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace FSx { namespace Model { NFSDataRepositoryConfiguration::NFSDataRepositoryConfiguration() : m_version(NfsVersion::NOT_SET), m_versionHasBeenSet(false), m_dnsIpsHasBeenSet(false), m_autoExportPolicyHasBeenSet(false) { } NFSDataRepositoryConfiguration::NFSDataRepositoryConfiguration(JsonView jsonValue) : m_version(NfsVersion::NOT_SET), m_versionHasBeenSet(false), m_dnsIpsHasBeenSet(false), m_autoExportPolicyHasBeenSet(false) { *this = jsonValue; } NFSDataRepositoryConfiguration& NFSDataRepositoryConfiguration::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Version")) { m_version = NfsVersionMapper::GetNfsVersionForName(jsonValue.GetString("Version")); m_versionHasBeenSet = true; } if(jsonValue.ValueExists("DnsIps")) { Aws::Utils::Array dnsIpsJsonList = jsonValue.GetArray("DnsIps"); for(unsigned dnsIpsIndex = 0; dnsIpsIndex < dnsIpsJsonList.GetLength(); ++dnsIpsIndex) { m_dnsIps.push_back(dnsIpsJsonList[dnsIpsIndex].AsString()); } m_dnsIpsHasBeenSet = true; } if(jsonValue.ValueExists("AutoExportPolicy")) { m_autoExportPolicy = jsonValue.GetObject("AutoExportPolicy"); m_autoExportPolicyHasBeenSet = true; } return *this; } JsonValue NFSDataRepositoryConfiguration::Jsonize() const { JsonValue payload; if(m_versionHasBeenSet) { payload.WithString("Version", NfsVersionMapper::GetNameForNfsVersion(m_version)); } if(m_dnsIpsHasBeenSet) { Aws::Utils::Array dnsIpsJsonList(m_dnsIps.size()); for(unsigned dnsIpsIndex = 0; dnsIpsIndex < dnsIpsJsonList.GetLength(); ++dnsIpsIndex) { dnsIpsJsonList[dnsIpsIndex].AsString(m_dnsIps[dnsIpsIndex]); } payload.WithArray("DnsIps", std::move(dnsIpsJsonList)); } if(m_autoExportPolicyHasBeenSet) { payload.WithObject("AutoExportPolicy", m_autoExportPolicy.Jsonize()); } return payload; } } // namespace Model } // namespace FSx } // namespace Aws