Crate google_admin1_directory[][src]

This documentation was generated from directory crate version 1.0.7+20171127, where 20171127 is the exact revision of the admin:directory_v1 schema built by the mako code generator v1.0.7.

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 ...

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 ...

This example is not tested
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 = "*"

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.

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.

AppAccessCollections

JSON template for App Access Collections Resource object in Directory API.

Asp

The template that returns individual ASP (Access Code) data.

AspDeleteCall

Delete an ASP issued by a user.

AspGetCall

Get information about an ASP issued by a user.

AspListCall

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.

CalendarResource

JSON template for Calendar Resource object in Directory API.

CalendarResources

JSON template for Calendar Resource List Response object in Directory API.

Channel

An notification channel used to watch for resource changes.

ChannelMethods

A builder providing access to all methods supported on channel resources. It is not used directly, but through the Directory hub.

ChannelStopCall

Stop watching resources through this channel

ChromeOsDevice

JSON template for Chrome Os Device resource in Directory API.

ChromeOsDeviceAction

JSON request template for firing actions on ChromeOs Device in Directory Devices API.

ChromeOsDeviceActiveTimeRanges

List of active time ranges (Read-only)

ChromeOsDeviceDeviceFiles

List of device files to download (Read-only)

ChromeOsDeviceRecentUsers

List of recent device users, in descending order by last login time (Read-only)

ChromeOsDevices

JSON response template for List Chrome OS Devices operation in Directory API.

ChromeOsMoveDevicesToOu

JSON request template for moving ChromeOs Device to given OU in Directory Devices API.

ChromeosdeviceActionCall

Take action on Chrome OS Device

ChromeosdeviceGetCall

Retrieve Chrome OS Device

ChromeosdeviceListCall

Retrieve all Chrome OS Devices of a customer (paginated)

ChromeosdeviceMethods

A builder providing access to all methods supported on chromeosdevice resources. It is not used directly, but through the Directory hub.

ChromeosdeviceMoveDevicesToOuCall

Move or insert multiple Chrome OS Devices to organizational unit

ChromeosdevicePatchCall

Update Chrome OS Device. This method supports patch semantics.

ChromeosdeviceUpdateCall

Update Chrome OS Device

Customer

JSON template for Customer Resource object in Directory API.

CustomerGetCall

Retrieves a customer.

CustomerMethods

A builder providing access to all methods supported on customer resources. It is not used directly, but through the Directory hub.

CustomerPatchCall

Updates a customer. This method supports patch semantics.

CustomerPostalAddress

JSON template for postal address of a customer.

CustomerUpdateCall

Updates a customer.

DefaultDelegate

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

DomainAlias

JSON template for Domain Alias object in Directory API.

DomainAliaseDeleteCall

Deletes a Domain Alias of the customer.

DomainAliaseGetCall

Retrieves a domain alias of the customer.

DomainAliaseInsertCall

Inserts a Domain alias of the customer.

DomainAliaseListCall

Lists the domain aliases of the customer.

DomainAliaseMethods

A builder providing access to all methods supported on domainAliase resources. It is not used directly, but through the Directory hub.

DomainAliases

JSON response template to list domain aliases in Directory API.

DomainDeleteCall

Deletes a domain of the customer.

DomainGetCall

Retrieves a domain of the customer.

DomainInsertCall

Inserts a domain of the customer.

DomainListCall

Lists the domains of the customer.

DomainMethods

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.

ErrorResponse

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

Group

JSON template for Group resource in Directory API.

GroupAliaseDeleteCall

Remove a alias for the group

GroupAliaseInsertCall

Add a alias for the group

GroupAliaseListCall

List all aliases for a group

GroupDeleteCall

Delete Group

GroupGetCall

Retrieve Group

GroupInsertCall

Create Group

GroupListCall

Retrieve all groups in a domain (paginated)

GroupMethods

A builder providing access to all methods supported on group resources. It is not used directly, but through the Directory hub.

GroupPatchCall

Update Group. This method supports patch semantics.

GroupUpdateCall

