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

Contains criteria that define when and how to cancel a job.

The * deployment stops if the following conditions are true:

  1. The * number of things that receive the deployment exceeds the * minNumberOfExecutedThings.

  2. The percentage of * failures with type failureType exceeds the * thresholdPercentage.

See Also:

AWS * API Reference

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

The type of job deployment failure that can cancel a job.

*/ inline const IoTJobExecutionFailureType& GetFailureType() const{ return m_failureType; } /** *

The type of job deployment failure that can cancel a job.

*/ inline bool FailureTypeHasBeenSet() const { return m_failureTypeHasBeenSet; } /** *

The type of job deployment failure that can cancel a job.

*/ inline void SetFailureType(const IoTJobExecutionFailureType& value) { m_failureTypeHasBeenSet = true; m_failureType = value; } /** *

The type of job deployment failure that can cancel a job.

*/ inline void SetFailureType(IoTJobExecutionFailureType&& value) { m_failureTypeHasBeenSet = true; m_failureType = std::move(value); } /** *

The type of job deployment failure that can cancel a job.

*/ inline IoTJobAbortCriteria& WithFailureType(const IoTJobExecutionFailureType& value) { SetFailureType(value); return *this;} /** *

The type of job deployment failure that can cancel a job.

*/ inline IoTJobAbortCriteria& WithFailureType(IoTJobExecutionFailureType&& value) { SetFailureType(std::move(value)); return *this;} /** *

The action to perform when the criteria are met.

*/ inline const IoTJobAbortAction& GetAction() const{ return m_action; } /** *

The action to perform when the criteria are met.

*/ inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; } /** *

The action to perform when the criteria are met.

*/ inline void SetAction(const IoTJobAbortAction& value) { m_actionHasBeenSet = true; m_action = value; } /** *

The action to perform when the criteria are met.

*/ inline void SetAction(IoTJobAbortAction&& value) { m_actionHasBeenSet = true; m_action = std::move(value); } /** *

The action to perform when the criteria are met.

*/ inline IoTJobAbortCriteria& WithAction(const IoTJobAbortAction& value) { SetAction(value); return *this;} /** *

The action to perform when the criteria are met.

*/ inline IoTJobAbortCriteria& WithAction(IoTJobAbortAction&& value) { SetAction(std::move(value)); return *this;} /** *

The minimum percentage of failureType failures that occur before * the job can cancel.

This parameter supports up to two digits after the * decimal (for example, you can specify 10.9 or 10.99, * but not 10.999).

*/ inline double GetThresholdPercentage() const{ return m_thresholdPercentage; } /** *

The minimum percentage of failureType failures that occur before * the job can cancel.

This parameter supports up to two digits after the * decimal (for example, you can specify 10.9 or 10.99, * but not 10.999).

*/ inline bool ThresholdPercentageHasBeenSet() const { return m_thresholdPercentageHasBeenSet; } /** *

The minimum percentage of failureType failures that occur before * the job can cancel.

This parameter supports up to two digits after the * decimal (for example, you can specify 10.9 or 10.99, * but not 10.999).

*/ inline void SetThresholdPercentage(double value) { m_thresholdPercentageHasBeenSet = true; m_thresholdPercentage = value; } /** *

The minimum percentage of failureType failures that occur before * the job can cancel.

This parameter supports up to two digits after the * decimal (for example, you can specify 10.9 or 10.99, * but not 10.999).

*/ inline IoTJobAbortCriteria& WithThresholdPercentage(double value) { SetThresholdPercentage(value); return *this;} /** *

The minimum number of things that receive the configuration before the job * can cancel.

*/ inline int GetMinNumberOfExecutedThings() const{ return m_minNumberOfExecutedThings; } /** *

The minimum number of things that receive the configuration before the job * can cancel.

*/ inline bool MinNumberOfExecutedThingsHasBeenSet() const { return m_minNumberOfExecutedThingsHasBeenSet; } /** *

The minimum number of things that receive the configuration before the job * can cancel.

*/ inline void SetMinNumberOfExecutedThings(int value) { m_minNumberOfExecutedThingsHasBeenSet = true; m_minNumberOfExecutedThings = value; } /** *

The minimum number of things that receive the configuration before the job * can cancel.

*/ inline IoTJobAbortCriteria& WithMinNumberOfExecutedThings(int value) { SetMinNumberOfExecutedThings(value); return *this;} private: IoTJobExecutionFailureType m_failureType; bool m_failureTypeHasBeenSet = false; IoTJobAbortAction m_action; bool m_actionHasBeenSet = false; double m_thresholdPercentage; bool m_thresholdPercentageHasBeenSet = false; int m_minNumberOfExecutedThings; bool m_minNumberOfExecutedThingsHasBeenSet = false; }; } // namespace Model } // namespace GreengrassV2 } // namespace Aws