1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// @generated by xtask/generate_services.py — do not edit by hand.
//! `courses` — typed methods for all 1 API v3 operations
//! in this module.
//!
//! Access via [`Ghl::v3`](crate::Ghl::v3)`().courses()`. These endpoints send `Version: v3`.
//!
//! Request and response types come from [`ghl_models::v3::courses`](https://docs.rs/ghl-models/latest/ghl_models/v3/courses/); every endpoint is also documented in the
//! [`courses` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/courses.md).
//!
//! Enable with `features = ["courses"]`.
#![allow(clippy::too_many_arguments)]
use crate::client::Ghl;
use crate::error::Result;
use ghl_models::v3::courses as models;
/// Typed access to the `courses` API v3 surface (1 operations). Obtained via
/// [`Ghl::v3`](crate::Ghl::v3)`().courses()`.
#[derive(Debug, Clone)]
pub struct CoursesService {
pub(crate) client: Ghl,
}
impl CoursesService {
pub(crate) fn new(client: Ghl) -> Self {
Self { client }
}
}
impl CoursesService {
/// Import Courses
///
/// Import Courses through public channels
///
/// `POST /courses/courses-exporter/public/import`
pub async fn import_courses(
&self,
body: &models::PublicExporterPayload,
) -> Result<serde_json::Value> {
let query = Vec::new();
self.client
.send_versioned(
reqwest::Method::POST,
"/courses/courses-exporter/public/import",
&query,
Some(body),
Some("v3"),
)
.await
}
}