Expand description
This documentation was generated from directory crate version 1.0.13+20200204, where 20200204 is the exact revision of the admin:directory_v1 schema built by the mako code generator v1.0.13.
Everything else about the directory v1_directory API can be found at the official documentation site. The original source code is on github.
§Features
Handle the following Resources with ease from the central hub …
- asps
- delete, get and list
- channels
- stop
- chromeosdevices
- action, get, list, move devices to ou, patch and update
- customers
- get, patch and update
- domain aliases
- delete, get, insert and list
- domains
- delete, get, insert and list
- groups
- aliases delete, aliases insert, aliases list, delete, get, insert, list, patch and update
- members
- delete, get, has member, insert, list, patch and update
- mobiledevices
- action, delete, get and list
- notifications
- delete, get, list, patch and update
- orgunits
- delete, get, insert, list, patch and update
- privileges
- list
- resources
- buildings delete, buildings get, buildings insert, buildings list, buildings patch, buildings update, calendars delete, calendars get, calendars insert, calendars list, calendars patch, calendars update, features delete, features get, features insert, features list, features patch, features rename and features update
- role assignments
- delete, get, insert and list
- roles
- delete, get, insert, list, patch and update
- schemas
- delete, get, insert, list, patch and update
- tokens
- delete, get and list
- users
- aliases delete, aliases insert, aliases list, aliases watch, delete, get, insert, list, make admin, patch, photos delete, photos get, photos patch, photos update, undelete, update and watch
- verification codes
- generate, invalidate and list
Subscription supported by …
Not what you are looking for ? Find all other Google APIs in their Rust documentation index.
§Structure of this Library
The API is structured into the following primary items:
- Hub
- a central object to maintain state and allow accessing all Activities
- creates Method Builders which in turn allow access to individual Call Builders
- Resources
- primary types that you can apply Activities to
- a collection of properties and Parts
- Parts
- a collection of properties
- never directly used in Activities
- Activities
- operations to apply to Resources
All structures are marked with applicable traits to further categorize them and ease browsing.
Generally speaking, you can invoke Activities like this:
let r = hub.resource().activity(...).doit()
Or specifically …
let r = hub.users().photos_patch(...).doit()
let r = hub.users().aliases_delete(...).doit()
let r = hub.users().undelete(...).doit()
let r = hub.users().photos_get(...).doit()
let r = hub.users().update(...).doit()
let r = hub.users().aliases_watch(...).doit()
let r = hub.users().insert(...).doit()
let r = hub.users().photos_delete(...).doit()
let r = hub.users().patch(...).doit()
let r = hub.users().photos_update(...).doit()
let r = hub.users().watch(...).doit()
let r = hub.users().get(...).doit()
let r = hub.users().aliases_insert(...).doit()
let r = hub.users().make_admin(...).doit()
let r = hub.users().aliases_list(...).doit()
let r = hub.users().list(...).doit()
let r = hub.users().delete(...).doit()
The resource()
and activity(...)
calls create builders. The second one dealing with Activities
supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
specified right away (i.e. (...)
), whereas all optional ones can be build up as desired.
The doit()
method performs the actual communication with the server and returns the respective result.
§Usage
§Setting up your Project
To use this library, you would put the following lines into your Cargo.toml
file:
[dependencies]
google-admin1_directory = "*"
# This project intentionally uses an old version of Hyper. See
# https://github.com/Byron/google-apis-rs/issues/173 for more
# information.
hyper = "^0.10"
hyper-rustls = "^0.6"
serde = "^1.0"
serde_json = "^1.0"
yup-oauth2 = "^1.0"
§A complete example
extern crate hyper;
extern crate hyper_rustls;
extern crate yup_oauth2 as oauth2;
extern crate google_admin1_directory as admin1_directory;
use admin1_directory::Channel;
use admin1_directory::{Result, Error};
use std::default::Default;
use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
use admin1_directory::Directory;
// Get an ApplicationSecret instance by some means. It contains the `client_id` and
// `client_secret`, among other things.
let secret: ApplicationSecret = Default::default();
// Instantiate the authenticator. It will choose a suitable authentication flow for you,
// unless you replace `None` with the desired Flow.
// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
// retrieve them from storage.
let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())),
<MemoryStorage as Default>::default(), None);
let mut hub = Directory::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);
// As the method needs a request, you would usually fill it with the desired information
// into the respective structure. Some of the parts shown here might not be applicable !
// Values shown here are possibly random and not representative !
let mut req = Channel::default();
// You can configure optional parameters by calling the respective setters at will, and
// execute the final call using `doit()`.
// Values shown here are possibly random and not representative !
let result = hub.users().watch(req)
.view_type("labore")
.sort_order("sea")
.show_deleted("nonumy")
.query("dolores")
.projection("gubergren")
.page_token("sadipscing")
.order_by("aliquyam")
.max_results(-66)
.event("no")
.domain("justo")
.customer("justo")
.custom_field_mask("et")
.doit();
match result {
Err(e) => match e {
// The Error enum provides details about what exactly happened.
// You can also just use its `Debug`, `Display` or `Error` traits
Error::HttpError(_)
|Error::MissingAPIKey
|Error::MissingToken(_)
|Error::Cancelled
|Error::UploadSizeLimitExceeded(_, _)
|Error::Failure(_)
|Error::BadRequest(_)
|Error::FieldClash(_)
|Error::JsonDecodeError(_, _) => println!("{}", e),
},
Ok(res) => println!("Success: {:?}", res),
}
§Handling Errors
All errors produced by the system are provided either as Result enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the Hub Delegate, or the Authenticator Delegate.
When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors.
§Uploads and Downloads
If a method supports downloads, the response body, which is part of the Result, should be
read by you to obtain the media.
If such a method also supports a Response Result, it will return that by default.
You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
this call: .param("alt", "media")
.
Methods supporting uploads can do so using up to 2 different protocols:
simple and resumable. The distinctiveness of each is represented by customized
doit(...)
methods, which are then named upload(...)
and upload_resumable(...)
respectively.
§Customization and Callbacks
You may alter the way an doit()
method is called by providing a delegate to the
Method Builder before making the final doit()
call.
Respective methods will be called to provide progress information, as well as determine whether the system should
retry on failure.
The delegate trait is default-implemented, allowing you to customize it with minimal effort.
§Optional Parts in Server-Requests
All structures provided by this library are made to be enocodable and decodable via json. Optionals are used to indicate that partial requests are responses are valid. Most optionals are are considered Parts which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response.
§Builder Arguments
Using method builders, you are able to prepare an action call by repeatedly calling it’s methods. These will always take a single argument, for which the following statements are true.
- PODs are handed by copy
- strings are passed as
&str
- request values are moved
Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
Structs§
- Alias
- JSON template for Alias object in Directory API.
- Aliases
- JSON response template to list aliases in Directory API.
- Asp
- The template that returns individual ASP (Access Code) data.
- AspDelete
Call - Delete an ASP issued by a user.
- AspGet
Call - Get information about an ASP issued by a user.
- AspList
Call - List the ASPs issued by a user.
- AspMethods
- A builder providing access to all methods supported on asp resources.
It is not used directly, but through the
Directory
hub. - Asps
- There is no detailed description.
- Building
- JSON template for Building object in Directory API.
- Building
Address - JSON template for the postal address of a building in Directory API.
- Building
Coordinates - JSON template for coordinates of a building in Directory API.
- Buildings
- JSON template for Building List Response object in Directory API.
- Calendar
Resource - JSON template for Calendar Resource object in Directory API.
- Calendar
Resources - JSON template for Calendar Resource List Response object in Directory API.
- Channel
- An notification channel used to watch for resource changes.
- Channel
Methods - A builder providing access to all methods supported on channel resources.
It is not used directly, but through the
Directory
hub. - Channel
Stop Call - Stop watching resources through this channel
- Chrome
OsDevice - JSON template for Chrome Os Device resource in Directory API.
- Chrome
OsDevice Action - JSON request template for firing actions on ChromeOs Device in Directory Devices API.
- Chrome
OsDevice Active Time Ranges - List of active time ranges (Read-only)
- Chrome
OsDevice CpuStatus Reports - Reports of CPU utilization and temperature (Read-only)
- Chrome
OsDevice CpuStatus Reports CpuTemperature Info - List of CPU temperature samples.
- Chrome
OsDevice Device Files - List of device files to download (Read-only)
- Chrome
OsDevice Disk Volume Reports - Reports of disk space and other info about mounted/connected volumes.
- Chrome
OsDevice Disk Volume Reports Volume Info - Disk volumes
- Chrome
OsDevice Recent Users - List of recent device users, in descending order by last login time (Read-only)
- Chrome
OsDevice System RamFree Reports - Reports of amounts of available RAM memory (Read-only)
- Chrome
OsDevice TpmVersion Info - Trusted Platform Module (TPM) (Read-only)
- Chrome
OsDevices - JSON response template for List Chrome OS Devices operation in Directory API.
- Chrome
OsMove Devices ToOu - JSON request template for moving ChromeOs Device to given OU in Directory Devices API.
- Chromeosdevice
Action Call - Take action on Chrome OS Device
- Chromeosdevice
GetCall - Retrieve Chrome OS Device
- Chromeosdevice
List Call - Retrieve all Chrome OS Devices of a customer (paginated)
- Chromeosdevice
Methods - A builder providing access to all methods supported on chromeosdevice resources.
It is not used directly, but through the
Directory
hub. - Chromeosdevice
Move Devices ToOu Call - Move or insert multiple Chrome OS Devices to organizational unit
- Chromeosdevice
Patch Call - Update Chrome OS Device. This method supports patch semantics.
- Chromeosdevice
Update Call - Update Chrome OS Device
- Chunk
- Content
Range - Implements the Content-Range header, for serialization only
- Customer
- JSON template for Customer Resource object in Directory API.
- Customer
GetCall - Retrieves a customer.
- Customer
Methods - A builder providing access to all methods supported on customer resources.
It is not used directly, but through the
Directory
hub. - Customer
Patch Call - Updates a customer. This method supports patch semantics.
- Customer
Postal Address - JSON template for postal address of a customer.
- Customer
Update Call - Updates a customer.
- Default
Delegate - A delegate with a conservative default implementation, which is used if no other delegate is set.
- Directory
- Central instance to access all Directory related resource activities
- Domain
Alias - JSON template for Domain Alias object in Directory API.
- Domain
Aliase Delete Call - Deletes a Domain Alias of the customer.
- Domain
Aliase GetCall - Retrieves a domain alias of the customer.
- Domain
Aliase Insert Call - Inserts a Domain alias of the customer.
- Domain
Aliase List Call - Lists the domain aliases of the customer.
- Domain
Aliase Methods - A builder providing access to all methods supported on domainAliase resources.
It is not used directly, but through the
Directory
hub. - Domain
Aliases - JSON response template to list domain aliases in Directory API.
- Domain
Delete Call - Deletes a domain of the customer.
- Domain
GetCall - Retrieves a domain of the customer.
- Domain
Insert Call - Inserts a domain of the customer.
- Domain
List Call - Lists the domains of the customer.
- Domain
Methods - A builder providing access to all methods supported on domain resources.
It is not used directly, but through the
Directory
hub. - Domains
- JSON template for Domain object in Directory API.
- Domains2
- JSON response template to list Domains in Directory API.
- Dummy
Network Stream - Error
Response - A utility to represent detailed errors we might see in case there are BadRequests. The latter happen if the sent parameters or request structures are unsound
- Feature
- JSON template for Feature object in Directory API.
- Feature
Rename - JSON request template for renaming a feature.
- Features
- JSON template for Feature List Response object in Directory API.
- Group
- JSON template for Group resource in Directory API.
- Group
Aliase Delete Call - Remove a alias for the group
- Group
Aliase Insert Call - Add a alias for the group
- Group
Aliase List Call - List all aliases for a group
- Group
Delete Call - Delete Group
- Group
GetCall - Retrieve Group
- Group
Insert Call - Create Group
- Group
List Call - Retrieve all groups of a domain or of a user given a userKey (paginated)
- Group
Methods - A builder providing access to all methods supported on group resources.
It is not used directly, but through the
Directory
hub. - Group
Patch Call - Update Group. This method supports patch semantics.
- Group
Update Call - Update Group
- Groups
- JSON response template for List Groups operation in Directory API.
- Json
Server Error - A utility type which can decode a server response that indicates error
- Member
- JSON template for Member resource in Directory API.
- Member
Delete Call - Remove membership.
- Member
GetCall - Retrieve Group Member
- Member
HasMember Call - Checks whether the given user is a member of the group. Membership can be direct or nested.
- Member
Insert Call - Add user to the specified group.
- Member
List Call - Retrieve all members in a group (paginated)
- Member
Methods - A builder providing access to all methods supported on member resources.
It is not used directly, but through the
Directory
hub. - Member
Patch Call - Update membership of a user in the specified group. This method supports patch semantics.
- Member
Update Call - Update membership of a user in the specified group.
- Members
- JSON response template for List Members operation in Directory API.
- Members
HasMember - JSON template for Has Member response in Directory API.
- Method
Info - Contains information about an API request.
- Mobile
Device - JSON template for Mobile Device resource in Directory API.
- Mobile
Device Action - JSON request template for firing commands on Mobile Device in Directory Devices API.
- Mobile
Device Applications - List of applications installed on Mobile Device
- Mobile
Devices - JSON response template for List Mobile Devices operation in Directory API.
- Mobiledevice
Action Call - Take action on Mobile Device
- Mobiledevice
Delete Call - Delete Mobile Device
- Mobiledevice
GetCall - Retrieve Mobile Device
- Mobiledevice
List Call - Retrieve all Mobile Devices of a customer (paginated)
- Mobiledevice
Methods - A builder providing access to all methods supported on mobiledevice resources.
It is not used directly, but through the
Directory
hub. - Multi
Part Reader - Provides a
Read
interface that converts multiple parts into the protocol identified by RFC2387. Note: This implementation is just as rich as it needs to be to perform uploads to google APIs, and might not be a fully-featured implementation. - Notification
- Template for a notification resource.
- Notification
Delete Call - Deletes a notification
- Notification
GetCall - Retrieves a notification.
- Notification
List Call - Retrieves a list of notifications.
- Notification
Methods - A builder providing access to all methods supported on notification resources.
It is not used directly, but through the
Directory
hub. - Notification
Patch Call - Updates a notification. This method supports patch semantics.
- Notification
Update Call - Updates a notification.
- Notifications
- Template for notifications list response.
- OrgUnit
- JSON template for Org Unit resource in Directory API.
- OrgUnits
- JSON response template for List Organization Units operation in Directory API.
- Orgunit
Delete Call - Remove organizational unit
- Orgunit
GetCall - Retrieve organizational unit
- Orgunit
Insert Call - Add organizational unit
- Orgunit
List Call - Retrieve all organizational units
- Orgunit
Methods - A builder providing access to all methods supported on orgunit resources.
It is not used directly, but through the
Directory
hub. - Orgunit
Patch Call - Update organizational unit. This method supports patch semantics.
- Orgunit
Update Call - Update organizational unit
- Privilege
- JSON template for privilege resource in Directory API.
- Privilege
List Call - Retrieves a paginated list of all privileges for a customer.
- Privilege
Methods - A builder providing access to all methods supported on privilege resources.
It is not used directly, but through the
Directory
hub. - Privileges
- JSON response template for List privileges operation in Directory API.
- Range
Response Header - Resource
Building Delete Call - Deletes a building.
- Resource
Building GetCall - Retrieves a building.
- Resource
Building Insert Call - Inserts a building.
- Resource
Building List Call - Retrieves a list of buildings for an account.
- Resource
Building Patch Call - Updates a building. This method supports patch semantics.
- Resource
Building Update Call - Updates a building.
- Resource
Calendar Delete Call - Deletes a calendar resource.
- Resource
Calendar GetCall - Retrieves a calendar resource.
- Resource
Calendar Insert Call - Inserts a calendar resource.
- Resource
Calendar List Call - Retrieves a list of calendar resources for an account.
- Resource
Calendar Patch Call - Updates a calendar resource.
- Resource
Calendar Update Call - Updates a calendar resource.
- Resource
Feature Delete Call - Deletes a feature.
- Resource
Feature GetCall - Retrieves a feature.
- Resource
Feature Insert Call - Inserts a feature.
- Resource
Feature List Call - Retrieves a list of features for an account.
- Resource
Feature Patch Call - Updates a feature. This method supports patch semantics.
- Resource
Feature Rename Call - Renames a feature.
- Resource
Feature Update Call - Updates a feature.
- Resource
Methods - A builder providing access to all methods supported on resource resources.
It is not used directly, but through the
Directory
hub. - Resumable
Upload Helper - A utility type to perform a resumable upload from start to end.
- Role
- JSON template for role resource in Directory API.
- Role
Assignment - JSON template for roleAssignment resource in Directory API.
- Role
Assignment Delete Call - Deletes a role assignment.
- Role
Assignment GetCall - Retrieve a role assignment.
- Role
Assignment Insert Call - Creates a role assignment.
- Role
Assignment List Call - Retrieves a paginated list of all roleAssignments.
- Role
Assignment Methods - A builder providing access to all methods supported on roleAssignment resources.
It is not used directly, but through the
Directory
hub. - Role
Assignments - JSON response template for List roleAssignments operation in Directory API.
- Role
Delete Call - Deletes a role.
- Role
GetCall - Retrieves a role.
- Role
Insert Call - Creates a role.
- Role
List Call - Retrieves a paginated list of all the roles in a domain.
- Role
Methods - A builder providing access to all methods supported on role resources.
It is not used directly, but through the
Directory
hub. - Role
Patch Call - Updates a role. This method supports patch semantics.
- Role
Role Privileges - The set of privileges that are granted to this role.
- Role
Update Call - Updates a role.
- Roles
- JSON response template for List roles operation in Directory API.
- Schema
- JSON template for Schema resource in Directory API.
- Schema
Delete Call - Delete schema
- Schema
Field Spec - JSON template for FieldSpec resource for Schemas in Directory API.
- Schema
Field Spec Numeric Indexing Spec - Indexing spec for a numeric field. By default, only exact match queries will be supported for numeric fields. Setting the numericIndexingSpec allows range queries to be supported.
- Schema
GetCall - Retrieve schema
- Schema
Insert Call - Create schema.
- Schema
List Call - Retrieve all schemas for a customer
- Schema
Methods - A builder providing access to all methods supported on schema resources.
It is not used directly, but through the
Directory
hub. - Schema
Patch Call - Update schema. This method supports patch semantics.
- Schema
Update Call - Update schema
- Schemas
- JSON response template for List Schema operation in Directory API.
- Server
Error - Server
Message - Token
- JSON template for token resource in Directory API.
- Token
Delete Call - Delete all access tokens issued by a user for an application.
- Token
GetCall - Get information about an access token issued by a user.
- Token
List Call - Returns the set of tokens specified user has issued to 3rd party applications.
- Token
Methods - A builder providing access to all methods supported on token resources.
It is not used directly, but through the
Directory
hub. - Tokens
- JSON response template for List tokens operation in Directory API.
- User
- JSON template for User object in Directory API.
- User
Aliase Delete Call - Remove a alias for the user
- User
Aliase Insert Call - Add a alias for the user
- User
Aliase List Call - List all aliases for a user
- User
Aliase Watch Call - Watch for changes in user aliases list
- User
Custom Properties - JSON template for a set of custom properties (i.e. all fields in a particular schema)
- User
Delete Call - Delete user
- User
GetCall - retrieve user
- User
Insert Call - create user.
- User
List Call - Retrieve either deleted users or all users in a domain (paginated)
- User
Make Admin - JSON request template for setting/revoking admin status of a user in Directory API.
- User
Make Admin Call - change admin status of a user
- User
Methods - A builder providing access to all methods supported on user resources.
It is not used directly, but through the
Directory
hub. - User
Name - JSON template for name of a user in Directory API.
- User
Patch Call - update user. This method supports patch semantics.
- User
Photo - JSON template for Photo object in Directory API.
- User
Photo Delete Call - Remove photos for the user
- User
Photo GetCall - Retrieve photo of a user
- User
Photo Patch Call - Add a photo for the user. This method supports patch semantics.
- User
Photo Update Call - Add a photo for the user
- User
Undelete - JSON request template to undelete a user in Directory API.
- User
Undelete Call - Undelete a deleted user
- User
Update Call - update user
- User
Watch Call - Watch for changes in users list
- Users
- JSON response template for List Users operation in Apps Directory API.
- Verification
Code - JSON template for verification codes in Directory API.
- Verification
Code Generate Call - Generate new backup verification codes for the user.
- Verification
Code Invalidate Call - Invalidate the current backup verification codes for the user.
- Verification
Code List Call - Returns the current set of valid backup verification codes for the specified user.
- Verification
Code Methods - A builder providing access to all methods supported on verificationCode resources.
It is not used directly, but through the
Directory
hub. - Verification
Codes - JSON response template for List verification codes operation in Directory API.
- XUpload
Content Type - The
X-Upload-Content-Type
header.
Enums§
- Error
- Scope
- Identifies the an OAuth2 authorization scope. A scope is needed when requesting an authorization token.
Traits§
- Call
Builder - Identifies types which represent builders for a particular resource method
- Delegate
- A trait specifying functionality to help controlling any request performed by the API. The trait has a conservative default implementation.
- Hub
- Identifies the Hub. There is only one per library, this trait is supposed to make intended use more explicit. The hub allows to access all resource methods more easily.
- Methods
Builder - Identifies types for building methods of a particular resource type
- Nested
Type - Identifies types which are only used by other types internally. They have no special meaning, this trait just marks them for completeness.
- Part
- Identifies types which are only used as part of other types, which
usually are carrying the
Resource
trait. - Read
Seek - A utility to specify reader types which provide seeking capabilities too
- Request
Value - Identifies types which are used in API requests.
- Resource
- Identifies types which can be inserted and deleted. Types with this trait are most commonly used by clients of this API.
- Response
Result - Identifies types which are used in API responses.
- ToParts
- A trait for all types that can convert themselves into a parts string
- Unused
Type - Identifies types which are not actually used by the API This might be a bug within the google API schema.
Functions§
Type Aliases§
- Result
- A universal result type used as return for all calls.