/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace AppMesh { namespace Model { /** *

An object that represents a duration of time.

See Also:

AWS * API Reference

*/ class Duration { public: AWS_APPMESH_API Duration(); AWS_APPMESH_API Duration(Aws::Utils::Json::JsonView jsonValue); AWS_APPMESH_API Duration& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_APPMESH_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

A unit of time.

*/ inline const DurationUnit& GetUnit() const{ return m_unit; } /** *

A unit of time.

*/ inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; } /** *

A unit of time.

*/ inline void SetUnit(const DurationUnit& value) { m_unitHasBeenSet = true; m_unit = value; } /** *

A unit of time.

*/ inline void SetUnit(DurationUnit&& value) { m_unitHasBeenSet = true; m_unit = std::move(value); } /** *

A unit of time.

*/ inline Duration& WithUnit(const DurationUnit& value) { SetUnit(value); return *this;} /** *

A unit of time.

*/ inline Duration& WithUnit(DurationUnit&& value) { SetUnit(std::move(value)); return *this;} /** *

A number of time units.

*/ inline long long GetValue() const{ return m_value; } /** *

A number of time units.

*/ inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; } /** *

A number of time units.

*/ inline void SetValue(long long value) { m_valueHasBeenSet = true; m_value = value; } /** *

A number of time units.

*/ inline Duration& WithValue(long long value) { SetValue(value); return *this;} private: DurationUnit m_unit; bool m_unitHasBeenSet = false; long long m_value; bool m_valueHasBeenSet = false; }; } // namespace Model } // namespace AppMesh } // namespace Aws