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

[Snapshot policies only] Specifies a rule for sharing snapshots * across Amazon Web Services accounts.

See Also:

AWS API * Reference

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

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline const Aws::Vector& GetTargetAccounts() const{ return m_targetAccounts; } /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline bool TargetAccountsHasBeenSet() const { return m_targetAccountsHasBeenSet; } /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline void SetTargetAccounts(const Aws::Vector& value) { m_targetAccountsHasBeenSet = true; m_targetAccounts = value; } /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline void SetTargetAccounts(Aws::Vector&& value) { m_targetAccountsHasBeenSet = true; m_targetAccounts = std::move(value); } /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline ShareRule& WithTargetAccounts(const Aws::Vector& value) { SetTargetAccounts(value); return *this;} /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline ShareRule& WithTargetAccounts(Aws::Vector&& value) { SetTargetAccounts(std::move(value)); return *this;} /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline ShareRule& AddTargetAccounts(const Aws::String& value) { m_targetAccountsHasBeenSet = true; m_targetAccounts.push_back(value); return *this; } /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline ShareRule& AddTargetAccounts(Aws::String&& value) { m_targetAccountsHasBeenSet = true; m_targetAccounts.push_back(std::move(value)); return *this; } /** *

The IDs of the Amazon Web Services accounts with which to share the * snapshots.

*/ inline ShareRule& AddTargetAccounts(const char* value) { m_targetAccountsHasBeenSet = true; m_targetAccounts.push_back(value); return *this; } /** *

The period after which snapshots that are shared with other Amazon Web * Services accounts are automatically unshared.

*/ inline int GetUnshareInterval() const{ return m_unshareInterval; } /** *

The period after which snapshots that are shared with other Amazon Web * Services accounts are automatically unshared.

*/ inline bool UnshareIntervalHasBeenSet() const { return m_unshareIntervalHasBeenSet; } /** *

The period after which snapshots that are shared with other Amazon Web * Services accounts are automatically unshared.

*/ inline void SetUnshareInterval(int value) { m_unshareIntervalHasBeenSet = true; m_unshareInterval = value; } /** *

The period after which snapshots that are shared with other Amazon Web * Services accounts are automatically unshared.

*/ inline ShareRule& WithUnshareInterval(int value) { SetUnshareInterval(value); return *this;} /** *

The unit of time for the automatic unsharing interval.

*/ inline const RetentionIntervalUnitValues& GetUnshareIntervalUnit() const{ return m_unshareIntervalUnit; } /** *

The unit of time for the automatic unsharing interval.

*/ inline bool UnshareIntervalUnitHasBeenSet() const { return m_unshareIntervalUnitHasBeenSet; } /** *

The unit of time for the automatic unsharing interval.

*/ inline void SetUnshareIntervalUnit(const RetentionIntervalUnitValues& value) { m_unshareIntervalUnitHasBeenSet = true; m_unshareIntervalUnit = value; } /** *

The unit of time for the automatic unsharing interval.

*/ inline void SetUnshareIntervalUnit(RetentionIntervalUnitValues&& value) { m_unshareIntervalUnitHasBeenSet = true; m_unshareIntervalUnit = std::move(value); } /** *

The unit of time for the automatic unsharing interval.

*/ inline ShareRule& WithUnshareIntervalUnit(const RetentionIntervalUnitValues& value) { SetUnshareIntervalUnit(value); return *this;} /** *

The unit of time for the automatic unsharing interval.

*/ inline ShareRule& WithUnshareIntervalUnit(RetentionIntervalUnitValues&& value) { SetUnshareIntervalUnit(std::move(value)); return *this;} private: Aws::Vector m_targetAccounts; bool m_targetAccountsHasBeenSet = false; int m_unshareInterval; bool m_unshareIntervalHasBeenSet = false; RetentionIntervalUnitValues m_unshareIntervalUnit; bool m_unshareIntervalUnitHasBeenSet = false; }; } // namespace Model } // namespace DLM } // namespace Aws