Update Group

Groups

JSON response template for List Groups operation in Directory API.

Member

JSON template for Member resource in Directory API.

MemberDeleteCall

Remove membership.

MemberGetCall

Retrieve Group Member

MemberHasMemberCall

Checks Membership of an user within a Group

MemberInsertCall

Add user to the specified group.

MemberListCall

Retrieve all members in a group (paginated)

MemberMethods

A builder providing access to all methods supported on member resources. It is not used directly, but through the Directory hub.

MemberPatchCall

Update membership of a user in the specified group. This method supports patch semantics.

MemberUpdateCall

Update membership of a user in the specified group.

Members

JSON response template for List Members operation in Directory API.

MembersHasMember

JSON template for Has Member response in Directory API.

MethodInfo

Contains information about an API request.

MobileDevice

JSON template for Mobile Device resource in Directory API.

MobileDeviceAction

JSON request template for firing commands on Mobile Device in Directory Devices API.

MobileDeviceApplications

List of applications installed on Mobile Device

MobileDevices

JSON response template for List Mobile Devices operation in Directory API.

MobiledeviceActionCall

Take action on Mobile Device

MobiledeviceDeleteCall

Delete Mobile Device

MobiledeviceGetCall

Retrieve Mobile Device

MobiledeviceListCall

Retrieve all Mobile Devices of a customer (paginated)

MobiledeviceMethods

A builder providing access to all methods supported on mobiledevice resources. It is not used directly, but through the Directory hub.

MultiPartReader

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.

NotificationDeleteCall

Deletes a notification

NotificationGetCall

Retrieves a notification.

NotificationListCall

Retrieves a list of notifications.

NotificationMethods

A builder providing access to all methods supported on notification resources. It is not used directly, but through the Directory hub.

NotificationPatchCall

Updates a notification. This method supports patch semantics.

NotificationUpdateCall

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.

OrgunitDeleteCall

Remove organizational unit

OrgunitGetCall

Retrieve organizational unit

OrgunitInsertCall

Add organizational unit

OrgunitListCall

Retrieve all organizational units

OrgunitMethods

A builder providing access to all methods supported on orgunit resources. It is not used directly, but through the Directory hub.

OrgunitPatchCall

Update organizational unit. This method supports patch semantics.

OrgunitUpdateCall

Update organizational unit

Privilege

JSON template for privilege resource in Directory API.

PrivilegeListCall

Retrieves a paginated list of all privileges for a customer.

PrivilegeMethods

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.

ResolvedAppAccessSettingGetSettingCall

Retrieves resolved app access settings of the logged in user.

ResolvedAppAccessSettingListTrustedAppCall

Retrieves the list of apps trusted by the admin of the logged in user.

ResolvedAppAccessSettingMethods

A builder providing access to all methods supported on resolvedAppAccessSetting resources. It is not used directly, but through the Directory hub.

ResourceCalendarDeleteCall

Deletes a calendar resource.

ResourceCalendarGetCall

Retrieves a calendar resource.

ResourceCalendarInsertCall

Inserts a calendar resource.

ResourceCalendarListCall

Retrieves a list of calendar resources for an account.

ResourceCalendarPatchCall

Updates a calendar resource.

ResourceCalendarUpdateCall

Updates a calendar resource.

ResourceMethods

A builder providing access to all methods supported on resource resources. It is not used directly, but through the Directory hub.

Role

JSON template for role resource in Directory API.

RoleAssignment

JSON template for roleAssignment resource in Directory API.

RoleAssignmentDeleteCall

Deletes a role assignment.

RoleAssignmentGetCall

Retrieve a role assignment.

RoleAssignmentInsertCall

Creates a role assignment.

RoleAssignmentListCall

Retrieves a paginated list of all roleAssignments.

RoleAssignmentMethods

A builder providing access to all methods supported on roleAssignment resources. It is not used directly, but through the Directory hub.

RoleAssignments

JSON response template for List roleAssignments operation in Directory API.

RoleDeleteCall

Deletes a role.

RoleGetCall

