api: google.golang.org/api/admin/datatransfer/v1 Index | Files

package admin

import "google.golang.org/api/admin/datatransfer/v1"

Package admin provides access to the Admin Data Transfer API.

For product documentation, see: https://developers.google.com/admin-sdk/data-transfer/

Creating a client

Usage example:

import "google.golang.org/api/admin/datatransfer/v1"
...
ctx := context.Background()
adminService, err := admin.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication.

For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:

adminService, err := admin.NewService(ctx, option.WithScopes(admin.AdminDatatransferReadonlyScope))

To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:

adminService, err := admin.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
adminService, err := admin.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See https://godoc.org/google.golang.org/api/option/ for details on options.

Index

Package Files

admin-gen.go

Constants

const (
    // View and manage data transfers between users in your organization
    AdminDatatransferScope = "https://www.googleapis.com/auth/admin.datatransfer"

    // View data transfers between users in your organization
    AdminDatatransferReadonlyScope = "https://www.googleapis.com/auth/admin.datatransfer.readonly"
)

OAuth2 scopes used by this API.

type Application Uses

type Application struct {
    // Etag: Etag of the resource.
    Etag string `json:"etag,omitempty"`

    // Id: The application's ID.
    Id  int64 `json:"id,omitempty,string"`

    // Kind: Identifies the resource as a DataTransfer Application Resource.
    Kind string `json:"kind,omitempty"`

    // Name: The application's name.
    Name string `json:"name,omitempty"`

    // TransferParams: The list of all possible transfer parameters for this
    // application. These parameters can be used to select the data of the
    // user in this application to be transfered.
    TransferParams []*ApplicationTransferParam `json:"transferParams,omitempty"`

    // ServerResponse contains the HTTP response code and headers from the
    // server.
    googleapi.ServerResponse `json:"-"`

    // ForceSendFields is a list of field names (e.g. "Etag") to
    // unconditionally include in API requests. By default, fields with
    // empty values are omitted from API requests. However, any non-pointer,
    // non-interface field appearing in ForceSendFields will be sent to the
    // server regardless of whether the field is empty or not. This may be
    // used to include empty fields in Patch requests.
    ForceSendFields []string `json:"-"`

    // NullFields is a list of field names (e.g. "Etag") to include in API
    // requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

Application: The JSON template for an Application resource.

func (*Application) MarshalJSON Uses

func (s *Application) MarshalJSON() ([]byte, error)

type ApplicationDataTransfer Uses

type ApplicationDataTransfer struct {
    // ApplicationId: The application's ID.
    ApplicationId int64 `json:"applicationId,omitempty,string"`

    // ApplicationTransferParams: The transfer parameters for the
    // application. These parameters are used to select the data which will
    // get transfered in context of this application.
    ApplicationTransferParams []*ApplicationTransferParam `json:"applicationTransferParams,omitempty"`

    // ApplicationTransferStatus: Current status of transfer for this
    // application. (Read-only)
    ApplicationTransferStatus string `json:"applicationTransferStatus,omitempty"`

    // ForceSendFields is a list of field names (e.g. "ApplicationId") to
    // unconditionally include in API requests. By default, fields with
    // empty values are omitted from API requests. However, any non-pointer,
    // non-interface field appearing in ForceSendFields will be sent to the
    // server regardless of whether the field is empty or not. This may be
    // used to include empty fields in Patch requests.
    ForceSendFields []string `json:"-"`

    // NullFields is a list of field names (e.g. "ApplicationId") to include
    // in API requests with the JSON null value. By default, fields with
    // empty values are omitted from API requests. However, any field with
    // an empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

ApplicationDataTransfer: Template to map fields of ApplicationDataTransfer resource.

func (*ApplicationDataTransfer) MarshalJSON Uses

func (s *ApplicationDataTransfer) MarshalJSON() ([]byte, error)

type ApplicationTransferParam Uses

type ApplicationTransferParam struct {
    // Key: The type of the transfer parameter. eg: 'PRIVACY_LEVEL'
    Key string `json:"key,omitempty"`

    // Value: The value of the coressponding transfer parameter. eg:
    // 'PRIVATE' or 'SHARED'
    Value []string `json:"value,omitempty"`

    // ForceSendFields is a list of field names (e.g. "Key") to
    // unconditionally include in API requests. By default, fields with
    // empty values are omitted from API requests. However, any non-pointer,
    // non-interface field appearing in ForceSendFields will be sent to the
    // server regardless of whether the field is empty or not. This may be
    // used to include empty fields in Patch requests.
    ForceSendFields []string `json:"-"`

    // NullFields is a list of field names (e.g. "Key") to include in API
    // requests with the JSON null value. By default, fields with empty
    // values are omitted from API requests. However, any field with an
    // empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

ApplicationTransferParam: Template for application transfer parameters.

func (*ApplicationTransferParam) MarshalJSON Uses

func (s *ApplicationTransferParam) MarshalJSON() ([]byte, error)

type ApplicationsGetCall Uses

type ApplicationsGetCall struct {
    // contains filtered or unexported fields
}

func (*ApplicationsGetCall) Context Uses

func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ApplicationsGetCall) Do Uses

func (c *ApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error)

Do executes the "datatransfer.applications.get" call. Exactly one of *Application or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *Application.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ApplicationsGetCall) Fields Uses

func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ApplicationsGetCall) Header Uses

