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
// @generated by xtask/generate_services.py — do not edit by hand.
//! `companies` — typed methods for all 1 API v3 operations
//! in this module.
//!
//! Access via [`Ghl::v3`](crate::Ghl::v3)`().companies()`. These endpoints send `Version: v3`.
//!
//! Request and response types come from [`ghl_models::v3::companies`](https://docs.rs/ghl-models/latest/ghl_models/v3/companies/); every endpoint is also documented in the
//! [`companies` API reference](https://github.com/Shahroz/ghl-rs/blob/main/docs/api/companies.md).
//!
//! Enable with `features = ["companies"]`.
#![allow(clippy::too_many_arguments)]
use crate::client::Ghl;
use crate::error::Result;
use ghl_models::v3::companies as models;
/// Typed access to the `companies` API v3 surface (1 operations). Obtained via
/// [`Ghl::v3`](crate::Ghl::v3)`().companies()`.
#[derive(Debug, Clone)]
pub struct CompaniesService {
pub(crate) client: Ghl,
}
impl CompaniesService {
pub(crate) fn new(client: Ghl) -> Self {
Self { client }
}
}
impl CompaniesService {
/// Get Company
///
/// Get Comapny
///
/// `GET /companies/{companyId}`
///
/// Requires scope: `companies.readonly`.
pub async fn get_company(
&self,
company_id: &str,
) -> Result<models::GetCompanyByIdSuccessfulResponseDto> {
let path = format!("/companies/{}", crate::services::encode(company_id));
let query = Vec::new();
self.client
.send_versioned(reqwest::Method::GET, &path, &query, None::<&()>, Some("v3"))
.await
}
}