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
53
54
55
56
57
58
59
60
61
62
63
/*
* TIDAL API - Beta
*
* TIDAL API is a [JSON:API](https://jsonapi.org/) Web API that gives access to TIDAL functionality and data.
*
* The version of the OpenAPI document: 0.1.76
*
* Generated by: https://openapi-generator.tech
*/
use super::{Error, client};
use crate::models::*;
use reqwest;
impl client::TidalClient {
/// Retrieves multiple artistRoles by available filters, or without if applicable.
///
/// # Parameters
/// * `filter_id` - Allows to filter the collection of resources based on id attribute value (e.g. "1")
pub async fn artist_role_list(
&self,
filter_id: Option<Vec<String>>,
) -> Result<MultiResource<artist_role::ArtistRole>, Error> {
// add a prefix to parameters to efficiently prevent name collisions
let p_filter_id = filter_id;
let uri_str = format!("{}/artistRoles", self.base_path_api);
let mut req_builder = self.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_filter_id {
req_builder = req_builder.query(
¶m_value
.iter()
.map(|p| ("filter[id]".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
);
}
self.execute_request(req_builder).await
}
/// Retrieves single artistRole by id.
///
/// # Parameters
/// * `id` - Artist role id (e.g. "1")
pub async fn artist_role_get(
&self,
id: &str,
) -> Result<Resource<artist_role::ArtistRole>, Error> {
// add a prefix to parameters to efficiently prevent name collisions
let p_id = id;
let uri_str = format!(
"{}/artistRoles/{id}",
self.base_path_api,
id = crate::apis::urlencode(p_id)
);
let req_builder = self.client.request(reqwest::Method::GET, &uri_str);
self.execute_request(req_builder).await
}
}