Class: GongAPI::AuditingApi
- Inherits:
-
Object
- Object
- GongAPI::AuditingApi
- Defined in:
- lib/gong_api/api/auditing_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ AuditingApi
constructor
A new instance of AuditingApi.
-
#list_logs_using_get(from_date_time, log_type, opts = {}) ⇒ LogsResponse
Retrieve logs data by type and time range (/v2/logs) List log entries that took place during a specified time range.
-
#list_logs_using_get_with_http_info(from_date_time, log_type, opts = {}) ⇒ Array<(LogsResponse, Integer, Hash)>
Retrieve logs data by type and time range (/v2/logs) List log entries that took place during a specified time range.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ AuditingApi
Returns a new instance of AuditingApi.
16 17 18 |
# File 'lib/gong_api/api/auditing_api.rb', line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
14 15 16 |
# File 'lib/gong_api/api/auditing_api.rb', line 14 def api_client @api_client end |
Instance Method Details
#list_logs_using_get(from_date_time, log_type, opts = {}) ⇒ LogsResponse
Retrieve logs data by type and time range (/v2/logs) List log entries that took place during a specified time range. When accessed through a Bearer token authorization method, this endpoint requires the scope ‘api:logs:read’.
27 28 29 30 |
# File 'lib/gong_api/api/auditing_api.rb', line 27 def list_logs_using_get(from_date_time, log_type, opts = {}) data, _status_code, _headers = list_logs_using_get_with_http_info(from_date_time, log_type, opts) data end |
#list_logs_using_get_with_http_info(from_date_time, log_type, opts = {}) ⇒ Array<(LogsResponse, Integer, Hash)>
Retrieve logs data by type and time range (/v2/logs) List log entries that took place during a specified time range. When accessed through a Bearer token authorization method, this endpoint requires the scope 'api:logs:read'.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/gong_api/api/auditing_api.rb', line 40 def list_logs_using_get_with_http_info(from_date_time, log_type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AuditingApi.list_logs_using_get ...' end # verify the required parameter 'from_date_time' is set if @api_client.config.client_side_validation && from_date_time.nil? fail ArgumentError, "Missing the required parameter 'from_date_time' when calling AuditingApi.list_logs_using_get" end # verify the required parameter 'log_type' is set if @api_client.config.client_side_validation && log_type.nil? fail ArgumentError, "Missing the required parameter 'log_type' when calling AuditingApi.list_logs_using_get" end # verify enum value if @api_client.config.client_side_validation && !['AccessLog', 'ExternallySharedCallAccess', 'ExternallySharedCallPlay', 'UserActivityLog', 'UserCallPlay'].include?(log_type) fail ArgumentError, "invalid value for 'log_type', must be one of AccessLog, ExternallySharedCallAccess, ExternallySharedCallPlay, UserActivityLog, UserCallPlay" end # resource path local_var_path = '/v2/logs' # query parameters query_params = opts[:query_params] || {} query_params[:'fromDateTime'] = from_date_time query_params[:'logType'] = log_type query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'toDateTime'] = opts[:'to_date_time'] if !opts[:'to_date_time'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'LogsResponse' auth_names = opts[:auth_names] || [] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: AuditingApi#list_logs_using_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |