Class: Google::Apis::AdminReportsV1::ReportsService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/admin_reports_v1/service.rb

Overview

Admin SDK API

Admin SDK lets administrators of enterprise domains to view and manage resources like user, groups etc. It also provides audit and usage reports of domain.

Examples:

require 'google/apis/admin_reports_v1'

Admin = Google::Apis::AdminReportsV1 # Alias the module
service = Admin::ReportsService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://admin.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReportsService

Returns a new instance of ReportsService.



49
50
51
52
53
54
# File 'lib/google/apis/admin_reports_v1/service.rb', line 49

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-admin_reports_v1',
        client_version: Google::Apis::AdminReportsV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



42
43
44
# File 'lib/google/apis/admin_reports_v1/service.rb', line 42

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



47
48
49
# File 'lib/google/apis/admin_reports_v1/service.rb', line 47

def quota_user
  @quota_user
end

Instance Method Details

#get_customer_usage_report(date, customer_id: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::UsageReports

Retrieves a report which is a collection of properties and statistics for a specific customer's account. For more information, see the Customers Usage Report guide. For more information about the customer report's parameters, see the Customers Usage parameters reference guides.

Parameters:

  • date (String)

    Represents the date the usage occurred, based on UTC-8:00 (Pacific Standard Time). The timestamp is in the ISO 8601 format, yyyy-mm-dd.

  • customer_id (String) (defaults to: nil)

    The unique ID of the customer to retrieve data for.

  • page_token (String) (defaults to: nil)

    Token to specify next page. A report with multiple pages has a nextPageToken property in the response. For your follow-on requests getting all of the report's pages, enter the nextPageToken value in the pageToken query string.

  • parameters (String) (defaults to: nil)

    The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Customers usage report include accounts, app_maker, apps_scripts, calendar, chat, classroom, cros , docs, gmail, gplus, device_management, meet, and sites. A parameters query string is in the CSV form of app_name1:param_name1, app_name2:param_name2. Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



473
474
475
476
477
478
479
480
481
482
483
484
# File 'lib/google/apis/admin_reports_v1/service.rb', line 473

def get_customer_usage_report(date, customer_id: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'admin/reports/v1/usage/dates/{date}', options)
  command.response_representation = Google::Apis::AdminReportsV1::UsageReports::Representation
  command.response_class = Google::Apis::AdminReportsV1::UsageReports
  command.params['date'] = date unless date.nil?
  command.query['customerId'] = customer_id unless customer_id.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parameters'] = parameters unless parameters.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_entity_usage_report(entity_type, entity_key, date, customer_id: nil, filters: nil, max_results: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::UsageReports

Retrieves a report which is a collection of properties and statistics for entities used by users within the account. For more information, see the Entities Usage Report guide. For more information about the entities report's parameters, see the Entities Usage parameters reference guides.

Parameters:

  • entity_type (String)

    Represents the type of entity for the report.

  • entity_key (String)

    Represents the key of the object to filter the data with. It is a string which can take the value all to get activity events for all users, or any other value for an app-specific entity. For details on how to obtain the entityKey for a particular entityType, see the Entities Usage parameters reference guides.

  • date (String)

    Represents the date the usage occurred, based on UTC-8:00 (Pacific Standard Time). The timestamp is in the ISO 8601 format, yyyy-mm-dd.

  • customer_id (String) (defaults to: nil)

    The unique ID of the customer to retrieve data for.

  • filters (String) (defaults to: nil)

    The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Entities usage report include accounts, docs, and gmail. Filters are in the form [ application name]:parameter name[parameter value],.... In this example, the `<

    'not equal to' operator is URL-encoded in the request's query string (%3C% 3E): GET https://www.googleapis.com/admin/reports/v1/usage/gplus_communities/ all/dates/2017-12-01 ?parameters=gplus:community_name,gplus:num_total_members & filters=gplus:num_total_members%3C%3E0 The relational operators include: -==`

    • 'equal to'. - <> - 'not equal to'. It is URL-encoded (%3C%3E). - < - ' less than'. It is URL-encoded (%3C). - <= - 'less than or equal to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >= - ' greater than or equal to'. It is URL-encoded (%3E=). Filters can only be applied to numeric parameters.
  • max_results (Fixnum) (defaults to: nil)

    Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page.

  • page_token (String) (defaults to: nil)

    Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string.

  • parameters (String) (defaults to: nil)

    The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Entities usage report are only gplus. A parameter query string is in the CSV form of [app_name1: param_name1], [app_name2:param_name2].... Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/google/apis/admin_reports_v1/service.rb', line 559

