Skip to main content

SheetsApi

Struct SheetsApi 

Source
pub struct SheetsApi<'a> { /* private fields */ }
Expand description

Sheets API façade.

Implementations§

Source§

impl<'a> SheetsApi<'a>

Source

pub fn new(client: &'a SheetsClient) -> Self

Wraps an existing SheetsClient.

Source

pub async fn get_spreadsheet(&self, spreadsheet_id: &str) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata — its title and the list of sheets.

Always fields-masked; see [SPREADSHEET_FIELDS].

Source

pub async fn get_spreadsheet_with_protections( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including protected ranges — the one read the protection verbs need that no other caller does. See [SPREADSHEET_FIELDS_WITH_PROTECTIONS].

Source

pub async fn get_spreadsheet_with_filter_views( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including the basic filter and filter views — the one read filter.rs’s verbs need that no other caller does. See [SPREADSHEET_FIELDS_WITH_FILTER_VIEWS].

Source

pub async fn get_spreadsheet_with_conditional_formats( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including conditional format rules — shared by all four conditional_format.rs verbs (issue #1793), mirroring Self::get_spreadsheet_with_protections’s reuse across all four protection verbs. add-conditional-format doesn’t strictly need the existing list, but reusing this one fetch instead of adding a second, narrower one keeps Sheet.conditional_formats consistently populated whenever any conditional-format verb runs. See [SPREADSHEET_FIELDS_WITH_CONDITIONAL_FORMATS].

Source

pub async fn get_spreadsheet_with_named_ranges( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including named ranges — the one read the named-range verbs need that no other caller does. See [SPREADSHEET_FIELDS_WITH_NAMED_RANGES].

Source

pub async fn get_spreadsheet_with_embedded_objects( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including charts and slicers — shared by all eight embedded_object.rs verbs (issue #1797), the same way Self::get_spreadsheet_with_conditional_formats is shared by its four. See [SPREADSHEET_FIELDS_WITH_EMBEDDED_OBJECTS].

Source

pub async fn get_spreadsheet_with_pivot_tables( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including every populated cell’s pivotTable property — list-pivot-tables’ one fetch (issue #1798). See [SPREADSHEET_FIELDS_WITH_PIVOT_TABLES].

Source

pub async fn get_spreadsheet_with_banding( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including banded ranges — shared by all four banding.rs verbs (issue #1832), mirroring Self::get_spreadsheet_with_filter_views’s reuse across its own four verbs. See [SPREADSHEET_FIELDS_WITH_BANDING].

Source

pub async fn get_spreadsheet_with_dimension_groups( &self, spreadsheet_id: &str, ) -> Result<Spreadsheet>

Fetches a spreadsheet’s metadata including dimension groups — shared by all four dimension_group.rs verbs (issue #1833), mirroring Self::get_spreadsheet_with_banding’s reuse across its own four verbs. See [SPREADSHEET_FIELDS_WITH_DIMENSION_GROUPS].

Source

pub async fn get_cell_pivot( &self, spreadsheet_id: &str, composed_a1: &str, ) -> Result<Spreadsheet>

Fetches a single cell’s pivotTable property and displayed value — add-pivot-table’s occupied-anchor check and delete-pivot-table’s “currently:” preview (issue #1798). composed_a1 must be a single-cell A1 reference carrying its own Sheet! prefix; the response’s sheets list still carries every sheet’s properties (the mask’s own sheets.properties(...) clause), but sheets.data is scoped to composed_a1 by the ranges query parameter. See [CELL_PIVOT_FIELDS].

Source

pub async fn get_cell_formats( &self, spreadsheet_id: &str, composed_a1: &str, ) -> Result<Spreadsheet>

Fetches a range’s cell-level formatting — read-cell-format (issue #1878). composed_a1 may be any range a1::compose can build, not just a single cell; the response’s sheets.data is scoped to it by the ranges query parameter. See [CELL_FORMAT_FIELDS].

Source

pub async fn values_get( &self, spreadsheet_id: &str, range: &str, render: ValueRenderOption, ) -> Result<ValueRange>

Fetches the cell values of a single A1 range.

Source

pub async fn values_batch_get( &self, spreadsheet_id: &str, ranges: &[String], render: ValueRenderOption, ) -> Result<BatchGetValuesResponse>

Fetches the cell values of several A1 ranges in one request.

Callers must match results on each ValueRange::range, never on the order of ranges — see that field’s docs.

Source

pub async fn search_developer_metadata( &self, spreadsheet_id: &str, filters: Vec<DataFilter>, ) -> Result<SearchDeveloperMetadataResponse>

Searches for developer-metadata entries matching filters (issue #1795, ADR-0081 §4).

Read-only, so — unlike Self::batch_update/Self::copy_to — this is plain pub, not pub(in crate::drive), and never goes through [append_write_scope_hint]: nothing here mutates. developer_metadata.rs is the one caller, and it always includes visibility: DOCUMENT_VISIBILITY in every filter it builds, so the server itself never returns a PROJECT-visibility entry to begin with.

Trait Implementations§

Source§

impl<'a> Debug for SheetsApi<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SheetsApi<'a>

§

impl<'a> !UnwindSafe for SheetsApi<'a>

§

impl<'a> Freeze for SheetsApi<'a>

§

impl<'a> Send for SheetsApi<'a>

§

impl<'a> Sync for SheetsApi<'a>

§

impl<'a> Unpin for SheetsApi<'a>

§

impl<'a> UnsafeUnpin for SheetsApi<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more