func (c *ApplicationsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ApplicationsGetCall) IfNoneMatch Uses

func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type ApplicationsListCall Uses

type ApplicationsListCall struct {
    // contains filtered or unexported fields
}

func (*ApplicationsListCall) Context Uses

func (c *ApplicationsListCall) Context(ctx context.Context) *ApplicationsListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ApplicationsListCall) CustomerId Uses

func (c *ApplicationsListCall) CustomerId(customerId string) *ApplicationsListCall

CustomerId sets the optional parameter "customerId": Immutable ID of the Google Apps account.

func (*ApplicationsListCall) Do Uses

func (c *ApplicationsListCall) Do(opts ...googleapi.CallOption) (*ApplicationsListResponse, error)

Do executes the "datatransfer.applications.list" call. Exactly one of *ApplicationsListResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ApplicationsListResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ApplicationsListCall) Fields Uses

func (c *ApplicationsListCall) Fields(s ...googleapi.Field) *ApplicationsListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ApplicationsListCall) Header Uses

func (c *ApplicationsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ApplicationsListCall) IfNoneMatch Uses

func (c *ApplicationsListCall) IfNoneMatch(entityTag string) *ApplicationsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ApplicationsListCall) MaxResults Uses

func (c *ApplicationsListCall) MaxResults(maxResults int64) *ApplicationsListCall

MaxResults sets the optional parameter "maxResults": Maximum number of results to return. Default is 100.

func (*ApplicationsListCall) PageToken Uses

func (c *ApplicationsListCall) PageToken(pageToken string) *ApplicationsListCall

PageToken sets the optional parameter "pageToken": Token to specify next page in the list.

func (*ApplicationsListCall) Pages Uses

func (c *ApplicationsListCall) Pages(ctx context.Context, f func(*ApplicationsListResponse) error) error

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type ApplicationsListResponse Uses

