1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/accessanalyzer/model/Substring.h> 7 #include <aws/core/utils/json/JsonSerializer.h> 8 9 #include <utility> 10 11 using namespace Aws::Utils::Json; 12 using namespace Aws::Utils; 13 14 namespace Aws 15 { 16 namespace AccessAnalyzer 17 { 18 namespace Model 19 { 20 Substring()21Substring::Substring() : 22 m_length(0), 23 m_lengthHasBeenSet(false), 24 m_start(0), 25 m_startHasBeenSet(false) 26 { 27 } 28 Substring(JsonView jsonValue)29Substring::Substring(JsonView jsonValue) : 30 m_length(0), 31 m_lengthHasBeenSet(false), 32 m_start(0), 33 m_startHasBeenSet(false) 34 { 35 *this = jsonValue; 36 } 37 operator =(JsonView jsonValue)38Substring& Substring::operator =(JsonView jsonValue) 39 { 40 if(jsonValue.ValueExists("length")) 41 { 42 m_length = jsonValue.GetInteger("length"); 43 44 m_lengthHasBeenSet = true; 45 } 46 47 if(jsonValue.ValueExists("start")) 48 { 49 m_start = jsonValue.GetInteger("start"); 50 51 m_startHasBeenSet = true; 52 } 53 54 return *this; 55 } 56 Jsonize() const57JsonValue Substring::Jsonize() const 58 { 59 JsonValue payload; 60 61 if(m_lengthHasBeenSet) 62 { 63 payload.WithInteger("length", m_length); 64 65 } 66 67 if(m_startHasBeenSet) 68 { 69 payload.WithInteger("start", m_start); 70 71 } 72 73 return payload; 74 } 75 76 } // namespace Model 77 } // namespace AccessAnalyzer 78 } // namespace Aws 79