Skip to main content

unitycatalog_client/codegen/credentials/
resource.rs

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