apify_client/clients/
actor_env_var.rs1use crate::clients::base::{delete_resource, get_resource, update_resource, ResourceContext};
4use crate::common::QueryParams;
5use crate::error::ApifyClientResult;
6use crate::http_client::HttpClient;
7use crate::models::ActorEnvVar;
8
9#[derive(Debug, Clone)]
11pub struct ActorEnvVarClient {
12 ctx: ResourceContext,
13}
14
15impl ActorEnvVarClient {
16 pub(crate) fn new(http: HttpClient, base_url: &str, name: &str) -> Self {
17 Self {
18 ctx: ResourceContext::single(http, base_url, "env-vars", name),
19 }
20 }
21
22 pub async fn get(&self) -> ApifyClientResult<Option<ActorEnvVar>> {
24 get_resource(&self.ctx, None, &QueryParams::new()).await
25 }
26
27 pub async fn update(&self, env_var: &ActorEnvVar) -> ApifyClientResult<ActorEnvVar> {
29 update_resource(&self.ctx, None, env_var).await
30 }
31
32 pub async fn delete(&self) -> ApifyClientResult<()> {
34 delete_resource(&self.ctx, None).await
35 }
36}