1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/glue/model/Segment.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 Glue 17 { 18 namespace Model 19 { 20 Segment()21Segment::Segment() : 22 m_segmentNumber(0), 23 m_segmentNumberHasBeenSet(false), 24 m_totalSegments(0), 25 m_totalSegmentsHasBeenSet(false) 26 { 27 } 28 Segment(JsonView jsonValue)29Segment::Segment(JsonView jsonValue) : 30 m_segmentNumber(0), 31 m_segmentNumberHasBeenSet(false), 32 m_totalSegments(0), 33 m_totalSegmentsHasBeenSet(false) 34 { 35 *this = jsonValue; 36 } 37 operator =(JsonView jsonValue)38Segment& Segment::operator =(JsonView jsonValue) 39 { 40 if(jsonValue.ValueExists("SegmentNumber")) 41 { 42 m_segmentNumber = jsonValue.GetInteger("SegmentNumber"); 43 44 m_segmentNumberHasBeenSet = true; 45 } 46 47 if(jsonValue.ValueExists("TotalSegments")) 48 { 49 m_totalSegments = jsonValue.GetInteger("TotalSegments"); 50 51 m_totalSegmentsHasBeenSet = true; 52 } 53 54 return *this; 55 } 56 Jsonize() const57JsonValue Segment::Jsonize() const 58 { 59 JsonValue payload; 60 61 if(m_segmentNumberHasBeenSet) 62 { 63 payload.WithInteger("SegmentNumber", m_segmentNumber); 64 65 } 66 67 if(m_totalSegmentsHasBeenSet) 68 { 69 payload.WithInteger("TotalSegments", m_totalSegments); 70 71 } 72 73 return payload; 74 } 75 76 } // namespace Model 77 } // namespace Glue 78 } // namespace Aws 79