Skip to main content

unitycatalog_client/codegen/recipients/
resource.rs

1// @generated — do not edit by hand.
2#![allow(unused_imports)]
3use super::builders::*;
4use super::client::RecipientServiceClient;
5use unitycatalog_common::models::recipients::v1::*;
6/// A client scoped to a single `recipient`.
7#[derive(Clone)]
8pub struct RecipientClient {
9    pub(crate) recipient_name: String,
10    pub(crate) client: RecipientServiceClient,
11}
12impl RecipientClient {
13    /// Create a client bound to the resource's name components.
14    pub fn new(recipient_name: impl Into<String>, client: RecipientServiceClient) -> Self {
15        Self {
16            recipient_name: recipient_name.into(),
17            client,
18        }
19    }
20    /// This resource's own name (the leaf component).
21    pub fn name(&self) -> &str {
22        &self.recipient_name
23    }
24    /// The fully-qualified name of this resource.
25    pub fn full_name(&self) -> String {
26        self.recipient_name.clone()
27    }
28    /// Get a recipient by name.
29    pub fn get(&self) -> GetRecipientBuilder {
30        GetRecipientBuilder::new(self.client.clone(), &self.recipient_name)
31    }
32    /// Update a recipient.
33    pub fn update(&self) -> UpdateRecipientBuilder {
34        UpdateRecipientBuilder::new(self.client.clone(), &self.recipient_name)
35    }
36    /// Delete a recipient.
37    pub fn delete(&self) -> DeleteRecipientBuilder {
38        DeleteRecipientBuilder::new(self.client.clone(), &self.recipient_name)
39    }
40}