From a4731af284e139f7491d8e7553463d6911b5610b Mon Sep 17 00:00:00 2001 From: Aries Date: Tue, 31 Jan 2023 15:17:50 +0900 Subject: [PATCH] fix events to csv results limit --- examples/events-to-csv.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/events-to-csv.rb b/examples/events-to-csv.rb index bdce8e1..fa260e2 100644 --- a/examples/events-to-csv.rb +++ b/examples/events-to-csv.rb @@ -52,11 +52,15 @@ end end.parse! +counter = 0 +limit = options[:limit] || 1000 + # Fetch the events client = OneLogin::Api::Client.new( client_id: 'ONELOGIN_CLIENT_ID_GOES_HERE', client_secret: 'ONELOGIN_CLIENT_SECRET_GOES_HERE', - region: 'us' + region: 'us', + max_results: limit ) attribute_names = ['id', 'created_at', 'account_id', 'user_id', 'user_name', 'event_type_id', @@ -66,9 +70,6 @@ 'operation_name', 'directory_sync_run_id', 'directory_id', 'resolution', 'client_id', 'resource_type_id', 'error_description', 'risk_score', 'risk_reasons', 'risk_cookie_id', 'browser_fingerprint'] -counter = 0 -limit = options[:limit] || 1000 - # We remove limit from options parsed to the api as we want to fetch # the max number of records possible and then use the cursor that is # built into the ruby sdk to limit the results