Struct smartsheet_rs::SmartsheetApi
source · [−]pub struct SmartsheetApi<'a> { /* private fields */ }Expand description
Client implementation for making requests to the Smartsheet API v2
Links
Implementations
sourceimpl<'a> SmartsheetApi<'a>
impl<'a> SmartsheetApi<'a>
sourcepub fn from_token(token: &str) -> Self
pub fn from_token(token: &str) -> Self
Initialize a new SmartsheetApi object from an API access token.
sourcepub fn from_env() -> Result<Self, Box<dyn Error + Send + Sync>>
pub fn from_env() -> Result<Self, Box<dyn Error + Send + Sync>>
Initialize a new SmartsheetApi object from an API access token,
assuming this is currently set in the environment.
sourcepub fn from_endpoint_and_token(endpoint: &'a str, token: &str) -> Self
pub fn from_endpoint_and_token(endpoint: &'a str, token: &str) -> Self
Initialize a new SmartsheetApi object from a (custom) base API
endpoint, and an access token.
sourcepub async fn list_sheets(
&self
) -> Result<IndexResult<Sheet>, Box<dyn Error + Send + Sync>>
pub async fn list_sheets(
&self
) -> Result<IndexResult<Sheet>, Box<dyn Error + Send + Sync>>
List Sheets - Gets a list of all sheets that the user has access to in alphabetical order by name. The list contains an abbreviated Sheet object for each sheet.
Docs
- https://smartsheet-platform.github.io/api-docs/#list-sheets
sourcepub async fn list_sheets_with_params(
&self,
include: Option<Vec<ListSheetIncludeFlags>>,
include_all: Option<bool>,
modified_since: Option<&'a str>
) -> Result<IndexResult<Sheet>, Box<dyn Error + Send + Sync>>
pub async fn list_sheets_with_params(
&self,
include: Option<Vec<ListSheetIncludeFlags>>,
include_all: Option<bool>,
modified_since: Option<&'a str>
) -> Result<IndexResult<Sheet>, Box<dyn Error + Send + Sync>>
List Sheets - Gets a list of all sheets that the user has access to in alphabetical order by name, with included query parameters. The list contains an abbreviated Sheet object for each sheet.
Arguments
include- A comma-separated list of elements to include in the response.include_all- If true, include all results (i.e. do not paginate).modified_since- Return sheets modified since a provided datetime. Date should be in ISO-8601 format, for example,2020-01-30T13:25:32-07:00.
Docs
- https://smartsheet-platform.github.io/api-docs/#list-sheets
sourcepub async fn get_sheet(
&self,
sheet_id: u64
) -> Result<Sheet, Box<dyn Error + Send + Sync>>
pub async fn get_sheet(
&self,
sheet_id: u64
) -> Result<Sheet, Box<dyn Error + Send + Sync>>
Get Sheet - Retrieves the specified sheet. Returns the sheet, including rows, and optionally populated with discussion and attachment objects.
Arguments
sheet_id- The Smartsheet to retrieve the rows and data for.
Docs
- https://smartsheet-platform.github.io/api-docs/#get-sheet
- https://smartsheet-platform.github.io/api-docs/#row-include-flags
sourcepub async fn get_sheet_with_params(
&self,
sheet_id: u64,
include: Option<Vec<SheetIncludeFlags>>,
exclude: Option<Vec<SheetExcludeFlags>>,
row_ids: Option<Vec<u64>>,
row_numbers: Option<Vec<u64>>,
column_ids: Option<Vec<u64>>,
rows_modified_since: Option<&'a str>
) -> Result<Sheet, Box<dyn Error + Send + Sync>>
pub async fn get_sheet_with_params(
&self,
sheet_id: u64,
include: Option<Vec<SheetIncludeFlags>>,
exclude: Option<Vec<SheetExcludeFlags>>,
row_ids: Option<Vec<u64>>,
row_numbers: Option<Vec<u64>>,
column_ids: Option<Vec<u64>>,
rows_modified_since: Option<&'a str>
) -> Result<Sheet, Box<dyn Error + Send + Sync>>
Get Sheet - Retrieves the specified sheet, with included query parameters. Returns the sheet, including rows, and optionally populated with discussion and attachment objects.
Arguments
sheet_id- The Smartsheet to retrieve the rows and data for.include- A comma-separated list of elements to include in the response.exclude- A comma-separated list of elements to not include in the response.row_ids- A comma-separated list of Row IDs on which to filter the rows included in the result.row_numbers- A comma-separated list of Row numbers on which to filter the rows included in the result. Non-existent row numbers are ignored.column_ids- A comma-separated comma-separated list of Column IDs. The response will contain only the specified columns in the ‘columns’ array, and individual rows’ ‘cells’ array will only contain cells in the specified columns.rows_modified_since- Return rows modified since a provided datetime. Date should be in ISO-8601 format, for example,2020-01-30T13:25:32-07:00.
Docs
- https://smartsheet-platform.github.io/api-docs/#get-sheet
- https://smartsheet-platform.github.io/api-docs/#row-include-flags
sourcepub async fn get_row(
&self,
sheet_id: u64,
row_id: u64
) -> Result<Row, Box<dyn Error + Send + Sync>>
pub async fn get_row(
&self,
sheet_id: u64,
row_id: u64
) -> Result<Row, Box<dyn Error + Send + Sync>>
sourcepub async fn get_row_with_column_data(
&self,
sheet_id: u64,
row_id: u64
) -> Result<Row, Box<dyn Error + Send + Sync>>
pub async fn get_row_with_column_data(
&self,
sheet_id: u64,
row_id: u64
) -> Result<Row, Box<dyn Error + Send + Sync>>
sourcepub async fn get_row_with_params(
&self,
sheet_id: u64,
row_id: u64,
include: Option<Vec<RowIncludeFlags>>,
exclude: Option<Vec<RowExcludeFlags>>,
level: Option<Level>
) -> Result<Row, Box<dyn Error + Send + Sync>>
pub async fn get_row_with_params(
&self,
sheet_id: u64,
row_id: u64,
include: Option<Vec<RowIncludeFlags>>,
exclude: Option<Vec<RowExcludeFlags>>,
level: Option<Level>
) -> Result<Row, Box<dyn Error + Send + Sync>>
Get Row - Retrieves the specified row from a sheet, with included query parameters.
Arguments
sheet_id- The Smartsheet to retrieve the rows from.row_id- The specified row to retrieve.include- A comma-separated list of elements to include in the response.exclude- A comma-separated list of elements to not include in the response.level- Specifies whether multi-contact data is returned in a backwards-compatible, text format, or as multi-contact data.
Docs
- https://smartsheet-platform.github.io/api-docs/#get-row
- https://smartsheet-platform.github.io/api-docs/#row-include-flags
sourcepub async fn list_columns(
&self,
sheet_id: u64
) -> Result<IndexResult<Column>, Box<dyn Error + Send + Sync>>
pub async fn list_columns(
&self,
sheet_id: u64
) -> Result<IndexResult<Column>, Box<dyn Error + Send + Sync>>
List Columns - Gets a list of all columns belonging to the specified sheet.
Docs
- https://smartsheet-platform.github.io/api-docs/#list-columns
sourcepub async fn list_columns_with_params(
&self,
sheet_id: u64,
level: Option<Level>,
include: Option<Vec<ColumnIncludeFlags>>,
include_all: Option<bool>
) -> Result<IndexResult<Column>, Box<dyn Error + Send + Sync>>
pub async fn list_columns_with_params(
&self,
sheet_id: u64,
level: Option<Level>,
include: Option<Vec<ColumnIncludeFlags>>,
include_all: Option<bool>
) -> Result<IndexResult<Column>, Box<dyn Error + Send + Sync>>
List Columns - Gets a list of all columns belonging to the specified sheet, with included query parameters.
Arguments
sheet_id- The Smartsheet to retrieve the columns from.level- Specifies whether multi-contact data is returned in a backwards-compatible, text format, or as multi-contact data.include- A comma-separated list of elements to include in the response.include_all- If true, include all results (i.e. do not paginate).
Docs
- https://smartsheet-platform.github.io/api-docs/#list-columns
sourcepub async fn get_column(
&self,
sheet_id: u64,
column_id: u64
) -> Result<Column, Box<dyn Error + Send + Sync>>
pub async fn get_column(
&self,
sheet_id: u64,
column_id: u64
) -> Result<Column, Box<dyn Error + Send + Sync>>
sourcepub async fn get_column_with_params(
&self,
sheet_id: u64,
column_id: u64,
level: Option<Level>,
include: Option<Vec<ColumnIncludeFlags>>
) -> Result<Column, Box<dyn Error + Send + Sync>>
pub async fn get_column_with_params(
&self,
sheet_id: u64,
column_id: u64,
level: Option<Level>,
include: Option<Vec<ColumnIncludeFlags>>
) -> Result<Column, Box<dyn Error + Send + Sync>>
Get Column - Retrieves a column by id from the specified sheet, with included query parameters.
Arguments
sheet_id- The Smartsheet to retrieve the column for.column_id- The Column Id to retrieve the data for.level- Specifies whether multi-contact data is returned in a backwards-compatible, text format, or as multi-contact data.include- A comma-separated list of elements to include in the response.
Docs
- https://smartsheet-platform.github.io/api-docs/#get-column
sourcepub async fn get_sheet_by_name(
&self,
sheet_name: &'a str
) -> Result<Sheet, Box<dyn Error + Send + Sync>>
👎 Deprecated since 0.2.0: please cache the sheet id and use get_sheet instead
pub async fn get_sheet_by_name(
&self,
sheet_name: &'a str
) -> Result<Sheet, Box<dyn Error + Send + Sync>>
please cache the sheet id and use get_sheet instead
Get Sheet By Name - Convenience function to retrieve a specified sheet by name. Used for those times when you don’t know the Sheet Id.
This will internally call list_sheets and then filter the response
data by the sheet name. It returns the first matching name.
Returns the sheet, including rows, and optionally populated with discussion and attachment objects.
Arguments
sheet_name- The name of the Smartsheet to filter results by.
sourcepub async fn get_column_by_title(
&self,
sheet_id: u64,
column_title: &'a str
) -> Result<Column, Box<dyn Error + Send + Sync>>
👎 Deprecated since 0.2.0: please cache the column id and use get_column instead
pub async fn get_column_by_title(
&self,
sheet_id: u64,
column_title: &'a str
) -> Result<Column, Box<dyn Error + Send + Sync>>
please cache the column id and use get_column instead
Get Column By Title - Convenience function to retrieve a specified column by title (name). Used for those times when you don’t know the Column Id.
This will internally call list_columns and then filter the response
data by the column title. It returns the first matching name.
Arguments
sheet_id- The Smartsheet to retrieve the column from.column_title- The name of the column to filter results by.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for SmartsheetApi<'a>
impl<'a> Send for SmartsheetApi<'a>
impl<'a> Sync for SmartsheetApi<'a>
impl<'a> Unpin for SmartsheetApi<'a>
impl<'a> !UnwindSafe for SmartsheetApi<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
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