def get_entity_usage_report(entity_type, entity_key, date, customer_id: nil, filters: nil, max_results: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'admin/reports/v1/usage/{entityType}/{entityKey}/dates/{date}', options)
  command.response_representation = Google::Apis::AdminReportsV1::UsageReports::Representation
  command.response_class = Google::Apis::AdminReportsV1::UsageReports
  command.params['entityType'] = entity_type unless entity_type.nil?
  command.params['entityKey'] = entity_key unless entity_key.nil?
  command.params['date'] = date unless date.nil?
  command.query['customerId'] = customer_id unless customer_id.nil?
  command.query['filters'] = filters unless filters.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parameters'] = parameters unless parameters.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_usage_report(user_key, date, customer_id: nil, filters: nil, group_id_filter: nil, max_results: nil, org_unit_id: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::UsageReports

Retrieves a report which is a collection of properties and statistics for a set of users with the account. For more information, see the User Usage Report guide. For more information about the user report's parameters, see the Users Usage parameters reference guides.

Parameters:

  • user_key (String)

    Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique Google Workspace profile ID or their primary email address. Must not be a deleted user. For a deleted user, call users.list in Directory API with showDeleted=true, then use the returned ID as the userKey.

  • date (String)

    Represents the date the usage occurred, based on UTC-8:00 (Pacific Standard Time). The timestamp is in the ISO 8601 format, yyyy-mm-dd.

  • customer_id (String) (defaults to: nil)

    The unique ID of the customer to retrieve data for.

  • filters (String) (defaults to: nil)

    The filters query string is a comma-separated list of an application's event parameters where the parameter's value is manipulated by a relational operator. The filters query string includes the name of the application whose usage is returned in the report. The application values for the Users Usage Report include accounts, chat, docs, and gmail. Filters are in the form [ application name]:parameter name[parameter value],.... In this example, the `<

    ` 'not equal to' operator is URL-encoded in the request's query string (%3C% 3E): GET https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/ 2013-03-03 ?parameters=accounts:last_login_time &filters=accounts: last_login_time%3C%3E2010-10-28T10:26:35.000Z The relational operators include:

    • == - 'equal to'. - <> - 'not equal to'. It is URL-encoded (%3C%3E). - < - 'less than'. It is URL-encoded (%3C). - <= - 'less than or equal to'. It is URL-encoded (%3C=). - > - 'greater than'. It is URL-encoded (%3E). - >=
    • 'greater than or equal to'. It is URL-encoded (%3E=).
  • group_id_filter (String) (defaults to: nil)

    Comma separated group ids (obfuscated) on which user activities are filtered, i.e. the response will contain activities for only those users that are a part of at least one of the group ids mentioned here. Format: "id:abc123,id:xyz456"

  • max_results (Fixnum) (defaults to: nil)

    Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional.

  • org_unit_id (String) (defaults to: nil)

    ID of the organizational unit to report on. User activity will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results.

  • page_token (String) (defaults to: nil)

    Token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string.

  • parameters (String) (defaults to: nil)

    The parameters query string is a comma-separated list of event parameters that refine a report's results. The parameter is associated with a specific application. The application values for the Customers Usage report include accounts, app_maker, apps_scripts, calendar, chat, classroom, cros , docs, gmail, gplus, device_management, meet, and sites. A parameters query string is in the CSV form of app_name1:param_name1, app_name2:param_name2. Note: The API doesn't accept multiple values of a parameter. If a particular parameter is supplied more than once in the API request, the API only accepts the last value of that request parameter. In addition, if an invalid request parameter is supplied in the API request, the API ignores that request parameter and returns the response corresponding to the remaining valid request parameters. An example of an invalid request parameter is one that does not belong to the application. If no parameters are requested, all parameters are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/google/apis/admin_reports_v1/service.rb', line 656

