| 75 | } |
| 76 | |
| 77 | std::string FSecure::GithubApi::CreateChannel(std::string const& channelName) |
| 78 | { |
| 79 | std::map<std::string, std::int64_t> channels = this->ListChannels(); |
| 80 | |
| 81 | if (channels.find(channelName) == channels.end()) |
| 82 | { |
| 83 | json j; |
| 84 | j[OBF("name")] = channelName; |
| 85 | j[OBF("auto_init")] = true; |
| 86 | j[OBF("private")] = true; |
| 87 | |
| 88 | auto response = SendJsonRequest(OBF("https://api.github.com/user/repos"), j, Method::POST); |
| 89 | |
| 90 | if (response.contains(OBF("message"))) |
| 91 | throw std::runtime_error(OBF("Github: unable to create channel - ") + response[OBF("message")]); |
| 92 | } |
| 93 | |
| 94 | return channelName; |
| 95 | } |
| 96 | |
| 97 | FSecure::ByteVector FSecure::GithubApi::ReadFile(std::string const& fileDownloadURL) |
| 98 | { |
nothing calls this directly
no test coverage detected