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/RecrawlPolicy.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 
RecrawlPolicy()21 RecrawlPolicy::RecrawlPolicy() :
22     m_recrawlBehavior(RecrawlBehavior::NOT_SET),
23     m_recrawlBehaviorHasBeenSet(false)
24 {
25 }
26 
RecrawlPolicy(JsonView jsonValue)27 RecrawlPolicy::RecrawlPolicy(JsonView jsonValue) :
28     m_recrawlBehavior(RecrawlBehavior::NOT_SET),
29     m_recrawlBehaviorHasBeenSet(false)
30 {
31   *this = jsonValue;
32 }
33 
operator =(JsonView jsonValue)34 RecrawlPolicy& RecrawlPolicy::operator =(JsonView jsonValue)
35 {
36   if(jsonValue.ValueExists("RecrawlBehavior"))
37   {
38     m_recrawlBehavior = RecrawlBehaviorMapper::GetRecrawlBehaviorForName(jsonValue.GetString("RecrawlBehavior"));
39 
40     m_recrawlBehaviorHasBeenSet = true;
41   }
42 
43   return *this;
44 }
45 
Jsonize() const46 JsonValue RecrawlPolicy::Jsonize() const
47 {
48   JsonValue payload;
49 
50   if(m_recrawlBehaviorHasBeenSet)
51   {
52    payload.WithString("RecrawlBehavior", RecrawlBehaviorMapper::GetNameForRecrawlBehavior(m_recrawlBehavior));
53   }
54 
55   return payload;
56 }
57 
58 } // namespace Model
59 } // namespace Glue
60 } // namespace Aws
61