def get_user_usage_report(user_key, date, customer_id: nil, filters: nil, group_id_filter: nil, max_results: nil, org_unit_id: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'admin/reports/v1/usage/users/{userKey}/dates/{date}', options)
  command.response_representation = Google::Apis::AdminReportsV1::UsageReports::Representation
  command.response_class = Google::Apis::AdminReportsV1::UsageReports
  command.params['userKey'] = user_key unless user_key.nil?
  command.params['date'] = date unless date.nil?
  command.query['customerId'] = customer_id unless customer_id.nil?
  command.query['filters'] = filters unless filters.nil?
  command.query['groupIdFilter'] = group_id_filter unless group_id_filter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['orgUnitID'] = org_unit_id unless org_unit_id.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['parameters'] = parameters unless parameters.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_activities(user_key, application_name, actor_ip_address: nil, application_info_filter: nil, customer_id: nil, end_time: nil, event_name: nil, filters: nil, group_id_filter: nil, max_results: nil, network_info_filter: nil, org_unit_id: nil, page_token: nil, resource_details_filter: nil, start_time: nil, status_filter: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::Activities

Retrieves a list of activities for a specific customer's account and application such as the Admin console application or the Google Drive application. For more information, see the guides for administrator and Google Drive activity reports. For more information about the activity report's parameters, see the activity parameters reference guides.

Parameters:

  • user_key (String)

    Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique Google Workspace profile ID or their primary email address. Must not be a deleted user. For a deleted user, call users.list in Directory API with showDeleted=true, then use the returned ID as the userKey.

  • application_name (String)

    Application name for which the events are to be retrieved.

  • actor_ip_address (String) (defaults to: nil)

    The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.

  • application_info_filter (String) (defaults to: nil)

    Optional. Used to filter on the oAuthClientId field present in ApplicationInfo message. Usage GET...& applicationInfoFilter=oAuthClientId="clientId" GET...&applicationInfoFilter= oAuthClientId=%22clientId%22

  • customer_id (String) (defaults to: nil)

    The unique ID of the customer to retrieve data for.

  • end_time (String) (defaults to: nil)

    Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: - Date of the API's request for a report: When the API created and retrieved the report. - Report's start time: The beginning of the timespan shown in the report. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. - Report's end time: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the endTime is not specified, the report returns all activities from the startTime until the current time or the most recent 180 days if the startTime is more than 180 days in the past. For Gmail requests, startTime and endTime must be provided and the difference must not be greater than 30 days.

  • event_name (String) (defaults to: nil)

    The name of the event being queried by the API. Each eventName is related to a specific Google Workspace service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings type structure has all of the Calendar eventName activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings type and eventName parameters. For more information about eventName query strings and parameters, see the list of event names for various applications above in applicationName.

  • filters (String) (defaults to: nil)

    The filters query string is a comma-separated list composed of event parameters manipulated by relational operators. Event parameters are in the form parameter1 namerelational operatorparameter1 value`,`parameter2 namerelational operatorparameter2 value`,...` These event parameters are associated with a specific `eventName`. An empty report is returned if the request's parameter doesn't belong to the `eventName`. For more information about the available `eventName` fields for each application and their associated parameters, go to the [ApplicationName](#applicationname) table, then click through to the Activity Events page in the Appendix for the application you want. In the following Drive activity examples, the returned list consists of all `edit` events where the `doc_id` parameter value matches the conditions defined by the relational operator. In the first example, the request returns all edited documents with a `doc_id` value equal to `12345`. In the second example, the report returns any edited documents where the ` doc_id` value is not equal to `98765`. The `<>` operator is URL-encoded in the request's query string (`%3C%3E`):GET...&eventName=edit&filters=doc_id== 12345 GET...&eventName=edit&filters=doc_id%3C%3E98765`Afiltersquery supports these relational operators: *==—'equal to'. *<>—'not equal to'. Must be URL-encoded (%3C%3E). *<—'less than'. Must be URL-encoded (%3C). * <=—'less than or equal to'. Must be URL-encoded (%3C=). *>—'greater than'. Must be URL-encoded (%3E). *>=`—'greater than or equal to'. Must be URL- encoded (%3E=). Note: The API doesn't accept multiple values of the same parameter. If a parameter is supplied more than once in the API request, the API only accepts the last value of that parameter. In addition, if an invalid parameter is supplied in the API request, the API ignores that parameter and returns the response corresponding to the remaining valid parameters. If no parameters are requested, all parameters are returned.

  • group_id_filter (String) (defaults to: nil)

    Comma separated group ids (obfuscated) on which user activities are filtered, i.e. the response will contain activities for only those users that are a part of at least one of the group ids mentioned here. Format: "id:abc123,id:xyz456" Important: To filter by groups, you must explicitly add the groups to your filtering groups allowlist. For more information about adding groups to filtering groups allowlist, see Filter results by Google Group

  • max_results (Fixnum) (defaults to: nil)

    Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional in the request. The default value is 1000.

  • network_info_filter (String) (defaults to: nil)

    Optional. Used to filter on the regionCode field present in NetworkInfo message. Usage GET...&networkInfoFilter=regionCode="IN" GET...&networkInfoFilter=regionCode=%22IN%22

  • org_unit_id (String) (defaults to: nil)

    ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results.

  • page_token (String) (defaults to: nil)

    The token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string.

  • resource_details_filter (String) (defaults to: nil)

    Optional. The resourceDetailsFilter query string is an AND separated list composed of Resource Details fields manipulated by relational operators. Resource Details Filters are in the form resourceDetails.field1relational operatorfield1 value` AND ` resourceDetails.field2relational operatorfield2 value`...` All the inner fields are traversed using the `.` operator, as shown in the following example: resourceDetails.id = "resourceId" AND resourceDetails.appliedLabels.id = " appliedLabelId" AND resourceDetails.appliedLabels.fieldValue.id = " fieldValueId"`resourceDetailsFilterquery supports these relational operators: *=—'equal to'. *!=—'not equal to'. *:—'exists'. This is used for filtering on repeated fields. [FieldValue](#fieldvalue) types that are repeated in nature usesexistsoperator for filtering. The following [ FieldValue](#fieldvalue) types are repeated: * [TextListValue](# textlistvalue) * [SelectionListValue](#selectionlistvalue) * [UserListValue ](#userlistvalue) For example, in the following filter, [SelectionListValue`](

    selectionlistvalue), is a repeated field. The filter checks whether [`

    SelectionListValue](#selectionlistvalue) containsselection_id: resourceDetails.id = "resourceId" AND resourceDetails.appliedLabels.id = " appliedLabelId" AND resourceDetails.appliedLabels.fieldValue.id = " fieldValueId" AND resourceDetails.appliedLabels.fieldValue.type = " SELECTION_LIST_VALUE" AND resourceDetails.appliedLabels.fieldValue. selectionListValue.id: "id"**Usage**GET...&resourceDetailsFilter= resourceDetails.id = "resourceId" AND resourceDetails.appliedLabels.id = " appliedLabelId" GET...&resourceDetailsFilter=resourceDetails.id=%22resourceId% 22%20AND%20resourceDetails.appliedLabels.id=%22appliedLabelId%22**Note the following**: * You must URL encode the query string before sending the request. * The API supports a maximum of 5 fields separated by the AND operator. - When filtering on deeper levels (e.g., [AppliedLabel](# appliedlabel), [FieldValue](#fieldvalue)), the IDs of all preceding levels in the hierarchy must be included in the filter. For example: Filtering on [ FieldValue](#fieldvalue) requires [AppliedLabel](#appliedlabel) ID and resourceDetails ID to be present. *Sample Query*:resourceDetails.id = " resourceId" AND resourceDetails.appliedLabels.id = "appliedLabelId" AND resourceDetails.appliedLabels.fieldValue.id = "fieldValueId"* Filtering on inner [FieldValue](#fieldvalue) types likelongTextValueandtextValue requiresresourceDetails.appliedLabels.fieldValue.typeto be present. * Only Filtering on a single [AppliedLabel](#appliedlabel) id and [FieldValue` ](#fieldvalue) id is supported.

  • start_time (String) (defaults to: nil)

    Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until endTime. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. For Gmail requests, startTime and endTime must be provided and the difference must not be greater than 30 days.

  • status_filter (String) (defaults to: nil)

    Optional. Used to filter on the statusCode field present in Status message. Usage GET...&statusFilter=statusCode="200" GET...& statusFilter=statusCode=%22200%22

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/google/apis/admin_reports_v1/service.rb', line 230

def list_activities(user_key, application_name, actor_ip_address: nil, application_info_filter: nil, customer_id: nil, end_time: nil, event_name: nil, filters: nil, group_id_filter: nil, max_results: nil, network_info_filter: nil, org_unit_id: nil, page_token: nil, resource_details_filter: nil, start_time: nil, status_filter: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'admin/reports/v1/activity/users/{userKey}/applications/{applicationName}', options)
  command.response_representation = Google::Apis::AdminReportsV1::Activities::Representation
  command.response_class = Google::Apis::AdminReportsV1::Activities
  command.params['userKey'] = user_key unless user_key.nil?
  command.params['applicationName'] = application_name unless application_name.nil?
  command.query['actorIpAddress'] = actor_ip_address unless actor_ip_address.nil?
  command.query['applicationInfoFilter'] = application_info_filter unless application_info_filter.nil?
  command.query['customerId'] = customer_id unless customer_id.nil?
  command.query['endTime'] = end_time unless end_time.nil?
  command.query['eventName'] = event_name unless event_name.nil?
  command.query['filters'] = filters unless filters.nil?
  command.query['groupIdFilter'] = group_id_filter unless group_id_filter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['networkInfoFilter'] = network_info_filter unless network_info_filter.nil?
  command.query['orgUnitID'] = org_unit_id unless org_unit_id.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['resourceDetailsFilter'] = resource_details_filter unless resource_details_filter.nil?
  command.query['startTime'] = start_time unless start_time.nil?
  command.query['statusFilter'] = status_filter unless status_filter.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... }

This method returns an undefined value.

Stop watching resources through this channel.

Parameters:

  • channel_object (Google::Apis::AdminReportsV1::Channel) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

  • result (NilClass)

    No result returned for this method

  • err (StandardError)

    error object if request failed

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



417
418
419
420
421
422
423
424
# File 'lib/google/apis/admin_reports_v1/service.rb', line 417

def stop_channel(channel_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'admin/reports_v1/channels/stop', options)
  command.request_representation = Google::Apis::AdminReportsV1::Channel::Representation
  command.request_object = channel_object
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#watch_activity(user_key, application_name, channel_object = nil, actor_ip_address: nil, customer_id: nil, end_time: nil, event_name: nil, filters: nil, group_id_filter: nil, max_results: nil, org_unit_id: nil, page_token: nil, start_time: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::Channel

Start receiving notifications for account activities. For more information, see Receiving Push Notifications.

Parameters:

  • user_key (String)

    Represents the profile ID or the user email for which the data should be filtered. Can be all for all information, or userKey for a user's unique Google Workspace profile ID or their primary email address. Must not be a deleted user. For a deleted user, call users.list in Directory API with showDeleted=true, then use the returned ID as the userKey.

  • application_name (String)

    Application name for which the events are to be retrieved.

  • channel_object (Google::Apis::AdminReportsV1::Channel) (defaults to: nil)
  • actor_ip_address (String) (defaults to: nil)

    The Internet Protocol (IP) Address of host where the event was performed. This is an additional way to filter a report's summary using the IP address of the user whose activity is being reported. This IP address may or may not reflect the user's physical location. For example, the IP address can be the user's proxy server's address or a virtual private network (VPN) address. This parameter supports both IPv4 and IPv6 address versions.

  • customer_id (String) (defaults to: nil)

    The unique ID of the customer to retrieve data for.

  • end_time (String) (defaults to: nil)

    Sets the end of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The default value is the approximate time of the API request. An API report has three basic time concepts: - Date of the API's request for a report: When the API created and retrieved the report. - Report's start time: The beginning of the timespan shown in the report. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error. - Report's end time: The end of the timespan shown in the report. For example, the timespan of events summarized in a report can start in April and end in May. The report itself can be requested in August. If the endTime is not specified, the report returns all activities from the startTime until the current time or the most recent 180 days if the startTime is more than 180 days in the past.

  • event_name (String) (defaults to: nil)

    The name of the event being queried by the API. Each eventName is related to a specific Google Workspace service or feature which the API organizes into types of events. An example is the Google Calendar events in the Admin console application's reports. The Calendar Settings type structure has all of the Calendar eventName activities reported by the API. When an administrator changes a Calendar setting, the API reports this activity in the Calendar Settings type and eventName parameters. For more information about eventName query strings and parameters, see the list of event names for various applications above in applicationName.

  • filters (String) (defaults to: nil)

    The filters query string is a comma-separated list composed of event parameters manipulated by relational operators. Event parameters are in the form parameter1 namerelational operatorparameter1 value`,`parameter2 namerelational operatorparameter2 value`,...` These event parameters are associated with a specific `eventName`. An empty report is returned if the request's parameter doesn't belong to the `eventName`. For more information about the available `eventName` fields for each application and their associated parameters, go to the [ApplicationName](#applicationname) table, then click through to the Activity Events page in the Appendix for the application you want. In the following Drive activity examples, the returned list consists of all `edit` events where the `doc_id` parameter value matches the conditions defined by the relational operator. In the first example, the request returns all edited documents with a `doc_id` value equal to `12345`. In the second example, the report returns any edited documents where the ` doc_id` value is not equal to `98765`. The `<>` operator is URL-encoded in the request's query string (`%3C%3E`):GET...&eventName=edit&filters=doc_id== 12345 GET...&eventName=edit&filters=doc_id%3C%3E98765`Afiltersquery supports these relational operators: *==—'equal to'. *<>—'not equal to'. Must be URL-encoded (%3C%3E). *<—'less than'. Must be URL-encoded (%3C). * <=—'less than or equal to'. Must be URL-encoded (%3C=). *>—'greater than'. Must be URL-encoded (%3E). *>=`—'greater than or equal to'. Must be URL- encoded (%3E=). Note: The API doesn't accept multiple values of the same parameter. If a parameter is supplied more than once in the API request, the API only accepts the last value of that parameter. In addition, if an invalid parameter is supplied in the API request, the API ignores that parameter and returns the response corresponding to the remaining valid parameters. If no parameters are requested, all parameters are returned.

  • group_id_filter (String) (defaults to: nil)

    Deprecated. This field is deprecated and is no longer supported. Comma separated group ids (obfuscated) on which user activities are filtered, i.e. the response will contain activities for only those users that are a part of at least one of the group ids mentioned here. Format: "id:abc123,id:xyz456" * Important:* To filter by groups, you must explicitly add the groups to your filtering groups allowlist. For more information about adding groups to filtering groups allowlist, see Filter results by Google Group

  • max_results (Fixnum) (defaults to: nil)

    Determines how many activity records are shown on each response page. For example, if the request sets maxResults=1 and the report has two activities, the report has two pages. The response's nextPageToken property has the token to the second page. The maxResults query string is optional in the request. The default value is 1000.

  • org_unit_id (String) (defaults to: nil)

    Deprecated. This field is deprecated and is no longer supported. ID of the organizational unit to report on. Activity records will be shown only for users who belong to the specified organizational unit. Data before Dec 17, 2018 doesn't appear in the filtered results.

  • page_token (String) (defaults to: nil)

    The token to specify next page. A report with multiple pages has a nextPageToken property in the response. In your follow-on request getting the next page of the report, enter the nextPageToken value in the pageToken query string.

  • start_time (String) (defaults to: nil)

    Sets the beginning of the range of time shown in the report. The date is in the RFC 3339 format, for example 2010-10-28T10:26:35.000Z. The report returns all activities from startTime until endTime. The startTime must be before the endTime (if specified) and the current time when the request is made, or the API returns an error.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/google/apis/admin_reports_v1/service.rb', line 375

def watch_activity(user_key, application_name, channel_object = nil, actor_ip_address: nil, customer_id: nil, end_time: nil, event_name: nil, filters: nil, group_id_filter: nil, max_results: nil, org_unit_id: nil, page_token: nil, start_time: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch', options)
  command.request_representation = Google::Apis::AdminReportsV1::Channel::Representation
  command.request_object = channel_object
  command.response_representation = Google::Apis::AdminReportsV1::Channel::Representation
  command.response_class = Google::Apis::AdminReportsV1::Channel
  command.params['userKey'] = user_key unless user_key.nil?
  command.params['applicationName'] = application_name unless application_name.nil?
  command.query['actorIpAddress'] = actor_ip_address unless actor_ip_address.nil?
  command.query['customerId'] = customer_id unless customer_id.nil?
  command.query['endTime'] = end_time unless end_time.nil?
  command.query['eventName'] = event_name unless event_name.nil?
  command.query['filters'] = filters unless filters.nil?
  command.query['groupIdFilter'] = group_id_filter unless group_id_filter.nil?
  command.query['maxResults'] = max_results unless max_results.nil?
  command.query['orgUnitID'] = org_unit_id unless org_unit_id.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['startTime'] = start_time unless start_time.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end