type ApplicationsListResponse struct {
    // Applications: List of applications that support data transfer and are
    // also installed for the customer.
    Applications []*Application `json:"applications,omitempty"`

    // Etag: ETag of the resource.
    Etag string `json:"etag,omitempty"`

    // Kind: Identifies the resource as a collection of Applications.
    Kind string `json:"kind,omitempty"`

    // NextPageToken: Continuation token which will be used to specify next
    // page in list API.
    NextPageToken string `json:"nextPageToken,omitempty"`

    // ServerResponse contains the HTTP response code and headers from the
    // server.
    googleapi.ServerResponse `json:"-"`

    // ForceSendFields is a list of field names (e.g. "Applications") to
    // unconditionally include in API requests. By default, fields with
    // empty values are omitted from API requests. However, any non-pointer,
    // non-interface field appearing in ForceSendFields will be sent to the
    // server regardless of whether the field is empty or not. This may be
    // used to include empty fields in Patch requests.
    ForceSendFields []string `json:"-"`

    // NullFields is a list of field names (e.g. "Applications") to include
    // in API requests with the JSON null value. By default, fields with
    // empty values are omitted from API requests. However, any field with
    // an empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

ApplicationsListResponse: Template for a collection of Applications.

func (*ApplicationsListResponse) MarshalJSON Uses

func (s *ApplicationsListResponse) MarshalJSON() ([]byte, error)

type ApplicationsService Uses

type ApplicationsService struct {
    // contains filtered or unexported fields
}

func NewApplicationsService Uses

func NewApplicationsService(s *Service) *ApplicationsService

func (*ApplicationsService) Get Uses

func (r *ApplicationsService) Get(applicationId int64) *ApplicationsGetCall

Get: Retrieves information about an application for the given application ID.

func (*ApplicationsService) List Uses

func (r *ApplicationsService) List() *ApplicationsListCall

List: Lists the applications available for data transfer for a customer.

type DataTransfer Uses

type DataTransfer struct {
    // ApplicationDataTransfers: List of per application data transfer
    // resources. It contains data transfer details of the applications
    // associated with this transfer resource. Note that this list is also
    // used to specify the applications for which data transfer has to be
    // done at the time of the transfer resource creation.
    ApplicationDataTransfers []*ApplicationDataTransfer `json:"applicationDataTransfers,omitempty"`

    // Etag: ETag of the resource.
    Etag string `json:"etag,omitempty"`

    // Id: The transfer's ID (Read-only).
    Id  string `json:"id,omitempty"`

    // Kind: Identifies the resource as a DataTransfer request.
    Kind string `json:"kind,omitempty"`

    // NewOwnerUserId: ID of the user to whom the data is being transfered.
    NewOwnerUserId string `json:"newOwnerUserId,omitempty"`

    // OldOwnerUserId: ID of the user whose data is being transfered.
    OldOwnerUserId string `json:"oldOwnerUserId,omitempty"`

    // OverallTransferStatusCode: Overall transfer status (Read-only).
    OverallTransferStatusCode string `json:"overallTransferStatusCode,omitempty"`

    // RequestTime: The time at which the data transfer was requested
    // (Read-only).
    RequestTime string `json:"requestTime,omitempty"`

    // ServerResponse contains the HTTP response code and headers from the
    // server.
    googleapi.ServerResponse `json:"-"`

    // ForceSendFields is a list of field names (e.g.
    // "ApplicationDataTransfers") to unconditionally include in API
    // requests. By default, fields with empty values are omitted from API
    // requests. However, any non-pointer, non-interface field appearing in
    // ForceSendFields will be sent to the server regardless of whether the
    // field is empty or not. This may be used to include empty fields in
    // Patch requests.
    ForceSendFields []string `json:"-"`

    // NullFields is a list of field names (e.g. "ApplicationDataTransfers")
    // to include in API requests with the JSON null value. By default,
    // fields with empty values are omitted from API requests. However, any
    // field with an empty value appearing in NullFields will be sent to the
    // server as null. It is an error if a field in this list has a
    // non-empty value. This may be used to include null fields in Patch
    // requests.
    NullFields []string `json:"-"`
}

DataTransfer: The JSON template for a DataTransfer resource.

func (*DataTransfer) MarshalJSON Uses

func (s *DataTransfer) MarshalJSON() ([]byte, error)

type DataTransfersListResponse Uses

type DataTransfersListResponse struct {
    // DataTransfers: List of data transfer requests.
    DataTransfers []*DataTransfer `json:"dataTransfers,omitempty"`

    // Etag: ETag of the resource.
    Etag string `json:"etag,omitempty"`

    // Kind: Identifies the resource as a collection of data transfer
    // requests.
    Kind string `json:"kind,omitempty"`

    // NextPageToken: Continuation token which will be used to specify next
    // page in list API.
    NextPageToken string `json:"nextPageToken,omitempty"`

    // ServerResponse contains the HTTP response code and headers from the
    // server.
    googleapi.ServerResponse `json:"-"`

    // ForceSendFields is a list of field names (e.g. "DataTransfers") to
    // unconditionally include in API requests. By default, fields with
    // empty values are omitted from API requests. However, any non-pointer,
    // non-interface field appearing in ForceSendFields will be sent to the
    // server regardless of whether the field is empty or not. This may be
    // used to include empty fields in Patch requests.
    ForceSendFields []string `json:"-"`

    // NullFields is a list of field names (e.g. "DataTransfers") to include
    // in API requests with the JSON null value. By default, fields with
    // empty values are omitted from API requests. However, any field with
    // an empty value appearing in NullFields will be sent to the server as
    // null. It is an error if a field in this list has a non-empty value.
    // This may be used to include null fields in Patch requests.
    NullFields []string `json:"-"`
}

DataTransfersListResponse: Template for a collection of DataTransfer resources.

func (*DataTransfersListResponse) MarshalJSON Uses

func (s *DataTransfersListResponse) MarshalJSON() ([]byte, error)

type Service Uses

type Service struct {
    BasePath  string // API endpoint base URL
    UserAgent string // optional additional User-Agent fragment

    Applications *ApplicationsService

    Transfers *TransfersService
    // contains filtered or unexported fields
}

func New Uses

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService Uses

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type TransfersGetCall Uses

type TransfersGetCall struct {
    // contains filtered or unexported fields
}

func (*TransfersGetCall) Context Uses

func (c *TransfersGetCall) Context(ctx context.Context) *TransfersGetCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TransfersGetCall) Do Uses

