Struct airtable_api::Airtable
source · [−]pub struct Airtable { /* private fields */ }
Expand description
Entrypoint for interacting with the Airtable API.
Implementations
sourceimpl Airtable
impl Airtable
sourcepub fn new<K, B, E>(key: K, base_id: B, enterprise_account_id: E) -> Self where
K: ToString,
B: ToString,
E: ToString,
pub fn new<K, B, E>(key: K, base_id: B, enterprise_account_id: E) -> Self where
K: ToString,
B: ToString,
E: ToString,
Create a new Airtable client struct. It takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API Key and Base ID your requests will work.
You can leave the Enterprise Account ID empty if you are not using the
Enterprise API features.
sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Create a new Airtable client struct from environment variables. It
takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API Key and Base ID your requests will work.
sourcepub async fn list_records<T: DeserializeOwned>(
&self,
table: &str,
view: &str,
fields: Vec<&str>
) -> Result<Vec<Record<T>>>
pub async fn list_records<T: DeserializeOwned>(
&self,
table: &str,
view: &str,
fields: Vec<&str>
) -> Result<Vec<Record<T>>>
List records in a table for a particular view.
sourcepub async fn get_record<T: DeserializeOwned>(
&self,
table: &str,
record_id: &str
) -> Result<Record<T>>
pub async fn get_record<T: DeserializeOwned>(
&self,
table: &str,
record_id: &str
) -> Result<Record<T>>
Get record from a table.
sourcepub async fn delete_record(&self, table: &str, record_id: &str) -> Result<()>
pub async fn delete_record(&self, table: &str, record_id: &str) -> Result<()>
Delete record from a table.
sourcepub async fn create_records<T: Serialize + DeserializeOwned>(
&self,
table: &str,
records: Vec<Record<T>>
) -> Result<Vec<Record<T>>>
pub async fn create_records<T: Serialize + DeserializeOwned>(
&self,
table: &str,
records: Vec<Record<T>>
) -> Result<Vec<Record<T>>>
Bulk create records in a table.
Due to limitations on the Airtable API, you can only bulk create 10 records at a time.
sourcepub async fn update_records<T: Serialize + DeserializeOwned>(
&self,
table: &str,
records: Vec<Record<T>>
) -> Result<Vec<Record<T>>>
pub async fn update_records<T: Serialize + DeserializeOwned>(
&self,
table: &str,
records: Vec<Record<T>>
) -> Result<Vec<Record<T>>>
Bulk update records in a table.
Due to limitations on the Airtable API, you can only bulk update 10 records at a time.
sourcepub async fn list_users(&self) -> Result<Vec<User>>
pub async fn list_users(&self) -> Result<Vec<User>>
List users. This is for an enterprise admin to do only. FROM: https://airtable.com/api/enterprise
sourcepub async fn get_enterprise_user(&self, email: &str) -> Result<EnterpriseUser>
pub async fn get_enterprise_user(&self, email: &str) -> Result<EnterpriseUser>
Get an enterprise user. This is for an enterprise admin to do only. FROM: https://airtable.com/api/enterprise#enterpriseAccountUserGetInformationByEmail Permission level can be: owner | create | edit | comment | read
sourcepub async fn add_collaborator_to_workspace(
&self,
workspace_id: &str,
user_id: &str,
permission_level: &str
) -> Result<()>
pub async fn add_collaborator_to_workspace(
&self,
workspace_id: &str,
user_id: &str,
permission_level: &str
) -> Result<()>
Add a collaborator to a workspace. This is for an enterprise admin to do only. FROM: https://airtable.com/api/enterprise#enterpriseWorkspaceAddCollaborator Permission level can be: owner | create | edit | comment | read
sourcepub async fn get_enterprise_workspace<const N: usize>(
&self,
workspace_id: &str,
includes: Option<[WorkspaceIncludes; N]>
) -> Result<Workspace>
pub async fn get_enterprise_workspace<const N: usize>(
&self,
workspace_id: &str,
includes: Option<[WorkspaceIncludes; N]>
) -> Result<Workspace>
Returns basic information on the workspace. Does not include deleted collaborators and only include outstanding invites. FROM: https://airtable.com/api/enterprise#enterpriseWorkspaceGetInformation
sourcepub async fn delete_internal_user_by_email(&self, email: &str) -> Result<()>
pub async fn delete_internal_user_by_email(&self, email: &str) -> Result<()>
Delete internal user by email. This is for an enterprise admin to do only. The user must be an internal user, meaning they have an email with the company domain. FROM: https://airtable.com/api/enterprise#enterpriseAccountUserDeleteUserByEmail
Auto Trait Implementations
impl !RefUnwindSafe for Airtable
impl Send for Airtable
impl Sync for Airtable
impl Unpin for Airtable
impl !UnwindSafe for Airtable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more