-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathupdateIPaddressAttribute.cpp
More file actions
26 lines (22 loc) · 943 Bytes
/
updateIPaddressAttribute.cpp
File metadata and controls
26 lines (22 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "Appwrite.hpp"
#include <iostream>
int main() {
std::string projectId = "66fbb5a100070a3a1d19";
std::string apiKey = "";
std::string databaseId = "database123";
std::string collectionId = "test1234";
std::string attributeId = "IPA123";
bool required = true;
std::string new_key = "UpdatedIPaddress123";
std::string defaultValue = "";
Appwrite appwrite(projectId, apiKey);
try {
std::string response = appwrite.getDatabases().updateIPaddressAttribute(databaseId, collectionId, attributeId, required, defaultValue, new_key);
std::cout << "IP Address attribute updated successfully!\nResponse: " << response << std::endl;
} catch (const AppwriteException& ex) {
std::cerr << "Appwrite exception: " << ex.what() << std::endl;
} catch (const std::exception& ex) {
std::cerr << "Standard exception: " << ex.what() << std::endl;
}
return 0;
}