| 118 | } |
| 119 | |
| 120 | void GetProjectInfo( |
| 121 | OAuthService& oAuthService, const ServiceConfig& serviceConfig, |
| 122 | std::string projectId, |
| 123 | std::function<void(sync::ProjectInfo, ResponseResult)> callback) |
| 124 | { |
| 125 | assert(callback); |
| 126 | |
| 127 | PerformProjectGetRequest( |
| 128 | oAuthService, serviceConfig.GetProjectInfoUrl(projectId), |
| 129 | [callback = std::move(callback)](ResponseResult result) |
| 130 | { |
| 131 | if (result.Code != SyncResultCode::Success) |
| 132 | { |
| 133 | callback(sync::ProjectInfo {}, std::move(result)); |
| 134 | return; |
| 135 | } |
| 136 | |
| 137 | auto projectInfo = sync::DeserializeProjectInfo(result.Content); |
| 138 | |
| 139 | if (!projectInfo) |
| 140 | { |
| 141 | callback( |
| 142 | {}, { SyncResultCode::UnexpectedResponse, |
| 143 | std::move(result.Content) }); |
| 144 | return; |
| 145 | } |
| 146 | |
| 147 | callback(std::move(*projectInfo), std::move(result)); |
| 148 | }); |
| 149 | } |
| 150 | |
| 151 | void GetSnapshotInfo( |
| 152 | OAuthService& oAuthService, const ServiceConfig& serviceConfig, |
no test coverage detected