Retrieves a role.

RoleInsertCall

Creates a role.

RoleListCall

Retrieves a paginated list of all the roles in a domain.

RoleMethods

A builder providing access to all methods supported on role resources. It is not used directly, but through the Directory hub.

RolePatchCall

Updates a role. This method supports patch semantics.

RoleRolePrivileges

The set of privileges that are granted to this role.

RoleUpdateCall

Updates a role.

Roles

JSON response template for List roles operation in Directory API.

Schema

JSON template for Schema resource in Directory API.

SchemaDeleteCall

Delete schema

SchemaFieldSpec

JSON template for FieldSpec resource for Schemas in Directory API.

SchemaFieldSpecNumericIndexingSpec

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.

SchemaGetCall

Retrieve schema

SchemaInsertCall

Create schema.

SchemaListCall

Retrieve all schemas for a customer

SchemaMethods

A builder providing access to all methods supported on schema resources. It is not used directly, but through the Directory hub.

SchemaPatchCall

Update schema. This method supports patch semantics.

SchemaUpdateCall

Update schema

Schemas

JSON response template for List Schema operation in Directory API.

Token

JSON template for token resource in Directory API.

TokenDeleteCall

Delete all access tokens issued by a user for an application.

TokenGetCall

Get information about an access token issued by a user.

TokenListCall

Returns the set of tokens specified user has issued to 3rd party applications.

TokenMethods

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.

TrustedAppId

JSON template for Trusted App Ids Resource object in Directory API.

TrustedApps

JSON template for Trusted Apps response object of a user in Directory API.

User

JSON template for User object in Directory API.

UserAliaseDeleteCall

Remove a alias for the user

UserAliaseInsertCall

Add a alias for the user

UserAliaseListCall

List all aliases for a user

UserAliaseWatchCall

Watch for changes in user aliases list

UserCustomProperties

JSON template for a set of custom properties (i.e. all fields in a particular schema)

UserDeleteCall

Delete user

UserGetCall

retrieve user

UserInsertCall

create user.

UserListCall

Retrieve either deleted users or all users in a domain (paginated)

UserMakeAdmin

JSON request template for setting/revoking admin status of a user in Directory API.

UserMakeAdminCall

change admin status of a user

UserMethods

A builder providing access to all methods supported on user resources. It is not used directly, but through the Directory hub.

UserName

JSON template for name of a user in Directory API.

UserPatchCall

update user. This method supports patch semantics.

UserPhoto

JSON template for Photo object in Directory API.

UserPhotoDeleteCall

Remove photos for the user

UserPhotoGetCall

Retrieve photo of a user

UserPhotoPatchCall

Add a photo for the user. This method supports patch semantics.

UserPhotoUpdateCall

Add a photo for the user

UserUndelete

JSON request template to undelete a user in Directory API.

UserUndeleteCall

Undelete a deleted user

UserUpdateCall

update user

UserWatchCall

Watch for changes in users list

Users

JSON response template for List Users operation in Apps Directory API.

VerificationCode

JSON template for verification codes in Directory API.

VerificationCodeGenerateCall

Generate new backup verification codes for the user.

VerificationCodeInvalidateCall

Invalidate the current backup verification codes for the user.

VerificationCodeListCall

Returns the current set of valid backup verification codes for the specified user.

VerificationCodeMethods

A builder providing access to all methods supported on verificationCode resources. It is not used directly, but through the Directory hub.

VerificationCodes

JSON response template for List verification codes operation in Directory API.

Enums

Error
Scope

Identifies the an OAuth2 authorization scope. A scope is needed when requesting an authorization token.

Traits

CallBuilder

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.

MethodsBuilder

Identifies types for building methods of a particular resource type

NestedType

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.

ReadSeek

A utility to specify reader types which provide seeking capabilities too

RequestValue

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.

ResponseResult

Identifies types which are used in API responses.

ToParts

A trait for all types that can convert themselves into a parts string

Functions

remove_json_null_values

Type Definitions

Result

A universal result type used as return for all calls.