func (c *TransfersGetCall) Do(opts ...googleapi.CallOption) (*DataTransfer, error)

Do executes the "datatransfer.transfers.get" call. Exactly one of *DataTransfer or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *DataTransfer.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TransfersGetCall) Fields Uses

func (c *TransfersGetCall) Fields(s ...googleapi.Field) *TransfersGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TransfersGetCall) Header Uses

func (c *TransfersGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TransfersGetCall) IfNoneMatch Uses

func (c *TransfersGetCall) IfNoneMatch(entityTag string) *TransfersGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type TransfersInsertCall Uses

type TransfersInsertCall struct {
    // contains filtered or unexported fields
}

func (*TransfersInsertCall) Context Uses

func (c *TransfersInsertCall) Context(ctx context.Context) *TransfersInsertCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TransfersInsertCall) Do Uses

func (c *TransfersInsertCall) Do(opts ...googleapi.CallOption) (*DataTransfer, error)

Do executes the "datatransfer.transfers.insert" call. Exactly one of *DataTransfer or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *DataTransfer.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TransfersInsertCall) Fields Uses

func (c *TransfersInsertCall) Fields(s ...googleapi.Field) *TransfersInsertCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TransfersInsertCall) Header Uses

func (c *TransfersInsertCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type TransfersListCall Uses

type TransfersListCall struct {
    // contains filtered or unexported fields
}

func (*TransfersListCall) Context Uses

func (c *TransfersListCall) Context(ctx context.Context) *TransfersListCall

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*TransfersListCall) CustomerId Uses

func (c *TransfersListCall) CustomerId(customerId string) *TransfersListCall

CustomerId sets the optional parameter "customerId": Immutable ID of the Google Apps account.

func (*TransfersListCall) Do Uses

func (c *TransfersListCall) Do(opts ...googleapi.CallOption) (*DataTransfersListResponse, error)

Do executes the "datatransfer.transfers.list" call. Exactly one of *DataTransfersListResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *DataTransfersListResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*TransfersListCall) Fields Uses

func (c *TransfersListCall) Fields(s ...googleapi.Field) *TransfersListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*TransfersListCall) Header Uses

func (c *TransfersListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*TransfersListCall) IfNoneMatch Uses

func (c *TransfersListCall) IfNoneMatch(entityTag string) *TransfersListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*TransfersListCall) MaxResults Uses

func (c *TransfersListCall) MaxResults(maxResults int64) *TransfersListCall

MaxResults sets the optional parameter "maxResults": Maximum number of results to return. Default is 100.

func (*TransfersListCall) NewOwnerUserId Uses

func (c *TransfersListCall) NewOwnerUserId(newOwnerUserId string) *TransfersListCall

NewOwnerUserId sets the optional parameter "newOwnerUserId": Destination user's profile ID.

func (*TransfersListCall) OldOwnerUserId Uses

func (c *TransfersListCall) OldOwnerUserId(oldOwnerUserId string) *TransfersListCall

OldOwnerUserId sets the optional parameter "oldOwnerUserId": Source user's profile ID.

func (*TransfersListCall) PageToken Uses

func (c *TransfersListCall) PageToken(pageToken string) *TransfersListCall

PageToken sets the optional parameter "pageToken": Token to specify the next page in the list.

func (*TransfersListCall) Pages Uses

func (c *TransfersListCall) Pages(ctx context.Context, f func(*DataTransfersListResponse) error) error

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

func (*TransfersListCall) Status Uses

func (c *TransfersListCall) Status(status string) *TransfersListCall

Status sets the optional parameter "status": Status of the transfer.

type TransfersService Uses

type TransfersService struct {
    // contains filtered or unexported fields
}

func NewTransfersService Uses

func NewTransfersService(s *Service) *TransfersService

func (*TransfersService) Get Uses

func (r *TransfersService) Get(dataTransferId string) *TransfersGetCall

Get: Retrieves a data transfer request by its resource ID.

func (*TransfersService) Insert Uses

func (r *TransfersService) Insert(datatransfer *DataTransfer) *TransfersInsertCall

Insert: Inserts a data transfer request.

func (*TransfersService) List Uses

func (r *TransfersService) List() *TransfersListCall

List: Lists the transfers for a customer by source user, destination user, or status.

Package admin imports 14 packages (graph). Updated 2019-07-12. Refresh now. Tools for package owners.