| 1 | /************************************************************************************ |
| 2 | * |
| 3 | * D++, A Lightweight C++ library for Discord |
| 4 | * |
| 5 | * SPDX-License-Identifier: Apache-2.0 |
| 6 | * Copyright 2021 Craig Edwards and D++ contributors |
| 7 | * (https://github.com/brainboxdotcc/DPP/graphs/contributors) |
| 8 | * |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | * you may not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | * |
| 15 | * Unless required by applicable law or agreed to in writing, software |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | * See the License for the specific language governing permissions and |
| 19 | * limitations under the License. |
| 20 | * |
| 21 | ************************************************************************************/ |
| 22 | #pragma once |
| 23 | #include <dpp/export.h>cxx . . $ `<file>/include/dpp/export.h`/ |
| 24 | #include <dpp/snowflake.h>cxx . . $ `<file>/include/dpp/snowflake.h`/ |
| 25 | #include <dpp/json_fwd.h>cxx . . $ `<file>/include/dpp/json_fwd.h`/ |
| 26 | #include <dpp/json_interface.h>cxx . . $ `<file>/include/dpp/json_interface.h`/ |
| 27 | |
| 28 | namespace dppcxx . . $ dpp/ { |
| 29 | |
| 30 | /** |
| 31 | * @brief Defines a request to count prunable users, or start a prune operation |
| 32 | */ |
| 33 | struct DPP_EXPORTcxx . . $ `include/dpp/export.h:55:12`! prunecxx . . $ dpp/prune# : public json_interfacecxx . . $ dpp/json_interface#<prunecxx . . $ dpp/prune#> { |
| 34 | protected: |
| 35 | friend struct json_interfacecxx . . $ dpp/json_interface#<prunecxx . . $ dpp/prune#>; |
| 36 | |
| 37 | /** Fill this object from json. |
| 38 | * @param j JSON object to fill from |
| 39 | * @return A reference to self |
| 40 | */ |
| 41 | prunecxx . . $ dpp/prune#& fill_from_json_implcxx . . $ dpp/prune#fill_from_json_impl(6e3930e601907e68).(nlohmanncxx . . $ nlohmann/::jsoncxx . . $ nlohmann/json_abi_v3_11_3/json#* j); |
| 42 | |
| 43 | /** Build JSON from this object. |
| 44 | * @param with_prune_count True if the prune count boolean is to be set in the built JSON |
| 45 | * @return The JSON of the prune object |
| 46 | */ |
| 47 | virtual jsoncxx . . $ dpp/json# to_json_implcxx . . $ dpp/prune#to_json_impl(c45180a0dc2708f9).(bool with_prune_count = false) const; |
| 48 | |
| 49 | public: |
| 50 | /** |
| 51 | * @brief Destroy this prune object |
| 52 | */ |
| 53 | virtual ~cxx . . $ dpp/prune#`~prune`(ced63f7c635d850d).prunecxx . . $ dpp/prune#() = default; |
| 54 | |
| 55 | /** |
| 56 | * @brief Number of days to include in the prune. |
| 57 | */ |
| 58 | uint32_tcxx . . $ uint32_t# dayscxx . . $ dpp/prune#days. = 0; |
| 59 | |
| 60 | /** |
| 61 | * @brief Roles to include in the prune (empty to include everyone). |
| 62 | */ |
| 63 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<snowflakecxx . . $ dpp/snowflake#> include_rolescxx . . $ dpp/prune#include_roles.; |
| 64 | |
| 65 | /** |
| 66 | * @brief True if the count of pruneable users should be returned. |
| 67 | * @warning Discord recommend not using this on big guilds. |
| 68 | */ |
| 69 | bool compute_prune_countcxx . . $ dpp/prune#compute_prune_count.; |
| 70 | |
| 71 | /** |
| 72 | * @brief Build JSON from this object. |
| 73 | * |
| 74 | * @param with_id True if the prune count boolean is to be set in the built JSON |
| 75 | * @return The JSON of the prune object |
| 76 | */ |
| 77 | jsoncxx . . $ dpp/json# to_jsoncxx . . $ dpp/prune#to_json(c45180a0dc2708f9).(bool with_id = false) const; // Intentional shadow of json_interface, mostly present for documentation |
| 78 | }; |
| 79 | |
| 80 | } |