diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-01-21 22:03:11 +0100 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-01-21 22:03:11 +0100 |
commit | 996c722f90a0cf24197d5ca4edb36fd1c3e0bd87 (patch) | |
tree | 3a7832c438c6e1f06bbce681b0d6bbdf5dc11924 /src | |
parent | format format format (diff) | |
download | forgejo-api-996c722f90a0cf24197d5ca4edb36fd1c3e0bd87.tar.xz forgejo-api-996c722f90a0cf24197d5ca4edb36fd1c3e0bd87.zip |
support returning header values
Diffstat (limited to 'src')
-rw-r--r-- | src/generated.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/generated.rs b/src/generated.rs index daf0a94..39548d9 100644 --- a/src/generated.rs +++ b/src/generated.rs @@ -1864,7 +1864,7 @@ impl crate::Forgejo { owner: &str, repo: &str, query: RepoGetAllCommitsQuery, - ) -> Result<Vec<Commit>, ForgejoError> { + ) -> Result<(reqwest::header::HeaderMap, Vec<Commit>), ForgejoError> { let request = self .get(&format!( "repos/{owner}/{repo}/commits?{}", @@ -1873,7 +1873,7 @@ impl crate::Forgejo { .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok(response.json().await?), + 200 => Ok((response.headers().clone(), response.json().await?)), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -4572,7 +4572,7 @@ impl crate::Forgejo { repo: &str, index: u64, query: RepoGetPullRequestCommitsQuery, - ) -> Result<Vec<Commit>, ForgejoError> { + ) -> Result<(reqwest::header::HeaderMap, Vec<Commit>), ForgejoError> { let request = self .get(&format!( "repos/{owner}/{repo}/pulls/{index}/commits?{}", @@ -4581,7 +4581,7 @@ impl crate::Forgejo { .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok(response.json().await?), + 200 => Ok((response.headers().clone(), response.json().await?)), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -4597,7 +4597,7 @@ impl crate::Forgejo { repo: &str, index: u64, query: RepoGetPullRequestFilesQuery, - ) -> Result<Vec<ChangedFile>, ForgejoError> { + ) -> Result<(reqwest::header::HeaderMap, Vec<ChangedFile>), ForgejoError> { let request = self .get(&format!( "repos/{owner}/{repo}/pulls/{index}/files?{}", @@ -4606,7 +4606,7 @@ impl crate::Forgejo { .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok(response.json().await?), + 200 => Ok((response.headers().clone(), response.json().await?)), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } |