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

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/admin_reports_v1/service.rb

Overview

Admin Reports API

Fetches reports for the administrators of G Suite customers about the usage, collaboration, security, and risk for their users.

Examples:

require 'google/apis/admin_reports_v1'

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

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeReportsService

Returns a new instance of ReportsService



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

def initialize
  super('https://www.googleapis.com/', 'admin/reports/v1/')
  @batch_path = 'batch/admin/reports_v1'
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.



39
40
41
# File 'generated/google/apis/admin_reports_v1/service.rb', line 39

def key
  @key
end

#quota_userString

Returns An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

Returns:

  • (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.



44
45
46
# File 'generated/google/apis/admin_reports_v1/service.rb', line 44

def quota_user
  @quota_user
end

#user_ipString

Returns Deprecated. Please use quotaUser instead.

Returns:

  • (String)

    Deprecated. Please use quotaUser instead.



48
49
50
# File 'generated/google/apis/admin_reports_v1/service.rb', line 48

def user_ip
  @user_ip
end

Instance Method Details

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

Retrieves a report which is a collection of properties / statistics for a specific customer.

Parameters:

  • date (String)

    Represents the date in yyyy-mm-dd format for which the data is to be fetched.

  • customer_id (String)

    Represents the customer for which the data is to be fetched.

  • page_token (String)

    Token to specify next page.

  • parameters (String)

    Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'generated/google/apis/admin_reports_v1/service.rb', line 247

def get_customer_usage_report(date, customer_id: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '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?
  command.query['userIp'] = user_ip unless user_ip.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, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::UsageReports

Retrieves a report which is a collection of properties / statistics for a set of objects.

Parameters:

  • entity_type (String)

    Type of object. Should be one of - gplus_communities.

  • entity_key (String)

    Represents the key of object for which the data should be filtered.

  • date (String)

    Represents the date in yyyy-mm-dd format for which the data is to be fetched.

  • customer_id (String)

    Represents the customer for which the data is to be fetched.

  • filters (String)

    Represents the set of filters including parameter operator value.

  • max_results (Fixnum)

    Maximum number of results to return. Maximum allowed is 1000

  • page_token (String)

    Token to specify next page.

  • parameters (String)

    Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'generated/google/apis/admin_reports_v1/service.rb', line 299

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, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

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

Retrieves a report which is a collection of properties / statistics for a set of users.

Parameters:

  • user_key (String)

    Represents the profile id or the user email for which the data should be filtered.

  • date (String)

    Represents the date in yyyy-mm-dd format for which the data is to be fetched.

  • customer_id (String)

    Represents the customer for which the data is to be fetched.

  • filters (String)

    Represents the set of filters including parameter operator value.

  • max_results (Fixnum)

    Maximum number of results to return. Maximum allowed is 1000

  • page_token (String)

    Token to specify next page.

  • parameters (String)

    Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# File 'generated/google/apis/admin_reports_v1/service.rb', line 354

def get_user_usage_report(user_key, date, customer_id: nil, filters: nil, max_results: nil, page_token: nil, parameters: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '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['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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

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

Retrieves a list of activities for a specific customer and application.

Parameters:

  • user_key (String)

    Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users.

  • application_name (String)

    Application name for which the events are to be retrieved.

  • actor_ip_address (String)

    IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.

  • customer_id (String)

    Represents the customer for which the data is to be fetched.

  • end_time (String)

    Return events which occurred at or before this time.

  • event_name (String)

    Name of the event being queried.

  • filters (String)

    Event parameters in the form [parameter1 name][operator][parameter1 value],[ parameter2 name][operator][parameter2 value],...

  • max_results (Fixnum)

    Number of activity records to be shown in each page.

  • page_token (String)

    Token to specify next page.

  • start_time (String)

    Return events which occurred at or after this time.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'generated/google/apis/admin_reports_v1/service.rb', line 99

def list_activities(user_key, application_name, actor_ip_address: nil, customer_id: nil, end_time: nil, event_name: nil, filters: nil, max_results: nil, page_token: nil, start_time: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:get, '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['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['maxResults'] = max_results unless max_results.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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end

#stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: 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)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    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:



207
208
209
210
211
212
213
214
215
# File 'generated/google/apis/admin_reports_v1/service.rb', line 207

def stop_channel(channel_object = nil, fields: nil, quota_user: nil, user_ip: 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?
  command.query['userIp'] = user_ip unless user_ip.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, max_results: nil, page_token: nil, start_time: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::AdminReportsV1::Channel

Push changes to activities

Parameters:

  • user_key (String)

    Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for all users.

  • 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)

    IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses.

  • customer_id (String)

    Represents the customer for which the data is to be fetched.

  • end_time (String)

    Return events which occurred at or before this time.

  • event_name (String)

    Name of the event being queried.

  • filters (String)

    Event parameters in the form [parameter1 name][operator][parameter1 value],[ parameter2 name][operator][parameter2 value],...

  • max_results (Fixnum)

    Number of activity records to be shown in each page.

  • page_token (String)

    Token to specify next page.

  • start_time (String)

    Return events which occurred at or after this time.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    An opaque string that represents a user for quota purposes. Must not exceed 40 characters.

  • user_ip (String)

    Deprecated. Please use quotaUser instead.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'generated/google/apis/admin_reports_v1/service.rb', line 164

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, max_results: nil, page_token: nil, start_time: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
  command =  make_simple_command(:post, '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['maxResults'] = max_results unless max_results.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?
  command.query['userIp'] = user_ip unless user_ip.nil?
  execute_or_queue_command(command, &block)
end