hugging_face_client/api/
move_repo.rs

1use serde::Serialize;
2
3use crate::RepoType;
4
5/// Request of [`crate::client::Client::move_repo`]
6#[derive(Debug, Serialize)]
7pub struct MoveRepoReq<'a> {
8  #[serde(rename = "fromRepo")]
9  from_repo: &'a str,
10
11  #[serde(rename = "toRepo")]
12  to_repo: &'a str,
13
14  #[serde(rename = "type")]
15  repo_type: RepoType,
16}
17
18impl<'a> MoveRepoReq<'a> {
19  pub fn new(from_repo: &'a str, to_repo: &'a str) -> Self {
20    MoveRepoReq {
21      from_repo,
22      to_repo,
23      repo_type: RepoType::default(),
24    }
25  }
26
27  pub fn repo_type(mut self, repo_type: RepoType) -> Self {
28    self.repo_type = repo_type;
29    self
30  }
31}