Struct Customers

Source
pub struct Customers {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

Source§

impl Customers

Source

pub async fn get( &self, customer_key: &str, ) -> Result<Response<Customer>, ClientError>

This function performs a GET to the /admin/directory/v1/customers/{customerKey} endpoint.

Retrieves a customer.

Parameters:

  • customer_key: &str – Id of the customer to be retrieved.
Source

pub async fn update( &self, customer_key: &str, body: &Customer, ) -> Result<Response<Customer>, ClientError>

This function performs a PUT to the /admin/directory/v1/customers/{customerKey} endpoint.

Updates a customer.

Parameters:

  • customer_key: &str – Id of the customer to be updated.
Source

pub async fn patch( &self, customer_key: &str, body: &Customer, ) -> Result<Response<Customer>, ClientError>

This function performs a PATCH to the /admin/directory/v1/customers/{customerKey} endpoint.

Patches a customer.

Parameters:

  • customer_key: &str – Id of the customer to be updated.
Source

pub async fn admin_chrome_printers_get( &self, name: &str, ) -> Result<Response<Printer>, ClientError>

This function performs a GET to the /admin/directory/v1/{name} endpoint.

Returns a Printer resource (printer’s config).

Parameters:

  • name: &str – Required. The name of the printer to retrieve. Format: customers/{customer_id}/chrome/printers/{printer_id}.
Source

pub async fn admin_chrome_printers_delete( &self, name: &str, ) -> Result<Response<Empty>, ClientError>

This function performs a DELETE to the /admin/directory/v1/{name} endpoint.

Deletes a Printer.

Parameters:

  • name: &str – Required. The name of the printer to be updated. Format: customers/{customer_id}/chrome/printers/{printer_id}.
Source

pub async fn admin_chrome_printers_patch( &self, name: &str, clear_mask: &str, update_mask: &str, body: &Printer, ) -> Result<Response<Printer>, ClientError>

This function performs a PATCH to the /admin/directory/v1/{name} endpoint.

Updates a Printer resource.

Parameters:

  • name: &str – The resource name of the Printer object, in the format customers/{customer-id}/printers/{printer-id} (During printer creation leave empty).
  • clear_mask: &str – The list of fields to be cleared. Note, some of the fields are read only and cannot be updated. Values for not specified fields will be patched.
  • update_mask: &str – The list of fields to be updated. Note, some of the fields are read only and cannot be updated. Values for not specified fields will be patched.
Source

pub async fn admin_chrome_printers_list( &self, parent: &str, filter: &str, org_unit_id: &str, page_size: i64, page_token: &str, ) -> Result<Response<Vec<Printer>>, ClientError>

This function performs a GET to the /admin/directory/v1/{parent}/chrome/printers endpoint.

List printers configs.

Parameters:

  • parent: &str – Required. The name of the customer who owns this collection of printers. Format: customers/{customer_id}.
  • filter: &str – Search query. Search syntax is shared between this api and Admin Console printers pages.
  • org_unit_id: &str – Organization Unit that we want to list the printers for. When org_unit is not present in the request then all printers of the customer are returned (or filtered). When org_unit is present in the request then only printers available to this OU will be returned (owned or inherited). You may see if printer is owned or inherited for this OU by looking at Printer.org_unit_id.
  • page_size: i64 – The maximum number of objects to return. The service may return fewer than this value.
  • page_token: &str – A page token, received from a previous call.
Source

pub async fn admin_chrome_printers_list_all( &self, parent: &str, filter: &str, org_unit_id: &str, ) -> Result<Response<Vec<Printer>>, ClientError>

This function performs a GET to the /admin/directory/v1/{parent}/chrome/printers endpoint.

As opposed to admin_chrome_printers_list, this function returns all the pages of the request at once.

List printers configs.

Source

pub async fn admin_chrome_printers_create( &self, parent: &str, body: &Printer, ) -> Result<Response<Printer>, ClientError>

This function performs a POST to the /admin/directory/v1/{parent}/chrome/printers endpoint.

Creates a printer under given Organization Unit.

Parameters:

  • parent: &str – Required. The name of the customer. Format: customers/{customer_id}.
Source

pub async fn admin_chrome_printers_batch_create( &self, parent: &str, body: &BatchCreatePrintersRequest, ) -> Result<Response<BatchCreatePrintersResponse>, ClientError>

This function performs a POST to the /admin/directory/v1/{parent}/chrome/printers:batchCreatePrinters endpoint.

Creates printers under given Organization Unit.

Parameters:

  • parent: &str – Required. The name of the customer. Format: customers/{customer_id}.
Source

pub async fn admin_chrome_printers_batch_delete( &self, parent: &str, body: &BatchDeletePrintersRequest, ) -> Result<Response<BatchDeletePrintersResponse>, ClientError>

This function performs a POST to the /admin/directory/v1/{parent}/chrome/printers:batchDeletePrinters endpoint.

Deletes printers in batch.

Parameters:

  • parent: &str – Required. The name of the customer. Format: customers/{customer_id}.
Source

pub async fn admin_chrome_printers_list_printer_models( &self, parent: &str, filter: &str, page_size: i64, page_token: &str, ) -> Result<Response<Vec<PrinterModel>>, ClientError>

This function performs a GET to the /admin/directory/v1/{parent}/chrome/printers:listPrinterModels endpoint.

Lists the supported printer models.

Parameters:

  • parent: &str – Required. The name of the customer who owns this collection of printers. Format: customers/{customer_id}.
  • filter: &str – Filer to list only models by a given manufacturer in format: “manufacturer:Brother”. Search syntax is shared between this api and Admin Console printers pages.
  • page_size: i64 – The maximum number of objects to return. The service may return fewer than this value.
  • page_token: &str – A page token, received from a previous call.
Source

pub async fn admin_chrome_printers_list_all_printer_models( &self, parent: &str, filter: &str, ) -> Result<Response<Vec<PrinterModel>>, ClientError>

This function performs a GET to the /admin/directory/v1/{parent}/chrome/printers:listPrinterModels endpoint.

As opposed to admin_chrome_printers_list_printer_models, this function returns all the pages of the request at once.

Lists the supported printer models.

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> ErasedDestructor for T
where T: 'static,