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 Google Apps 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

Constructor Details

#initializeReportsService

Returns a new instance of ReportsService.



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

def initialize
  super('https://www.googleapis.com/', '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 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. Overrides userIp if both are provided.

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. Overrides userIp if both are provided.



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

def quota_user
  @quota_user
end

#user_ipString

Returns IP address of the site where the request originates. Use this if you want to enforce per-user limits.

Returns:

  • (String)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.



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

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) (defaults to: nil)

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

  • page_token (String) (defaults to: nil)

    Token to specify next page.

  • parameters (String) (defaults to: nil)

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

  • 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'generated/google/apis/admin_reports_v1/service.rb', line 256

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_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) (defaults to: nil)

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

  • filters (String) (defaults to: nil)

    Represents the set of filters including parameter operator value.

  • max_results (Fixnum) (defaults to: nil)

    Maximum number of results to return. Maximum allowed is 1000

  • page_token (String) (defaults to: nil)

    Token to specify next page.

  • parameters (String) (defaults to: nil)

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

  • 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'generated/google/apis/admin_reports_v1/service.rb', line 309

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) (defaults to: nil)

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

  • customer_id (String) (defaults to: nil)

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

  • end_time (String) (defaults to: nil)

    Return events which occured at or before this time.

  • event_name (String) (defaults to: nil)

    Name of the event being queried.

  • filters (String) (defaults to: nil)

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

  • max_results (Fixnum) (defaults to: nil)

    Number of activity records to be shown in each page.

  • page_token (String) (defaults to: nil)

    Token to specify next page.

  • start_time (String) (defaults to: nil)

    Return events which occured at or after this time.

  • 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



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

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) (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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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



214
215
216
217
218
219
220
221
222
# File 'generated/google/apis/admin_reports_v1/service.rb', line 214

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) (defaults to: nil)

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

  • customer_id (String) (defaults to: nil)

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

  • end_time (String) (defaults to: nil)

    Return events which occured at or before this time.

  • event_name (String) (defaults to: nil)

    Name of the event being queried.

  • filters (String) (defaults to: nil)

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

  • max_results (Fixnum) (defaults to: nil)

    Number of activity records to be shown in each page.

  • page_token (String) (defaults to: nil)

    Token to specify next page.

  • start_time (String) (defaults to: nil)

    Return events which occured at or after this time.

  • 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. Overrides userIp if both are provided.

  • user_ip (String) (defaults to: nil)

    IP address of the site where the request originates. Use this if you want to enforce per-user limits.

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

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'generated/google/apis/admin_reports_v1/service.rb', line 169

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