openapi_github/apis/
activity_api.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`activity_slash_check_repo_is_starred_by_authenticated_user`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ActivitySlashCheckRepoIsStarredByAuthenticatedUserError {
22    Status401(models::BasicError),
23    Status403(models::BasicError),
24    Status404(models::BasicError),
25    UnknownValue(serde_json::Value),
26}
27
28/// struct for typed errors of method [`activity_slash_delete_repo_subscription`]
29#[derive(Debug, Clone, Serialize, Deserialize)]
30#[serde(untagged)]
31pub enum ActivitySlashDeleteRepoSubscriptionError {
32    UnknownValue(serde_json::Value),
33}
34
35/// struct for typed errors of method [`activity_slash_delete_thread_subscription`]
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum ActivitySlashDeleteThreadSubscriptionError {
39    Status401(models::BasicError),
40    Status403(models::BasicError),
41    UnknownValue(serde_json::Value),
42}
43
44/// struct for typed errors of method [`activity_slash_get_feeds`]
45#[derive(Debug, Clone, Serialize, Deserialize)]
46#[serde(untagged)]
47pub enum ActivitySlashGetFeedsError {
48    UnknownValue(serde_json::Value),
49}
50
51/// struct for typed errors of method [`activity_slash_get_repo_subscription`]
52#[derive(Debug, Clone, Serialize, Deserialize)]
53#[serde(untagged)]
54pub enum ActivitySlashGetRepoSubscriptionError {
55    Status403(models::BasicError),
56    Status404(),
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`activity_slash_get_thread`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ActivitySlashGetThreadError {
64    Status401(models::BasicError),
65    Status403(models::BasicError),
66    UnknownValue(serde_json::Value),
67}
68
69/// struct for typed errors of method [`activity_slash_get_thread_subscription_for_authenticated_user`]
70#[derive(Debug, Clone, Serialize, Deserialize)]
71#[serde(untagged)]
72pub enum ActivitySlashGetThreadSubscriptionForAuthenticatedUserError {
73    Status401(models::BasicError),
74    Status403(models::BasicError),
75    UnknownValue(serde_json::Value),
76}
77
78/// struct for typed errors of method [`activity_slash_list_events_for_authenticated_user`]
79#[derive(Debug, Clone, Serialize, Deserialize)]
80#[serde(untagged)]
81pub enum ActivitySlashListEventsForAuthenticatedUserError {
82    UnknownValue(serde_json::Value),
83}
84
85/// struct for typed errors of method [`activity_slash_list_notifications_for_authenticated_user`]
86#[derive(Debug, Clone, Serialize, Deserialize)]
87#[serde(untagged)]
88pub enum ActivitySlashListNotificationsForAuthenticatedUserError {
89    Status401(models::BasicError),
90    Status403(models::BasicError),
91    Status422(models::ValidationError),
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`activity_slash_list_org_events_for_authenticated_user`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ActivitySlashListOrgEventsForAuthenticatedUserError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`activity_slash_list_public_events`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ActivitySlashListPublicEventsError {
106    Status403(models::BasicError),
107    Status503(models::SecretScanningListAlertsForEnterprise503Response),
108    UnknownValue(serde_json::Value),
109}
110
111/// struct for typed errors of method [`activity_slash_list_public_events_for_repo_network`]
112#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(untagged)]
114pub enum ActivitySlashListPublicEventsForRepoNetworkError {
115    Status403(models::BasicError),
116    Status404(models::BasicError),
117    UnknownValue(serde_json::Value),
118}
119
120/// struct for typed errors of method [`activity_slash_list_public_events_for_user`]
121#[derive(Debug, Clone, Serialize, Deserialize)]
122#[serde(untagged)]
123pub enum ActivitySlashListPublicEventsForUserError {
124    UnknownValue(serde_json::Value),
125}
126
127/// struct for typed errors of method [`activity_slash_list_public_org_events`]
128#[derive(Debug, Clone, Serialize, Deserialize)]
129#[serde(untagged)]
130pub enum ActivitySlashListPublicOrgEventsError {
131    UnknownValue(serde_json::Value),
132}
133
134/// struct for typed errors of method [`activity_slash_list_received_events_for_user`]
135#[derive(Debug, Clone, Serialize, Deserialize)]
136#[serde(untagged)]
137pub enum ActivitySlashListReceivedEventsForUserError {
138    UnknownValue(serde_json::Value),
139}
140
141/// struct for typed errors of method [`activity_slash_list_received_public_events_for_user`]
142#[derive(Debug, Clone, Serialize, Deserialize)]
143#[serde(untagged)]
144pub enum ActivitySlashListReceivedPublicEventsForUserError {
145    UnknownValue(serde_json::Value),
146}
147
148/// struct for typed errors of method [`activity_slash_list_repo_events`]
149#[derive(Debug, Clone, Serialize, Deserialize)]
150#[serde(untagged)]
151pub enum ActivitySlashListRepoEventsError {
152    UnknownValue(serde_json::Value),
153}
154
155/// struct for typed errors of method [`activity_slash_list_repo_notifications_for_authenticated_user`]
156#[derive(Debug, Clone, Serialize, Deserialize)]
157#[serde(untagged)]
158pub enum ActivitySlashListRepoNotificationsForAuthenticatedUserError {
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`activity_slash_list_repos_starred_by_authenticated_user`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum ActivitySlashListReposStarredByAuthenticatedUserError {
166    Status401(models::BasicError),
167    Status403(models::BasicError),
168    UnknownValue(serde_json::Value),
169}
170
171/// struct for typed errors of method [`activity_slash_list_repos_starred_by_user`]
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum ActivitySlashListReposStarredByUserError {
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`activity_slash_list_repos_watched_by_user`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum ActivitySlashListReposWatchedByUserError {
182    UnknownValue(serde_json::Value),
183}
184
185/// struct for typed errors of method [`activity_slash_list_stargazers_for_repo`]
186#[derive(Debug, Clone, Serialize, Deserialize)]
187#[serde(untagged)]
188pub enum ActivitySlashListStargazersForRepoError {
189    Status422(models::ValidationError),
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`activity_slash_list_watched_repos_for_authenticated_user`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum ActivitySlashListWatchedReposForAuthenticatedUserError {
197    Status401(models::BasicError),
198    Status403(models::BasicError),
199    UnknownValue(serde_json::Value),
200}
201
202/// struct for typed errors of method [`activity_slash_list_watchers_for_repo`]
203#[derive(Debug, Clone, Serialize, Deserialize)]
204#[serde(untagged)]
205pub enum ActivitySlashListWatchersForRepoError {
206    UnknownValue(serde_json::Value),
207}
208
209/// struct for typed errors of method [`activity_slash_mark_notifications_as_read`]
210#[derive(Debug, Clone, Serialize, Deserialize)]
211#[serde(untagged)]
212pub enum ActivitySlashMarkNotificationsAsReadError {
213    Status401(models::BasicError),
214    Status403(models::BasicError),
215    UnknownValue(serde_json::Value),
216}
217
218/// struct for typed errors of method [`activity_slash_mark_repo_notifications_as_read`]
219#[derive(Debug, Clone, Serialize, Deserialize)]
220#[serde(untagged)]
221pub enum ActivitySlashMarkRepoNotificationsAsReadError {
222    UnknownValue(serde_json::Value),
223}
224
225/// struct for typed errors of method [`activity_slash_mark_thread_as_done`]
226#[derive(Debug, Clone, Serialize, Deserialize)]
227#[serde(untagged)]
228pub enum ActivitySlashMarkThreadAsDoneError {
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed errors of method [`activity_slash_mark_thread_as_read`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum ActivitySlashMarkThreadAsReadError {
236    Status403(models::BasicError),
237    UnknownValue(serde_json::Value),
238}
239
240/// struct for typed errors of method [`activity_slash_set_repo_subscription`]
241#[derive(Debug, Clone, Serialize, Deserialize)]
242#[serde(untagged)]
243pub enum ActivitySlashSetRepoSubscriptionError {
244    UnknownValue(serde_json::Value),
245}
246
247/// struct for typed errors of method [`activity_slash_set_thread_subscription`]
248#[derive(Debug, Clone, Serialize, Deserialize)]
249#[serde(untagged)]
250pub enum ActivitySlashSetThreadSubscriptionError {
251    Status401(models::BasicError),
252    Status403(models::BasicError),
253    UnknownValue(serde_json::Value),
254}
255
256/// struct for typed errors of method [`activity_slash_star_repo_for_authenticated_user`]
257#[derive(Debug, Clone, Serialize, Deserialize)]
258#[serde(untagged)]
259pub enum ActivitySlashStarRepoForAuthenticatedUserError {
260    Status401(models::BasicError),
261    Status403(models::BasicError),
262    Status404(models::BasicError),
263    UnknownValue(serde_json::Value),
264}
265
266/// struct for typed errors of method [`activity_slash_unstar_repo_for_authenticated_user`]
267#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum ActivitySlashUnstarRepoForAuthenticatedUserError {
270    Status401(models::BasicError),
271    Status403(models::BasicError),
272    Status404(models::BasicError),
273    UnknownValue(serde_json::Value),
274}
275
276
277/// Whether the authenticated user has starred the repository.
278pub async fn activity_slash_check_repo_is_starred_by_authenticated_user(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ActivitySlashCheckRepoIsStarredByAuthenticatedUserError>> {
279    let local_var_configuration = configuration;
280
281    let local_var_client = &local_var_configuration.client;
282
283    let local_var_uri_str = format!("{}/user/starred/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
284    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
285
286    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
287        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
288    }
289
290    let local_var_req = local_var_req_builder.build()?;
291    let local_var_resp = local_var_client.execute(local_var_req).await?;
292
293    let local_var_status = local_var_resp.status();
294    let local_var_content = local_var_resp.text().await?;
295
296    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
297        Ok(())
298    } else {
299        let local_var_entity: Option<ActivitySlashCheckRepoIsStarredByAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
300        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
301        Err(Error::ResponseError(local_var_error))
302    }
303}
304
305/// This endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/rest/activity/watching#set-a-repository-subscription).
306pub async fn activity_slash_delete_repo_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ActivitySlashDeleteRepoSubscriptionError>> {
307    let local_var_configuration = configuration;
308
309    let local_var_client = &local_var_configuration.client;
310
311    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscription", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
312    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
313
314    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
315        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
316    }
317
318    let local_var_req = local_var_req_builder.build()?;
319    let local_var_resp = local_var_client.execute(local_var_req).await?;
320
321    let local_var_status = local_var_resp.status();
322    let local_var_content = local_var_resp.text().await?;
323
324    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
325        Ok(())
326    } else {
327        let local_var_entity: Option<ActivitySlashDeleteRepoSubscriptionError> = serde_json::from_str(&local_var_content).ok();
328        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
329        Err(Error::ResponseError(local_var_error))
330    }
331}
332
333/// Mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`.
334pub async fn activity_slash_delete_thread_subscription(configuration: &configuration::Configuration, thread_id: i32) -> Result<(), Error<ActivitySlashDeleteThreadSubscriptionError>> {
335    let local_var_configuration = configuration;
336
337    let local_var_client = &local_var_configuration.client;
338
339    let local_var_uri_str = format!("{}/notifications/threads/{thread_id}/subscription", local_var_configuration.base_path, thread_id=thread_id);
340    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
341
342    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
343        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
344    }
345
346    let local_var_req = local_var_req_builder.build()?;
347    let local_var_resp = local_var_client.execute(local_var_req).await?;
348
349    let local_var_status = local_var_resp.status();
350    let local_var_content = local_var_resp.text().await?;
351
352    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
353        Ok(())
354    } else {
355        let local_var_entity: Option<ActivitySlashDeleteThreadSubscriptionError> = serde_json::from_str(&local_var_content).ok();
356        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
357        Err(Error::ResponseError(local_var_error))
358    }
359}
360
361/// Lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.  *   **Timeline**: The GitHub global public timeline *   **User**: The public timeline for any user, using `uri_template`. For more information, see \"[Hypermedia](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia).\" *   **Current user public**: The public timeline for the authenticated user *   **Current user**: The private timeline for the authenticated user *   **Current user actor**: The private timeline for activity created by the authenticated user *   **Current user organizations**: The private timeline for the organizations the authenticated user is a member of. *   **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub.  By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  **Note**: Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/rest/overview/other-authentication-methods#basic-authentication) since current feed URIs use the older, non revocable auth tokens.
362pub async fn activity_slash_get_feeds(configuration: &configuration::Configuration, ) -> Result<models::Feed, Error<ActivitySlashGetFeedsError>> {
363    let local_var_configuration = configuration;
364
365    let local_var_client = &local_var_configuration.client;
366
367    let local_var_uri_str = format!("{}/feeds", local_var_configuration.base_path);
368    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
369
370    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
371        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
372    }
373
374    let local_var_req = local_var_req_builder.build()?;
375    let local_var_resp = local_var_client.execute(local_var_req).await?;
376
377    let local_var_status = local_var_resp.status();
378    let local_var_content = local_var_resp.text().await?;
379
380    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
381        serde_json::from_str(&local_var_content).map_err(Error::from)
382    } else {
383        let local_var_entity: Option<ActivitySlashGetFeedsError> = serde_json::from_str(&local_var_content).ok();
384        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
385        Err(Error::ResponseError(local_var_error))
386    }
387}
388
389/// Gets information about whether the authenticated user is subscribed to the repository.
390pub async fn activity_slash_get_repo_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::RepositorySubscription, Error<ActivitySlashGetRepoSubscriptionError>> {
391    let local_var_configuration = configuration;
392
393    let local_var_client = &local_var_configuration.client;
394
395    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscription", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
396    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
397
398    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
399        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
400    }
401
402    let local_var_req = local_var_req_builder.build()?;
403    let local_var_resp = local_var_client.execute(local_var_req).await?;
404
405    let local_var_status = local_var_resp.status();
406    let local_var_content = local_var_resp.text().await?;
407
408    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
409        serde_json::from_str(&local_var_content).map_err(Error::from)
410    } else {
411        let local_var_entity: Option<ActivitySlashGetRepoSubscriptionError> = serde_json::from_str(&local_var_content).ok();
412        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
413        Err(Error::ResponseError(local_var_error))
414    }
415}
416
417/// Gets information about a notification thread.
418pub async fn activity_slash_get_thread(configuration: &configuration::Configuration, thread_id: i32) -> Result<models::Thread, Error<ActivitySlashGetThreadError>> {
419    let local_var_configuration = configuration;
420
421    let local_var_client = &local_var_configuration.client;
422
423    let local_var_uri_str = format!("{}/notifications/threads/{thread_id}", local_var_configuration.base_path, thread_id=thread_id);
424    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
425
426    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
427        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
428    }
429
430    let local_var_req = local_var_req_builder.build()?;
431    let local_var_resp = local_var_client.execute(local_var_req).await?;
432
433    let local_var_status = local_var_resp.status();
434    let local_var_content = local_var_resp.text().await?;
435
436    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
437        serde_json::from_str(&local_var_content).map_err(Error::from)
438    } else {
439        let local_var_entity: Option<ActivitySlashGetThreadError> = serde_json::from_str(&local_var_content).ok();
440        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
441        Err(Error::ResponseError(local_var_error))
442    }
443}
444
445/// This checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/rest/activity/watching#get-a-repository-subscription).  Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread.
446pub async fn activity_slash_get_thread_subscription_for_authenticated_user(configuration: &configuration::Configuration, thread_id: i32) -> Result<models::ThreadSubscription, Error<ActivitySlashGetThreadSubscriptionForAuthenticatedUserError>> {
447    let local_var_configuration = configuration;
448
449    let local_var_client = &local_var_configuration.client;
450
451    let local_var_uri_str = format!("{}/notifications/threads/{thread_id}/subscription", local_var_configuration.base_path, thread_id=thread_id);
452    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
453
454    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
455        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
456    }
457
458    let local_var_req = local_var_req_builder.build()?;
459    let local_var_resp = local_var_client.execute(local_var_req).await?;
460
461    let local_var_status = local_var_resp.status();
462    let local_var_content = local_var_resp.text().await?;
463
464    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
465        serde_json::from_str(&local_var_content).map_err(Error::from)
466    } else {
467        let local_var_entity: Option<ActivitySlashGetThreadSubscriptionForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
468        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
469        Err(Error::ResponseError(local_var_error))
470    }
471}
472
473/// If you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.
474pub async fn activity_slash_list_events_for_authenticated_user(configuration: &configuration::Configuration, username: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListEventsForAuthenticatedUserError>> {
475    let local_var_configuration = configuration;
476
477    let local_var_client = &local_var_configuration.client;
478
479    let local_var_uri_str = format!("{}/users/{username}/events", local_var_configuration.base_path, username=crate::apis::urlencode(username));
480    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
481
482    if let Some(ref local_var_str) = per_page {
483        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
484    }
485    if let Some(ref local_var_str) = page {
486        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
487    }
488    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
489        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
490    }
491
492    let local_var_req = local_var_req_builder.build()?;
493    let local_var_resp = local_var_client.execute(local_var_req).await?;
494
495    let local_var_status = local_var_resp.status();
496    let local_var_content = local_var_resp.text().await?;
497
498    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
499        serde_json::from_str(&local_var_content).map_err(Error::from)
500    } else {
501        let local_var_entity: Option<ActivitySlashListEventsForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
502        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
503        Err(Error::ResponseError(local_var_error))
504    }
505}
506
507/// List all notifications for the current user, sorted by most recently updated.
508pub async fn activity_slash_list_notifications_for_authenticated_user(configuration: &configuration::Configuration, all: Option<bool>, participating: Option<bool>, since: Option<String>, before: Option<String>, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::Thread>, Error<ActivitySlashListNotificationsForAuthenticatedUserError>> {
509    let local_var_configuration = configuration;
510
511    let local_var_client = &local_var_configuration.client;
512
513    let local_var_uri_str = format!("{}/notifications", local_var_configuration.base_path);
514    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
515
516    if let Some(ref local_var_str) = all {
517        local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]);
518    }
519    if let Some(ref local_var_str) = participating {
520        local_var_req_builder = local_var_req_builder.query(&[("participating", &local_var_str.to_string())]);
521    }
522    if let Some(ref local_var_str) = since {
523        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
524    }
525    if let Some(ref local_var_str) = before {
526        local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
527    }
528    if let Some(ref local_var_str) = page {
529        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
530    }
531    if let Some(ref local_var_str) = per_page {
532        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
533    }
534    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
535        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
536    }
537
538    let local_var_req = local_var_req_builder.build()?;
539    let local_var_resp = local_var_client.execute(local_var_req).await?;
540
541    let local_var_status = local_var_resp.status();
542    let local_var_content = local_var_resp.text().await?;
543
544    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
545        serde_json::from_str(&local_var_content).map_err(Error::from)
546    } else {
547        let local_var_entity: Option<ActivitySlashListNotificationsForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
548        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
549        Err(Error::ResponseError(local_var_error))
550    }
551}
552
553/// This is the user's organization dashboard. You must be authenticated as the user to view this.
554pub async fn activity_slash_list_org_events_for_authenticated_user(configuration: &configuration::Configuration, username: &str, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListOrgEventsForAuthenticatedUserError>> {
555    let local_var_configuration = configuration;
556
557    let local_var_client = &local_var_configuration.client;
558
559    let local_var_uri_str = format!("{}/users/{username}/events/orgs/{org}", local_var_configuration.base_path, username=crate::apis::urlencode(username), org=crate::apis::urlencode(org));
560    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
561
562    if let Some(ref local_var_str) = per_page {
563        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
564    }
565    if let Some(ref local_var_str) = page {
566        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
567    }
568    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
569        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
570    }
571
572    let local_var_req = local_var_req_builder.build()?;
573    let local_var_resp = local_var_client.execute(local_var_req).await?;
574
575    let local_var_status = local_var_resp.status();
576    let local_var_content = local_var_resp.text().await?;
577
578    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
579        serde_json::from_str(&local_var_content).map_err(Error::from)
580    } else {
581        let local_var_entity: Option<ActivitySlashListOrgEventsForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
582        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
583        Err(Error::ResponseError(local_var_error))
584    }
585}
586
587/// We delay the public events feed by five minutes, which means the most recent event returned by the public events API actually occurred at least five minutes ago.
588pub async fn activity_slash_list_public_events(configuration: &configuration::Configuration, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListPublicEventsError>> {
589    let local_var_configuration = configuration;
590
591    let local_var_client = &local_var_configuration.client;
592
593    let local_var_uri_str = format!("{}/events", local_var_configuration.base_path);
594    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
595
596    if let Some(ref local_var_str) = per_page {
597        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
598    }
599    if let Some(ref local_var_str) = page {
600        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
601    }
602    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
603        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
604    }
605
606    let local_var_req = local_var_req_builder.build()?;
607    let local_var_resp = local_var_client.execute(local_var_req).await?;
608
609    let local_var_status = local_var_resp.status();
610    let local_var_content = local_var_resp.text().await?;
611
612    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
613        serde_json::from_str(&local_var_content).map_err(Error::from)
614    } else {
615        let local_var_entity: Option<ActivitySlashListPublicEventsError> = serde_json::from_str(&local_var_content).ok();
616        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
617        Err(Error::ResponseError(local_var_error))
618    }
619}
620
621/// 
622pub async fn activity_slash_list_public_events_for_repo_network(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListPublicEventsForRepoNetworkError>> {
623    let local_var_configuration = configuration;
624
625    let local_var_client = &local_var_configuration.client;
626
627    let local_var_uri_str = format!("{}/networks/{owner}/{repo}/events", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
628    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
629
630    if let Some(ref local_var_str) = per_page {
631        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
632    }
633    if let Some(ref local_var_str) = page {
634        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
635    }
636    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
637        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
638    }
639
640    let local_var_req = local_var_req_builder.build()?;
641    let local_var_resp = local_var_client.execute(local_var_req).await?;
642
643    let local_var_status = local_var_resp.status();
644    let local_var_content = local_var_resp.text().await?;
645
646    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
647        serde_json::from_str(&local_var_content).map_err(Error::from)
648    } else {
649        let local_var_entity: Option<ActivitySlashListPublicEventsForRepoNetworkError> = serde_json::from_str(&local_var_content).ok();
650        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
651        Err(Error::ResponseError(local_var_error))
652    }
653}
654
655/// 
656pub async fn activity_slash_list_public_events_for_user(configuration: &configuration::Configuration, username: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListPublicEventsForUserError>> {
657    let local_var_configuration = configuration;
658
659    let local_var_client = &local_var_configuration.client;
660
661    let local_var_uri_str = format!("{}/users/{username}/events/public", local_var_configuration.base_path, username=crate::apis::urlencode(username));
662    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
663
664    if let Some(ref local_var_str) = per_page {
665        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
666    }
667    if let Some(ref local_var_str) = page {
668        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
669    }
670    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
671        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
672    }
673
674    let local_var_req = local_var_req_builder.build()?;
675    let local_var_resp = local_var_client.execute(local_var_req).await?;
676
677    let local_var_status = local_var_resp.status();
678    let local_var_content = local_var_resp.text().await?;
679
680    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
681        serde_json::from_str(&local_var_content).map_err(Error::from)
682    } else {
683        let local_var_entity: Option<ActivitySlashListPublicEventsForUserError> = serde_json::from_str(&local_var_content).ok();
684        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
685        Err(Error::ResponseError(local_var_error))
686    }
687}
688
689/// 
690pub async fn activity_slash_list_public_org_events(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListPublicOrgEventsError>> {
691    let local_var_configuration = configuration;
692
693    let local_var_client = &local_var_configuration.client;
694
695    let local_var_uri_str = format!("{}/orgs/{org}/events", local_var_configuration.base_path, org=crate::apis::urlencode(org));
696    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
697
698    if let Some(ref local_var_str) = per_page {
699        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
700    }
701    if let Some(ref local_var_str) = page {
702        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
703    }
704    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
705        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
706    }
707
708    let local_var_req = local_var_req_builder.build()?;
709    let local_var_resp = local_var_client.execute(local_var_req).await?;
710
711    let local_var_status = local_var_resp.status();
712    let local_var_content = local_var_resp.text().await?;
713
714    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
715        serde_json::from_str(&local_var_content).map_err(Error::from)
716    } else {
717        let local_var_entity: Option<ActivitySlashListPublicOrgEventsError> = serde_json::from_str(&local_var_content).ok();
718        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
719        Err(Error::ResponseError(local_var_error))
720    }
721}
722
723/// These are events that you've received by watching repositories and following users. If you are authenticated as the given user, you will see private events. Otherwise, you'll only see public events.
724pub async fn activity_slash_list_received_events_for_user(configuration: &configuration::Configuration, username: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListReceivedEventsForUserError>> {
725    let local_var_configuration = configuration;
726
727    let local_var_client = &local_var_configuration.client;
728
729    let local_var_uri_str = format!("{}/users/{username}/received_events", local_var_configuration.base_path, username=crate::apis::urlencode(username));
730    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
731
732    if let Some(ref local_var_str) = per_page {
733        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
734    }
735    if let Some(ref local_var_str) = page {
736        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
737    }
738    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
739        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
740    }
741
742    let local_var_req = local_var_req_builder.build()?;
743    let local_var_resp = local_var_client.execute(local_var_req).await?;
744
745    let local_var_status = local_var_resp.status();
746    let local_var_content = local_var_resp.text().await?;
747
748    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
749        serde_json::from_str(&local_var_content).map_err(Error::from)
750    } else {
751        let local_var_entity: Option<ActivitySlashListReceivedEventsForUserError> = serde_json::from_str(&local_var_content).ok();
752        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
753        Err(Error::ResponseError(local_var_error))
754    }
755}
756
757/// 
758pub async fn activity_slash_list_received_public_events_for_user(configuration: &configuration::Configuration, username: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListReceivedPublicEventsForUserError>> {
759    let local_var_configuration = configuration;
760
761    let local_var_client = &local_var_configuration.client;
762
763    let local_var_uri_str = format!("{}/users/{username}/received_events/public", local_var_configuration.base_path, username=crate::apis::urlencode(username));
764    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
765
766    if let Some(ref local_var_str) = per_page {
767        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
768    }
769    if let Some(ref local_var_str) = page {
770        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
771    }
772    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
773        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
774    }
775
776    let local_var_req = local_var_req_builder.build()?;
777    let local_var_resp = local_var_client.execute(local_var_req).await?;
778
779    let local_var_status = local_var_resp.status();
780    let local_var_content = local_var_resp.text().await?;
781
782    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
783        serde_json::from_str(&local_var_content).map_err(Error::from)
784    } else {
785        let local_var_entity: Option<ActivitySlashListReceivedPublicEventsForUserError> = serde_json::from_str(&local_var_content).ok();
786        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
787        Err(Error::ResponseError(local_var_error))
788    }
789}
790
791/// **Note**: This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. 
792pub async fn activity_slash_list_repo_events(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Event>, Error<ActivitySlashListRepoEventsError>> {
793    let local_var_configuration = configuration;
794
795    let local_var_client = &local_var_configuration.client;
796
797    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/events", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
798    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
799
800    if let Some(ref local_var_str) = per_page {
801        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
802    }
803    if let Some(ref local_var_str) = page {
804        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
805    }
806    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
807        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
808    }
809
810    let local_var_req = local_var_req_builder.build()?;
811    let local_var_resp = local_var_client.execute(local_var_req).await?;
812
813    let local_var_status = local_var_resp.status();
814    let local_var_content = local_var_resp.text().await?;
815
816    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
817        serde_json::from_str(&local_var_content).map_err(Error::from)
818    } else {
819        let local_var_entity: Option<ActivitySlashListRepoEventsError> = serde_json::from_str(&local_var_content).ok();
820        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
821        Err(Error::ResponseError(local_var_error))
822    }
823}
824
825/// Lists all notifications for the current user in the specified repository.
826pub async fn activity_slash_list_repo_notifications_for_authenticated_user(configuration: &configuration::Configuration, owner: &str, repo: &str, all: Option<bool>, participating: Option<bool>, since: Option<String>, before: Option<String>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Thread>, Error<ActivitySlashListRepoNotificationsForAuthenticatedUserError>> {
827    let local_var_configuration = configuration;
828
829    let local_var_client = &local_var_configuration.client;
830
831    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/notifications", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
832    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
833
834    if let Some(ref local_var_str) = all {
835        local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]);
836    }
837    if let Some(ref local_var_str) = participating {
838        local_var_req_builder = local_var_req_builder.query(&[("participating", &local_var_str.to_string())]);
839    }
840    if let Some(ref local_var_str) = since {
841        local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]);
842    }
843    if let Some(ref local_var_str) = before {
844        local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]);
845    }
846    if let Some(ref local_var_str) = per_page {
847        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
848    }
849    if let Some(ref local_var_str) = page {
850        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
851    }
852    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
853        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
854    }
855
856    let local_var_req = local_var_req_builder.build()?;
857    let local_var_resp = local_var_client.execute(local_var_req).await?;
858
859    let local_var_status = local_var_resp.status();
860    let local_var_content = local_var_resp.text().await?;
861
862    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
863        serde_json::from_str(&local_var_content).map_err(Error::from)
864    } else {
865        let local_var_entity: Option<ActivitySlashListRepoNotificationsForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
866        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
867        Err(Error::ResponseError(local_var_error))
868    }
869}
870
871/// Lists repositories the authenticated user has starred.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
872pub async fn activity_slash_list_repos_starred_by_authenticated_user(configuration: &configuration::Configuration, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::Repository>, Error<ActivitySlashListReposStarredByAuthenticatedUserError>> {
873    let local_var_configuration = configuration;
874
875    let local_var_client = &local_var_configuration.client;
876
877    let local_var_uri_str = format!("{}/user/starred", local_var_configuration.base_path);
878    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
879
880    if let Some(ref local_var_str) = sort {
881        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
882    }
883    if let Some(ref local_var_str) = direction {
884        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
885    }
886    if let Some(ref local_var_str) = per_page {
887        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
888    }
889    if let Some(ref local_var_str) = page {
890        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
891    }
892    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
893        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
894    }
895
896    let local_var_req = local_var_req_builder.build()?;
897    let local_var_resp = local_var_client.execute(local_var_req).await?;
898
899    let local_var_status = local_var_resp.status();
900    let local_var_content = local_var_resp.text().await?;
901
902    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
903        serde_json::from_str(&local_var_content).map_err(Error::from)
904    } else {
905        let local_var_entity: Option<ActivitySlashListReposStarredByAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
906        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
907        Err(Error::ResponseError(local_var_error))
908    }
909}
910
911/// Lists repositories a user has starred.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
912pub async fn activity_slash_list_repos_starred_by_user(configuration: &configuration::Configuration, username: &str, sort: Option<&str>, direction: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActivityListReposStarredByUser200Response, Error<ActivitySlashListReposStarredByUserError>> {
913    let local_var_configuration = configuration;
914
915    let local_var_client = &local_var_configuration.client;
916
917    let local_var_uri_str = format!("{}/users/{username}/starred", local_var_configuration.base_path, username=crate::apis::urlencode(username));
918    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
919
920    if let Some(ref local_var_str) = sort {
921        local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
922    }
923    if let Some(ref local_var_str) = direction {
924        local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
925    }
926    if let Some(ref local_var_str) = per_page {
927        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
928    }
929    if let Some(ref local_var_str) = page {
930        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
931    }
932    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
933        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
934    }
935
936    let local_var_req = local_var_req_builder.build()?;
937    let local_var_resp = local_var_client.execute(local_var_req).await?;
938
939    let local_var_status = local_var_resp.status();
940    let local_var_content = local_var_resp.text().await?;
941
942    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
943        serde_json::from_str(&local_var_content).map_err(Error::from)
944    } else {
945        let local_var_entity: Option<ActivitySlashListReposStarredByUserError> = serde_json::from_str(&local_var_content).ok();
946        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
947        Err(Error::ResponseError(local_var_error))
948    }
949}
950
951/// Lists repositories a user is watching.
952pub async fn activity_slash_list_repos_watched_by_user(configuration: &configuration::Configuration, username: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<ActivitySlashListReposWatchedByUserError>> {
953    let local_var_configuration = configuration;
954
955    let local_var_client = &local_var_configuration.client;
956
957    let local_var_uri_str = format!("{}/users/{username}/subscriptions", local_var_configuration.base_path, username=crate::apis::urlencode(username));
958    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
959
960    if let Some(ref local_var_str) = per_page {
961        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
962    }
963    if let Some(ref local_var_str) = page {
964        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
965    }
966    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
967        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
968    }
969
970    let local_var_req = local_var_req_builder.build()?;
971    let local_var_resp = local_var_client.execute(local_var_req).await?;
972
973    let local_var_status = local_var_resp.status();
974    let local_var_content = local_var_resp.text().await?;
975
976    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
977        serde_json::from_str(&local_var_content).map_err(Error::from)
978    } else {
979        let local_var_entity: Option<ActivitySlashListReposWatchedByUserError> = serde_json::from_str(&local_var_content).ok();
980        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
981        Err(Error::ResponseError(local_var_error))
982    }
983}
984
985/// Lists the people that have starred the repository.  This endpoint supports the following custom media types. For more information, see \"[Media types](https://docs.github.com/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types).\"  - **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created.
986pub async fn activity_slash_list_stargazers_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActivityListStargazersForRepo200Response, Error<ActivitySlashListStargazersForRepoError>> {
987    let local_var_configuration = configuration;
988
989    let local_var_client = &local_var_configuration.client;
990
991    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stargazers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
992    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
993
994    if let Some(ref local_var_str) = per_page {
995        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
996    }
997    if let Some(ref local_var_str) = page {
998        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
999    }
1000    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1001        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1002    }
1003
1004    let local_var_req = local_var_req_builder.build()?;
1005    let local_var_resp = local_var_client.execute(local_var_req).await?;
1006
1007    let local_var_status = local_var_resp.status();
1008    let local_var_content = local_var_resp.text().await?;
1009
1010    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1011        serde_json::from_str(&local_var_content).map_err(Error::from)
1012    } else {
1013        let local_var_entity: Option<ActivitySlashListStargazersForRepoError> = serde_json::from_str(&local_var_content).ok();
1014        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1015        Err(Error::ResponseError(local_var_error))
1016    }
1017}
1018
1019/// Lists repositories the authenticated user is watching.
1020pub async fn activity_slash_list_watched_repos_for_authenticated_user(configuration: &configuration::Configuration, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::MinimalRepository>, Error<ActivitySlashListWatchedReposForAuthenticatedUserError>> {
1021    let local_var_configuration = configuration;
1022
1023    let local_var_client = &local_var_configuration.client;
1024
1025    let local_var_uri_str = format!("{}/user/subscriptions", local_var_configuration.base_path);
1026    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1027
1028    if let Some(ref local_var_str) = per_page {
1029        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1030    }
1031    if let Some(ref local_var_str) = page {
1032        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1033    }
1034    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1035        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1036    }
1037
1038    let local_var_req = local_var_req_builder.build()?;
1039    let local_var_resp = local_var_client.execute(local_var_req).await?;
1040
1041    let local_var_status = local_var_resp.status();
1042    let local_var_content = local_var_resp.text().await?;
1043
1044    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1045        serde_json::from_str(&local_var_content).map_err(Error::from)
1046    } else {
1047        let local_var_entity: Option<ActivitySlashListWatchedReposForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1048        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1049        Err(Error::ResponseError(local_var_error))
1050    }
1051}
1052
1053/// Lists the people watching the specified repository.
1054pub async fn activity_slash_list_watchers_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<Vec<models::SimpleUser>, Error<ActivitySlashListWatchersForRepoError>> {
1055    let local_var_configuration = configuration;
1056
1057    let local_var_client = &local_var_configuration.client;
1058
1059    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscribers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1060    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1061
1062    if let Some(ref local_var_str) = per_page {
1063        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
1064    }
1065    if let Some(ref local_var_str) = page {
1066        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1067    }
1068    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1069        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1070    }
1071
1072    let local_var_req = local_var_req_builder.build()?;
1073    let local_var_resp = local_var_client.execute(local_var_req).await?;
1074
1075    let local_var_status = local_var_resp.status();
1076    let local_var_content = local_var_resp.text().await?;
1077
1078    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1079        serde_json::from_str(&local_var_content).map_err(Error::from)
1080    } else {
1081        let local_var_entity: Option<ActivitySlashListWatchersForRepoError> = serde_json::from_str(&local_var_content).ok();
1082        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1083        Err(Error::ResponseError(local_var_error))
1084    }
1085}
1086
1087/// Marks all notifications as \"read\" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as \"read.\" To check whether any \"unread\" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.
1088pub async fn activity_slash_mark_notifications_as_read(configuration: &configuration::Configuration, activity_mark_notifications_as_read_request: Option<models::ActivityMarkNotificationsAsReadRequest>) -> Result<models::ActivityMarkNotificationsAsRead202Response, Error<ActivitySlashMarkNotificationsAsReadError>> {
1089    let local_var_configuration = configuration;
1090
1091    let local_var_client = &local_var_configuration.client;
1092
1093    let local_var_uri_str = format!("{}/notifications", local_var_configuration.base_path);
1094    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1095
1096    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1097        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1098    }
1099    local_var_req_builder = local_var_req_builder.json(&activity_mark_notifications_as_read_request);
1100
1101    let local_var_req = local_var_req_builder.build()?;
1102    let local_var_resp = local_var_client.execute(local_var_req).await?;
1103
1104    let local_var_status = local_var_resp.status();
1105    let local_var_content = local_var_resp.text().await?;
1106
1107    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1108        serde_json::from_str(&local_var_content).map_err(Error::from)
1109    } else {
1110        let local_var_entity: Option<ActivitySlashMarkNotificationsAsReadError> = serde_json::from_str(&local_var_content).ok();
1111        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1112        Err(Error::ResponseError(local_var_error))
1113    }
1114}
1115
1116/// Marks all notifications in a repository as \"read\" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub will run an asynchronous process to mark notifications as \"read.\" To check whether any \"unread\" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`.
1117pub async fn activity_slash_mark_repo_notifications_as_read(configuration: &configuration::Configuration, owner: &str, repo: &str, activity_mark_repo_notifications_as_read_request: Option<models::ActivityMarkRepoNotificationsAsReadRequest>) -> Result<models::ActivityMarkRepoNotificationsAsRead202Response, Error<ActivitySlashMarkRepoNotificationsAsReadError>> {
1118    let local_var_configuration = configuration;
1119
1120    let local_var_client = &local_var_configuration.client;
1121
1122    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/notifications", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1123    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1124
1125    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1126        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1127    }
1128    local_var_req_builder = local_var_req_builder.json(&activity_mark_repo_notifications_as_read_request);
1129
1130    let local_var_req = local_var_req_builder.build()?;
1131    let local_var_resp = local_var_client.execute(local_var_req).await?;
1132
1133    let local_var_status = local_var_resp.status();
1134    let local_var_content = local_var_resp.text().await?;
1135
1136    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1137        serde_json::from_str(&local_var_content).map_err(Error::from)
1138    } else {
1139        let local_var_entity: Option<ActivitySlashMarkRepoNotificationsAsReadError> = serde_json::from_str(&local_var_content).ok();
1140        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1141        Err(Error::ResponseError(local_var_error))
1142    }
1143}
1144
1145/// Marks a thread as \"done.\" Marking a thread as \"done\" is equivalent to marking a notification in your notification inbox on GitHub as done: https://github.com/notifications.
1146pub async fn activity_slash_mark_thread_as_done(configuration: &configuration::Configuration, thread_id: i32) -> Result<(), Error<ActivitySlashMarkThreadAsDoneError>> {
1147    let local_var_configuration = configuration;
1148
1149    let local_var_client = &local_var_configuration.client;
1150
1151    let local_var_uri_str = format!("{}/notifications/threads/{thread_id}", local_var_configuration.base_path, thread_id=thread_id);
1152    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1153
1154    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1155        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1156    }
1157
1158    let local_var_req = local_var_req_builder.build()?;
1159    let local_var_resp = local_var_client.execute(local_var_req).await?;
1160
1161    let local_var_status = local_var_resp.status();
1162    let local_var_content = local_var_resp.text().await?;
1163
1164    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1165        Ok(())
1166    } else {
1167        let local_var_entity: Option<ActivitySlashMarkThreadAsDoneError> = serde_json::from_str(&local_var_content).ok();
1168        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1169        Err(Error::ResponseError(local_var_error))
1170    }
1171}
1172
1173/// Marks a thread as \"read.\" Marking a thread as \"read\" is equivalent to clicking a notification in your notification inbox on GitHub: https://github.com/notifications.
1174pub async fn activity_slash_mark_thread_as_read(configuration: &configuration::Configuration, thread_id: i32) -> Result<(), Error<ActivitySlashMarkThreadAsReadError>> {
1175    let local_var_configuration = configuration;
1176
1177    let local_var_client = &local_var_configuration.client;
1178
1179    let local_var_uri_str = format!("{}/notifications/threads/{thread_id}", local_var_configuration.base_path, thread_id=thread_id);
1180    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1181
1182    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1183        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1184    }
1185
1186    let local_var_req = local_var_req_builder.build()?;
1187    let local_var_resp = local_var_client.execute(local_var_req).await?;
1188
1189    let local_var_status = local_var_resp.status();
1190    let local_var_content = local_var_resp.text().await?;
1191
1192    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1193        Ok(())
1194    } else {
1195        let local_var_entity: Option<ActivitySlashMarkThreadAsReadError> = serde_json::from_str(&local_var_content).ok();
1196        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1197        Err(Error::ResponseError(local_var_error))
1198    }
1199}
1200
1201/// If you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/rest/activity/watching#delete-a-repository-subscription) completely.
1202pub async fn activity_slash_set_repo_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, activity_set_repo_subscription_request: Option<models::ActivitySetRepoSubscriptionRequest>) -> Result<models::RepositorySubscription, Error<ActivitySlashSetRepoSubscriptionError>> {
1203    let local_var_configuration = configuration;
1204
1205    let local_var_client = &local_var_configuration.client;
1206
1207    let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscription", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1208    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1209
1210    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1211        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1212    }
1213    local_var_req_builder = local_var_req_builder.json(&activity_set_repo_subscription_request);
1214
1215    let local_var_req = local_var_req_builder.build()?;
1216    let local_var_resp = local_var_client.execute(local_var_req).await?;
1217
1218    let local_var_status = local_var_resp.status();
1219    let local_var_content = local_var_resp.text().await?;
1220
1221    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1222        serde_json::from_str(&local_var_content).map_err(Error::from)
1223    } else {
1224        let local_var_entity: Option<ActivitySlashSetRepoSubscriptionError> = serde_json::from_str(&local_var_content).ok();
1225        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1226        Err(Error::ResponseError(local_var_error))
1227    }
1228}
1229
1230/// If you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.  You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.  Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/rest/activity/notifications#delete-a-thread-subscription) endpoint.
1231pub async fn activity_slash_set_thread_subscription(configuration: &configuration::Configuration, thread_id: i32, activity_set_thread_subscription_request: Option<models::ActivitySetThreadSubscriptionRequest>) -> Result<models::ThreadSubscription, Error<ActivitySlashSetThreadSubscriptionError>> {
1232    let local_var_configuration = configuration;
1233
1234    let local_var_client = &local_var_configuration.client;
1235
1236    let local_var_uri_str = format!("{}/notifications/threads/{thread_id}/subscription", local_var_configuration.base_path, thread_id=thread_id);
1237    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1238
1239    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1240        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1241    }
1242    local_var_req_builder = local_var_req_builder.json(&activity_set_thread_subscription_request);
1243
1244    let local_var_req = local_var_req_builder.build()?;
1245    let local_var_resp = local_var_client.execute(local_var_req).await?;
1246
1247    let local_var_status = local_var_resp.status();
1248    let local_var_content = local_var_resp.text().await?;
1249
1250    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1251        serde_json::from_str(&local_var_content).map_err(Error::from)
1252    } else {
1253        let local_var_entity: Option<ActivitySlashSetThreadSubscriptionError> = serde_json::from_str(&local_var_content).ok();
1254        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1255        Err(Error::ResponseError(local_var_error))
1256    }
1257}
1258
1259/// Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see \"[HTTP method](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#http-method).\"
1260pub async fn activity_slash_star_repo_for_authenticated_user(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ActivitySlashStarRepoForAuthenticatedUserError>> {
1261    let local_var_configuration = configuration;
1262
1263    let local_var_client = &local_var_configuration.client;
1264
1265    let local_var_uri_str = format!("{}/user/starred/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1266    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1267
1268    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1269        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1270    }
1271
1272    let local_var_req = local_var_req_builder.build()?;
1273    let local_var_resp = local_var_client.execute(local_var_req).await?;
1274
1275    let local_var_status = local_var_resp.status();
1276    let local_var_content = local_var_resp.text().await?;
1277
1278    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1279        Ok(())
1280    } else {
1281        let local_var_entity: Option<ActivitySlashStarRepoForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1282        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1283        Err(Error::ResponseError(local_var_error))
1284    }
1285}
1286
1287/// Unstar a repository that the authenticated user has previously starred.
1288pub async fn activity_slash_unstar_repo_for_authenticated_user(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error<ActivitySlashUnstarRepoForAuthenticatedUserError>> {
1289    let local_var_configuration = configuration;
1290
1291    let local_var_client = &local_var_configuration.client;
1292
1293    let local_var_uri_str = format!("{}/user/starred/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
1294    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1295
1296    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1297        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1298    }
1299
1300    let local_var_req = local_var_req_builder.build()?;
1301    let local_var_resp = local_var_client.execute(local_var_req).await?;
1302
1303    let local_var_status = local_var_resp.status();
1304    let local_var_content = local_var_resp.text().await?;
1305
1306    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1307        Ok(())
1308    } else {
1309        let local_var_entity: Option<ActivitySlashUnstarRepoForAuthenticatedUserError> = serde_json::from_str(&local_var_content).ok();
1310        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1311        Err(Error::ResponseError(local_var_error))
1312    }
1313}
1314