DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
StageInstanceEntities.hpp
Go to the documentation of this file.
1/*
2 DiscordCoreAPI, A bot library for Discord, written in C++, and featuring explicit multithreading through the usage of custom, asynchronous C++ CoRoutines.
3
4 Copyright 2021, 2022 Chris M. (RealTimeChris)
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 USA
20*/
21/// StageInstanceEntities.hpp - Source file for the Stage Instance related stuff.
22/// Nov 29, 2021 Chris M.
23/// https://discordcoreapi.com
24/// \file StageInstanceEntities.hpp
25
26#pragma once
27
28#ifndef STAGE_INSTANCE_ENTITIES
29 #define STAGE_INSTANCE_ENTITIES
30
33
34namespace DiscordCoreAPI {
35
36 /// For creating a StageInstance. \brief For creating a StageInstance.
37 struct DiscordCoreAPI_Dll CreateStageInstanceData {
38 StageInstancePrivacyLevel privacyLevel{};///< The privacy level of the Stage instance(default Guild_Only).
39 Snowflake channelId{};///< The id of the Stage Channel.
40 String reason{};///< The reason for starting it.
41 String topic{};///< The topic of the Stage instance(1 - 120 characters).
42 };
43
44 /// For collecting a single StageInstance. \brief For collecting a single StageInstance.
45 struct DiscordCoreAPI_Dll GetStageInstanceData {
46 Snowflake channelId{};///< The Channel id from which you would like to collect the StageInstance.
47 };
48
49 /// For modifying a single StageInstance. \brief For modifying a single StageInstance.
50 struct DiscordCoreAPI_Dll ModifyStageInstanceData {
51 StageInstancePrivacyLevel privacyLevel{};///< The privacy level of the Stage instance.
52 Snowflake channelId{};///< The Channel Id of the StageInstance.
53 String reason{};///< Reason for modifying the StageInstance.
54 String topic{};///< The topic of the Stage instance(1 - 120 characters).
55 };
56
57 /// For deleting a single StageInstance. \brief For deleting a single StageInstance.
58 struct DiscordCoreAPI_Dll DeleteStageInstanceData {
59 Snowflake channelId{};///< The Channel Id of the StageInstance.
60 String reason{};///< Reason for deleting the StageInstance.
61 };
62
63 /// A single StageInstance. \brief A single StageInstance.
64 class DiscordCoreAPI_Dll StageInstance : public StageInstanceData {
65 public:
66 StageInstance() noexcept = default;
67
68 StageInstance(simdjson::ondemand::value jsonObjectData);
69
70 virtual ~StageInstance() noexcept = default;
71 };
72
73 /**
74 * \addtogroup main_endpoints
75 * @{
76 */
77 /// An interface class for the StageInstance related Discord endpoints. \brief An interface class for the StageInstance related Discord endpoints.
78 class DiscordCoreAPI_Dll StageInstances {
79 public:
80 static void initialize(DiscordCoreInternal::HttpsClient*);
81
82 /// Creates a StageInstance. \brief Creates a StageInstance.
83 /// \param dataPackage A CreateStageInstanceData structure.
84 /// \returns A CoRoutine containing a StageInstance.
85 static CoRoutine<StageInstance> createStageInstanceAsync(CreateStageInstanceData dataPackage);
86
87 /// Collects a StageInstance. \brief Collects a StageInstance.
88 /// \param dataPackage A GetStageInstanceData structure.
89 /// \returns A CoRoutine containing a StageInstance.
90 static CoRoutine<StageInstance> getStageInstanceAsync(GetStageInstanceData dataPackage);
91
92 /// Modifies a StageInstance. \brief Modifies a StageInstance.
93 /// \param dataPackage A ModifyStageInstanceData structure.
94 /// \returns A CoRoutine containing a StageInstance.
95 static CoRoutine<StageInstance> modifyStageInstanceAsync(ModifyStageInstanceData dataPackage);
96
97 /// Deletes a StageInstance. \brief Deletes a StageInstance.
98 /// \param dataPackage A DeleteStageInstanceData structure.
99 /// \returns A CoRoutine containing void.
100 static CoRoutine<void> deleteStageInstanceAsync(DeleteStageInstanceData dataPackage);
101
102 protected:
103 static DiscordCoreInternal::HttpsClient* httpsClient;
104 };
105
106 /**@}*/
107}// namespace DiscordCoreAPI
108#endif
StageInstancePrivacyLevel
Stage instance privacy levels.
The main namespace for this library.
A CoRoutine - representing a potentially asynchronous operation/function.
Definition: CoRoutine.hpp:62
For collecting a single StageInstance.
For modifying a single StageInstance.
For deleting a single StageInstance.
An interface class for the StageInstance related Discord endpoints.