/** * 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 AmplifyUIBuilder { namespace Model { /** *

Stores information for generating Amplify DataStore queries. Use a * Predicate to retrieve a subset of the data in a * collection.

See Also:

AWS * API Reference

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

A list of predicates to combine logically.

*/ inline const Aws::Vector& GetOr() const{ return m_or; } /** *

A list of predicates to combine logically.

*/ inline bool OrHasBeenSet() const { return m_orHasBeenSet; } /** *

A list of predicates to combine logically.

*/ inline void SetOr(const Aws::Vector& value) { m_orHasBeenSet = true; m_or = value; } /** *

A list of predicates to combine logically.

*/ inline void SetOr(Aws::Vector&& value) { m_orHasBeenSet = true; m_or = std::move(value); } /** *

A list of predicates to combine logically.

*/ inline Predicate& WithOr(const Aws::Vector& value) { SetOr(value); return *this;} /** *

A list of predicates to combine logically.

*/ inline Predicate& WithOr(Aws::Vector&& value) { SetOr(std::move(value)); return *this;} /** *

A list of predicates to combine logically.

*/ inline Predicate& AddOr(const Predicate& value) { m_orHasBeenSet = true; m_or.push_back(value); return *this; } /** *

A list of predicates to combine logically.

*/ inline Predicate& AddOr(Predicate&& value) { m_orHasBeenSet = true; m_or.push_back(std::move(value)); return *this; } /** *

A list of predicates to combine logically.

*/ inline const Aws::Vector& GetAnd() const{ return m_and; } /** *

A list of predicates to combine logically.

*/ inline bool AndHasBeenSet() const { return m_andHasBeenSet; } /** *

A list of predicates to combine logically.

*/ inline void SetAnd(const Aws::Vector& value) { m_andHasBeenSet = true; m_and = value; } /** *

A list of predicates to combine logically.

*/ inline void SetAnd(Aws::Vector&& value) { m_andHasBeenSet = true; m_and = std::move(value); } /** *

A list of predicates to combine logically.

*/ inline Predicate& WithAnd(const Aws::Vector& value) { SetAnd(value); return *this;} /** *

A list of predicates to combine logically.

*/ inline Predicate& WithAnd(Aws::Vector&& value) { SetAnd(std::move(value)); return *this;} /** *

A list of predicates to combine logically.

*/ inline Predicate& AddAnd(const Predicate& value) { m_andHasBeenSet = true; m_and.push_back(value); return *this; } /** *

A list of predicates to combine logically.

*/ inline Predicate& AddAnd(Predicate&& value) { m_andHasBeenSet = true; m_and.push_back(std::move(value)); return *this; } /** *

The field to query.

*/ inline const Aws::String& GetField() const{ return m_field; } /** *

The field to query.

*/ inline bool FieldHasBeenSet() const { return m_fieldHasBeenSet; } /** *

The field to query.

*/ inline void SetField(const Aws::String& value) { m_fieldHasBeenSet = true; m_field = value; } /** *

The field to query.

*/ inline void SetField(Aws::String&& value) { m_fieldHasBeenSet = true; m_field = std::move(value); } /** *

The field to query.

*/ inline void SetField(const char* value) { m_fieldHasBeenSet = true; m_field.assign(value); } /** *

The field to query.

*/ inline Predicate& WithField(const Aws::String& value) { SetField(value); return *this;} /** *

The field to query.

*/ inline Predicate& WithField(Aws::String&& value) { SetField(std::move(value)); return *this;} /** *

The field to query.

*/ inline Predicate& WithField(const char* value) { SetField(value); return *this;} /** *

The operator to use to perform the evaluation.

*/ inline const Aws::String& GetOperator() const{ return m_operator; } /** *

The operator to use to perform the evaluation.

*/ inline bool OperatorHasBeenSet() const { return m_operatorHasBeenSet; } /** *

The operator to use to perform the evaluation.

*/ inline void SetOperator(const Aws::String& value) { m_operatorHasBeenSet = true; m_operator = value; } /** *

The operator to use to perform the evaluation.

*/ inline void SetOperator(Aws::String&& value) { m_operatorHasBeenSet = true; m_operator = std::move(value); } /** *

The operator to use to perform the evaluation.

*/ inline void SetOperator(const char* value) { m_operatorHasBeenSet = true; m_operator.assign(value); } /** *

The operator to use to perform the evaluation.

*/ inline Predicate& WithOperator(const Aws::String& value) { SetOperator(value); return *this;} /** *

The operator to use to perform the evaluation.

*/ inline Predicate& WithOperator(Aws::String&& value) { SetOperator(std::move(value)); return *this;} /** *

The operator to use to perform the evaluation.

*/ inline Predicate& WithOperator(const char* value) { SetOperator(value); return *this;} /** *

The value to use when performing the evaluation.

*/ inline const Aws::String& GetOperand() const{ return m_operand; } /** *

The value to use when performing the evaluation.

*/ inline bool OperandHasBeenSet() const { return m_operandHasBeenSet; } /** *

The value to use when performing the evaluation.

*/ inline void SetOperand(const Aws::String& value) { m_operandHasBeenSet = true; m_operand = value; } /** *

The value to use when performing the evaluation.

*/ inline void SetOperand(Aws::String&& value) { m_operandHasBeenSet = true; m_operand = std::move(value); } /** *

The value to use when performing the evaluation.

*/ inline void SetOperand(const char* value) { m_operandHasBeenSet = true; m_operand.assign(value); } /** *

The value to use when performing the evaluation.

*/ inline Predicate& WithOperand(const Aws::String& value) { SetOperand(value); return *this;} /** *

The value to use when performing the evaluation.

*/ inline Predicate& WithOperand(Aws::String&& value) { SetOperand(std::move(value)); return *this;} /** *

The value to use when performing the evaluation.

*/ inline Predicate& WithOperand(const char* value) { SetOperand(value); return *this;} /** *

The type of value to use when performing the evaluation.

*/ inline const Aws::String& GetOperandType() const{ return m_operandType; } /** *

The type of value to use when performing the evaluation.

*/ inline bool OperandTypeHasBeenSet() const { return m_operandTypeHasBeenSet; } /** *

The type of value to use when performing the evaluation.

*/ inline void SetOperandType(const Aws::String& value) { m_operandTypeHasBeenSet = true; m_operandType = value; } /** *

The type of value to use when performing the evaluation.

*/ inline void SetOperandType(Aws::String&& value) { m_operandTypeHasBeenSet = true; m_operandType = std::move(value); } /** *

The type of value to use when performing the evaluation.

*/ inline void SetOperandType(const char* value) { m_operandTypeHasBeenSet = true; m_operandType.assign(value); } /** *

The type of value to use when performing the evaluation.

*/ inline Predicate& WithOperandType(const Aws::String& value) { SetOperandType(value); return *this;} /** *

The type of value to use when performing the evaluation.

*/ inline Predicate& WithOperandType(Aws::String&& value) { SetOperandType(std::move(value)); return *this;} /** *

The type of value to use when performing the evaluation.

*/ inline Predicate& WithOperandType(const char* value) { SetOperandType(value); return *this;} private: Aws::Vector m_or; bool m_orHasBeenSet = false; Aws::Vector m_and; bool m_andHasBeenSet = false; Aws::String m_field; bool m_fieldHasBeenSet = false; Aws::String m_operator; bool m_operatorHasBeenSet = false; Aws::String m_operand; bool m_operandHasBeenSet = false; Aws::String m_operandType; bool m_operandTypeHasBeenSet = false; }; } // namespace Model } // namespace AmplifyUIBuilder } // namespace Aws