ghostcrawl 2.3.5 → 2.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -12
  3. data/_generated/models/arrival_body.rb +325 -0
  4. data/_generated/models/arrival_body_profile_id_member1.rb +62 -0
  5. data/_generated/models/arrival_body_referrer_shape.rb +8 -0
  6. data/_generated/models/arrival_body_session_id_member1.rb +62 -0
  7. data/_generated/models/close_popups_body.rb +264 -0
  8. data/_generated/models/close_popups_body_keep_host_member1.rb +62 -0
  9. data/_generated/models/close_popups_body_profile_id_member1.rb +62 -0
  10. data/_generated/models/models.rb +18 -0
  11. data/_generated/models/mouse_body.rb +264 -0
  12. data/_generated/models/mouse_body_ops.rb +62 -0
  13. data/_generated/models/mouse_body_profile_id_member1.rb +62 -0
  14. data/_generated/models/mouse_body_session_id_member1.rb +62 -0
  15. data/_generated/models/scrape_request.rb +6 -6
  16. data/_generated/models/scrape_request_engine.rb +1 -1
  17. data/_generated/models/session_create_request.rb +3 -3
  18. data/_generated/models/tab_visit_body.rb +285 -0
  19. data/_generated/models/tab_visit_body_profile_id_member1.rb +62 -0
  20. data/_generated/models/tab_visit_body_session_id_member1.rb +62 -0
  21. data/_generated/models/touch_body.rb +264 -0
  22. data/_generated/models/touch_body_ops.rb +62 -0
  23. data/_generated/models/touch_body_profile_id_member1.rb +62 -0
  24. data/_generated/models/touch_body_session_id_member1.rb +62 -0
  25. data/_generated/v1/cdp/frame/frame_request_builder.rb +2 -2
  26. data/_generated/v1/crawl_runs/item/with_run_item_request_builder.rb +3 -3
  27. data/_generated/v1/page/arrival/arrival.rb +0 -0
  28. data/_generated/v1/page/arrival/arrival_request_builder.rb +74 -0
  29. data/_generated/v1/page/close_popups/close_popups.rb +0 -0
  30. data/_generated/v1/page/close_popups/close_popups_request_builder.rb +74 -0
  31. data/_generated/v1/page/mouse/mouse.rb +0 -0
  32. data/_generated/v1/page/mouse/mouse_request_builder.rb +74 -0
  33. data/_generated/v1/page/page_request_builder.rb +30 -0
  34. data/_generated/v1/page/tab_visit/tab_visit.rb +0 -0
  35. data/_generated/v1/page/tab_visit/tab_visit_request_builder.rb +74 -0
  36. data/_generated/v1/page/touch/touch.rb +0 -0
  37. data/_generated/v1/page/touch/touch_request_builder.rb +74 -0
  38. data/_generated/v1/profiles/item/with_name_item_request_builder.rb +2 -2
  39. data/_generated/v1/schedules/item/runs/runs_request_builder.rb +2 -2
  40. data/_generated/v1/search/jobs/item/with_job_item_request_builder.rb +2 -2
  41. data/_generated/v1/sessions/item/takeover/takeover_request_builder.rb +2 -2
  42. data/_generated/v1/sessions/sessions_request_builder.rb +3 -3
  43. data/lib/ghostcrawl/client.rb +1001 -46
  44. data/lib/ghostcrawl/error_codes.rb +26 -25
  45. data/lib/ghostcrawl/errors.rb +35 -2
  46. data/lib/ghostcrawl/version.rb +1 -1
  47. metadata +30 -2
@@ -0,0 +1,62 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../ghostcrawl'
3
+ require_relative './models'
4
+
5
+ module GhostCrawl
6
+ module Models
7
+ class TouchBodyOps
8
+ include MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
9
+ ##
10
+ # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
11
+ @additional_data
12
+ ##
13
+ ## Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
14
+ ## @return a i_dictionary
15
+ ##
16
+ def additional_data
17
+ return @additional_data
18
+ end
19
+ ##
20
+ ## Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
21
+ ## @param value Value to set for the AdditionalData property.
22
+ ## @return a void
23
+ ##
24
+ def additional_data=(value)
25
+ @additional_data = value
26
+ end
27
+ ##
28
+ ## Instantiates a new TouchBodyOps and sets the default values.
29
+ ## @return a void
30
+ ##
31
+ def initialize()
32
+ @additional_data = Hash.new
33
+ end
34
+ ##
35
+ ## Creates a new instance of the appropriate class based on discriminator value
36
+ ## @param parse_node The parse node to use to read the discriminator value and create the object
37
+ ## @return a touch_body_ops
38
+ ##
39
+ def self.create_from_discriminator_value(parse_node)
40
+ raise StandardError, 'parse_node cannot be null' if parse_node.nil?
41
+ return TouchBodyOps.new
42
+ end
43
+ ##
44
+ ## The deserialization information for the current model
45
+ ## @return a i_dictionary
46
+ ##
47
+ def get_field_deserializers()
48
+ return {
49
+ }
50
+ end
51
+ ##
52
+ ## Serializes information the current object
53
+ ## @param writer Serialization writer to use to serialize this model
54
+ ## @return a void
55
+ ##
56
+ def serialize(writer)
57
+ raise StandardError, 'writer cannot be null' if writer.nil?
58
+ writer.write_additional_data(@additional_data)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,62 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../ghostcrawl'
3
+ require_relative './models'
4
+
5
+ module GhostCrawl
6
+ module Models
7
+ class TouchBodyProfileIdMember1
8
+ include MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
9
+ ##
10
+ # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
11
+ @additional_data
12
+ ##
13
+ ## Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
14
+ ## @return a i_dictionary
15
+ ##
16
+ def additional_data
17
+ return @additional_data
18
+ end
19
+ ##
20
+ ## Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
21
+ ## @param value Value to set for the AdditionalData property.
22
+ ## @return a void
23
+ ##
24
+ def additional_data=(value)
25
+ @additional_data = value
26
+ end
27
+ ##
28
+ ## Instantiates a new TouchBodyProfileIdMember1 and sets the default values.
29
+ ## @return a void
30
+ ##
31
+ def initialize()
32
+ @additional_data = Hash.new
33
+ end
34
+ ##
35
+ ## Creates a new instance of the appropriate class based on discriminator value
36
+ ## @param parse_node The parse node to use to read the discriminator value and create the object
37
+ ## @return a touch_body_profile_id_member1
38
+ ##
39
+ def self.create_from_discriminator_value(parse_node)
40
+ raise StandardError, 'parse_node cannot be null' if parse_node.nil?
41
+ return TouchBodyProfileIdMember1.new
42
+ end
43
+ ##
44
+ ## The deserialization information for the current model
45
+ ## @return a i_dictionary
46
+ ##
47
+ def get_field_deserializers()
48
+ return {
49
+ }
50
+ end
51
+ ##
52
+ ## Serializes information the current object
53
+ ## @param writer Serialization writer to use to serialize this model
54
+ ## @return a void
55
+ ##
56
+ def serialize(writer)
57
+ raise StandardError, 'writer cannot be null' if writer.nil?
58
+ writer.write_additional_data(@additional_data)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,62 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../ghostcrawl'
3
+ require_relative './models'
4
+
5
+ module GhostCrawl
6
+ module Models
7
+ class TouchBodySessionIdMember1
8
+ include MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
9
+ ##
10
+ # Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
11
+ @additional_data
12
+ ##
13
+ ## Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
14
+ ## @return a i_dictionary
15
+ ##
16
+ def additional_data
17
+ return @additional_data
18
+ end
19
+ ##
20
+ ## Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
21
+ ## @param value Value to set for the AdditionalData property.
22
+ ## @return a void
23
+ ##
24
+ def additional_data=(value)
25
+ @additional_data = value
26
+ end
27
+ ##
28
+ ## Instantiates a new TouchBodySessionIdMember1 and sets the default values.
29
+ ## @return a void
30
+ ##
31
+ def initialize()
32
+ @additional_data = Hash.new
33
+ end
34
+ ##
35
+ ## Creates a new instance of the appropriate class based on discriminator value
36
+ ## @param parse_node The parse node to use to read the discriminator value and create the object
37
+ ## @return a touch_body_session_id_member1
38
+ ##
39
+ def self.create_from_discriminator_value(parse_node)
40
+ raise StandardError, 'parse_node cannot be null' if parse_node.nil?
41
+ return TouchBodySessionIdMember1.new
42
+ end
43
+ ##
44
+ ## The deserialization information for the current model
45
+ ## @return a i_dictionary
46
+ ##
47
+ def get_field_deserializers()
48
+ return {
49
+ }
50
+ end
51
+ ##
52
+ ## Serializes information the current object
53
+ ## @param writer Serialization writer to use to serialize this model
54
+ ## @return a void
55
+ ##
56
+ def serialize(writer)
57
+ raise StandardError, 'writer cannot be null' if writer.nil?
58
+ writer.write_additional_data(@additional_data)
59
+ end
60
+ end
61
+ end
62
+ end
@@ -24,7 +24,7 @@ module GhostCrawl
24
24
  super(path_parameters, request_adapter, "{+baseurl}/v1/cdp/frame")
25
25
  end
26
26
  ##
27
- ## Engine-agnostic live-view frame capture (cross-engine). Returns a single base64-encoded JPEG frame of a live interactive session, using the same capture path across Chromium, Firefox, and WebKit. Gating: 1. Tenant authentication 2. Revocation check 3. 4. Session ownership (the session must belong to the authenticated organisation) Returns 200 {"format":"jpeg","data":"<base64>","engine","width","height"} on success; 403 cdp_not_enabled (tier) / cdp_revoked; 404 session_not_found; 502 frame_failed.
27
+ ## Capture a JPEG frame of a live browser session. Returns a single base64-encoded JPEG frame of a live interactive session. Gating: 1. Tenant authentication 2. Revocation check 3. 4. Session ownership (the session must belong to the authenticated organisation) Returns 200 {"format":"jpeg","data":"<base64>","engine","width","height"} on success; 403 cdp_not_enabled (tier) / cdp_revoked; 404 session_not_found; 502 frame_failed.
28
28
  ## @param body The request body
29
29
  ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
30
30
  ## @return a Fiber of binary
@@ -39,7 +39,7 @@ module GhostCrawl
39
39
  return @request_adapter.send_async(request_info, Binary, error_mapping)
40
40
  end
41
41
  ##
42
- ## Engine-agnostic live-view frame capture (cross-engine). Returns a single base64-encoded JPEG frame of a live interactive session, using the same capture path across Chromium, Firefox, and WebKit. Gating: 1. Tenant authentication 2. Revocation check 3. 4. Session ownership (the session must belong to the authenticated organisation) Returns 200 {"format":"jpeg","data":"<base64>","engine","width","height"} on success; 403 cdp_not_enabled (tier) / cdp_revoked; 404 session_not_found; 502 frame_failed.
42
+ ## Capture a JPEG frame of a live browser session. Returns a single base64-encoded JPEG frame of a live interactive session. Gating: 1. Tenant authentication 2. Revocation check 3. 4. Session ownership (the session must belong to the authenticated organisation) Returns 200 {"format":"jpeg","data":"<base64>","engine","width","height"} on success; 403 cdp_not_enabled (tier) / cdp_revoked; 404 session_not_found; 502 frame_failed.
43
43
  ## @param body The request body
44
44
  ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
45
45
  ## @return a request_information
@@ -35,7 +35,7 @@ module GhostCrawl
35
35
  super(path_parameters, request_adapter, "{+baseurl}/v1/crawl-runs/{run_id}{?timeout_s*,wait*}")
36
36
  end
37
37
  ##
38
- ## status, plus OPT-IN long-poll. Default (``wait`` absent/false): instant status snapshot, behavior unchanged. ``?wait=true&timeout_s=N``: BLOCKS event-driven (same cross-worker `` signal as start-and-wait) until the run reaches a terminal state (completed|cancelled|failed|failed_resumable) or ``timeout_s`` elapses, THEN returns the run record (results included when completed). A timeout returns the CURRENT non-terminal run as HTTP 200, a long-poll, NOT an error. ``timeout_s`` defaults to 300 and is capped at a server-configured maximum (default 600).
38
+ ## status, plus OPT-IN long-poll. Default (``wait`` absent/false): instant status snapshot, behavior unchanged. ``?wait=true&timeout_s=N``: BLOCKS (event-driven, the same completion signal start-and-wait uses) until the run reaches a terminal state (completed|cancelled|failed|failed_resumable) or ``timeout_s`` elapses, THEN returns the run record (results included when completed). A timeout returns the CURRENT non-terminal run as HTTP 200, a long-poll, NOT an error. ``timeout_s`` defaults to 300 and is capped at a server-configured maximum (default 600).
39
39
  ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
40
40
  ## @return a Fiber of binary
41
41
  ##
@@ -55,7 +55,7 @@ module GhostCrawl
55
55
  return @request_adapter.send_async(request_info, Binary, error_mapping)
56
56
  end
57
57
  ##
58
- ## status, plus OPT-IN long-poll. Default (``wait`` absent/false): instant status snapshot, behavior unchanged. ``?wait=true&timeout_s=N``: BLOCKS event-driven (same cross-worker `` signal as start-and-wait) until the run reaches a terminal state (completed|cancelled|failed|failed_resumable) or ``timeout_s`` elapses, THEN returns the run record (results included when completed). A timeout returns the CURRENT non-terminal run as HTTP 200, a long-poll, NOT an error. ``timeout_s`` defaults to 300 and is capped at a server-configured maximum (default 600).
58
+ ## status, plus OPT-IN long-poll. Default (``wait`` absent/false): instant status snapshot, behavior unchanged. ``?wait=true&timeout_s=N``: BLOCKS (event-driven, the same completion signal start-and-wait uses) until the run reaches a terminal state (completed|cancelled|failed|failed_resumable) or ``timeout_s`` elapses, THEN returns the run record (results included when completed). A timeout returns the CURRENT non-terminal run as HTTP 200, a long-poll, NOT an error. ``timeout_s`` defaults to 300 and is capped at a server-configured maximum (default 600).
59
59
  ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
60
60
  ## @return a request_information
61
61
  ##
@@ -83,7 +83,7 @@ module GhostCrawl
83
83
  end
84
84
 
85
85
  ##
86
- # status, plus OPT-IN long-poll. Default (``wait`` absent/false): instant status snapshot, behavior unchanged. ``?wait=true&timeout_s=N``: BLOCKS event-driven (same cross-worker `` signal as start-and-wait) until the run reaches a terminal state (completed|cancelled|failed|failed_resumable) or ``timeout_s`` elapses, THEN returns the run record (results included when completed). A timeout returns the CURRENT non-terminal run as HTTP 200, a long-poll, NOT an error. ``timeout_s`` defaults to 300 and is capped at a server-configured maximum (default 600).
86
+ # status, plus OPT-IN long-poll. Default (``wait`` absent/false): instant status snapshot, behavior unchanged. ``?wait=true&timeout_s=N``: BLOCKS (event-driven, the same completion signal start-and-wait uses) until the run reaches a terminal state (completed|cancelled|failed|failed_resumable) or ``timeout_s`` elapses, THEN returns the run record (results included when completed). A timeout returns the CURRENT non-terminal run as HTTP 200, a long-poll, NOT an error. ``timeout_s`` defaults to 300 and is capped at a server-configured maximum (default 600).
87
87
  class WithRunItemRequestBuilderGetQueryParameters
88
88
 
89
89
  attr_accessor :timeout_s
File without changes
@@ -0,0 +1,74 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../../../ghostcrawl'
3
+ require_relative '../../../models/arrival_body'
4
+ require_relative '../../../models/problem_details'
5
+ require_relative '../../v1'
6
+ require_relative '../page'
7
+ require_relative './arrival'
8
+
9
+ module GhostCrawl
10
+ module V1
11
+ module Page
12
+ module Arrival
13
+ ##
14
+ # Builds and executes requests for operations under #v1#page#arrival
15
+ class ArrivalRequestBuilder < MicrosoftKiotaAbstractions::BaseRequestBuilder
16
+
17
+ ##
18
+ ## Instantiates a new ArrivalRequestBuilder and sets the default values.
19
+ ## @param path_parameters Path parameters for the request
20
+ ## @param request_adapter The request adapter to use to execute the requests.
21
+ ## @return a void
22
+ ##
23
+ def initialize(path_parameters, request_adapter)
24
+ super(path_parameters, request_adapter, "{+baseurl}/v1/page/arrival")
25
+ end
26
+ ##
27
+ ## Arrive at ``dest_url`` through a native link click from ``source_url``, engine-agnostic, so document.referrer, the Referer header and Sec-Fetch-* are produced natively by the click. Both URLs are validated server-side. Tier and ownership checks mirror /v1/cdp/input.
28
+ ## @param body The request body
29
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
30
+ ## @return a Fiber of binary
31
+ ##
32
+ def post(body, request_configuration=nil)
33
+ raise StandardError, 'body cannot be null' if body.nil?
34
+ request_info = self.to_post_request_information(
35
+ body, request_configuration
36
+ )
37
+ error_mapping = Hash.new
38
+ error_mapping["422"] = lambda {|pn| GhostCrawl::Models::ProblemDetails.create_from_discriminator_value(pn) }
39
+ return @request_adapter.send_async(request_info, Binary, error_mapping)
40
+ end
41
+ ##
42
+ ## Arrive at ``dest_url`` through a native link click from ``source_url``, engine-agnostic, so document.referrer, the Referer header and Sec-Fetch-* are produced natively by the click. Both URLs are validated server-side. Tier and ownership checks mirror /v1/cdp/input.
43
+ ## @param body The request body
44
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
45
+ ## @return a request_information
46
+ ##
47
+ def to_post_request_information(body, request_configuration=nil)
48
+ raise StandardError, 'body cannot be null' if body.nil?
49
+ request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
50
+ unless request_configuration.nil?
51
+ request_info.add_headers_from_raw_object(request_configuration.headers)
52
+ request_info.add_request_options(request_configuration.options)
53
+ end
54
+ request_info.set_content_from_parsable(@request_adapter, 'application/json', body)
55
+ request_info.url_template = @url_template
56
+ request_info.path_parameters = @path_parameters
57
+ request_info.http_method = :POST
58
+ request_info.headers.try_add('Accept', 'application/json')
59
+ return request_info
60
+ end
61
+ ##
62
+ ## Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
63
+ ## @param raw_url The raw URL to use for the request builder.
64
+ ## @return a arrival_request_builder
65
+ ##
66
+ def with_url(raw_url)
67
+ raise StandardError, 'raw_url cannot be null' if raw_url.nil?
68
+ return ArrivalRequestBuilder.new(raw_url, @request_adapter)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
File without changes
@@ -0,0 +1,74 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../../../ghostcrawl'
3
+ require_relative '../../../models/close_popups_body'
4
+ require_relative '../../../models/problem_details'
5
+ require_relative '../../v1'
6
+ require_relative '../page'
7
+ require_relative './close_popups'
8
+
9
+ module GhostCrawl
10
+ module V1
11
+ module Page
12
+ module ClosePopups
13
+ ##
14
+ # Builds and executes requests for operations under #v1#page#close-popups
15
+ class ClosePopupsRequestBuilder < MicrosoftKiotaAbstractions::BaseRequestBuilder
16
+
17
+ ##
18
+ ## Instantiates a new ClosePopupsRequestBuilder and sets the default values.
19
+ ## @param path_parameters Path parameters for the request
20
+ ## @param request_adapter The request adapter to use to execute the requests.
21
+ ## @return a void
22
+ ##
23
+ def initialize(path_parameters, request_adapter)
24
+ super(path_parameters, request_adapter, "{+baseurl}/v1/page/close-popups")
25
+ end
26
+ ##
27
+ ## Close any popup tab opened on a live cloud session (engine-agnostic tab hygiene): every non-primary, off-host http page is closed while the primary page and same-host tabs are kept. Returns ``{closed: [urls], count}``. Tier and ownership checks mirror the page tools.
28
+ ## @param body The request body
29
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
30
+ ## @return a Fiber of binary
31
+ ##
32
+ def post(body, request_configuration=nil)
33
+ raise StandardError, 'body cannot be null' if body.nil?
34
+ request_info = self.to_post_request_information(
35
+ body, request_configuration
36
+ )
37
+ error_mapping = Hash.new
38
+ error_mapping["422"] = lambda {|pn| GhostCrawl::Models::ProblemDetails.create_from_discriminator_value(pn) }
39
+ return @request_adapter.send_async(request_info, Binary, error_mapping)
40
+ end
41
+ ##
42
+ ## Close any popup tab opened on a live cloud session (engine-agnostic tab hygiene): every non-primary, off-host http page is closed while the primary page and same-host tabs are kept. Returns ``{closed: [urls], count}``. Tier and ownership checks mirror the page tools.
43
+ ## @param body The request body
44
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
45
+ ## @return a request_information
46
+ ##
47
+ def to_post_request_information(body, request_configuration=nil)
48
+ raise StandardError, 'body cannot be null' if body.nil?
49
+ request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
50
+ unless request_configuration.nil?
51
+ request_info.add_headers_from_raw_object(request_configuration.headers)
52
+ request_info.add_request_options(request_configuration.options)
53
+ end
54
+ request_info.set_content_from_parsable(@request_adapter, 'application/json', body)
55
+ request_info.url_template = @url_template
56
+ request_info.path_parameters = @path_parameters
57
+ request_info.http_method = :POST
58
+ request_info.headers.try_add('Accept', 'application/json')
59
+ return request_info
60
+ end
61
+ ##
62
+ ## Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
63
+ ## @param raw_url The raw URL to use for the request builder.
64
+ ## @return a close_popups_request_builder
65
+ ##
66
+ def with_url(raw_url)
67
+ raise StandardError, 'raw_url cannot be null' if raw_url.nil?
68
+ return ClosePopupsRequestBuilder.new(raw_url, @request_adapter)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
File without changes
@@ -0,0 +1,74 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../../../ghostcrawl'
3
+ require_relative '../../../models/mouse_body'
4
+ require_relative '../../../models/problem_details'
5
+ require_relative '../../v1'
6
+ require_relative '../page'
7
+ require_relative './mouse'
8
+
9
+ module GhostCrawl
10
+ module V1
11
+ module Page
12
+ module Mouse
13
+ ##
14
+ # Builds and executes requests for operations under #v1#page#mouse
15
+ class MouseRequestBuilder < MicrosoftKiotaAbstractions::BaseRequestBuilder
16
+
17
+ ##
18
+ ## Instantiates a new MouseRequestBuilder and sets the default values.
19
+ ## @param path_parameters Path parameters for the request
20
+ ## @param request_adapter The request adapter to use to execute the requests.
21
+ ## @return a void
22
+ ##
23
+ def initialize(path_parameters, request_adapter)
24
+ super(path_parameters, request_adapter, "{+baseurl}/v1/page/mouse")
25
+ end
26
+ ##
27
+ ## Replay a mouse op-stream (move/down/up/wheel/dwell) natively on the live page of the pinned session. Engine-agnostic: every engine receives the same trusted pointer trajectory and settled click. Tier and ownership checks mirror /v1/cdp/input.
28
+ ## @param body The request body
29
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
30
+ ## @return a Fiber of binary
31
+ ##
32
+ def post(body, request_configuration=nil)
33
+ raise StandardError, 'body cannot be null' if body.nil?
34
+ request_info = self.to_post_request_information(
35
+ body, request_configuration
36
+ )
37
+ error_mapping = Hash.new
38
+ error_mapping["422"] = lambda {|pn| GhostCrawl::Models::ProblemDetails.create_from_discriminator_value(pn) }
39
+ return @request_adapter.send_async(request_info, Binary, error_mapping)
40
+ end
41
+ ##
42
+ ## Replay a mouse op-stream (move/down/up/wheel/dwell) natively on the live page of the pinned session. Engine-agnostic: every engine receives the same trusted pointer trajectory and settled click. Tier and ownership checks mirror /v1/cdp/input.
43
+ ## @param body The request body
44
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
45
+ ## @return a request_information
46
+ ##
47
+ def to_post_request_information(body, request_configuration=nil)
48
+ raise StandardError, 'body cannot be null' if body.nil?
49
+ request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
50
+ unless request_configuration.nil?
51
+ request_info.add_headers_from_raw_object(request_configuration.headers)
52
+ request_info.add_request_options(request_configuration.options)
53
+ end
54
+ request_info.set_content_from_parsable(@request_adapter, 'application/json', body)
55
+ request_info.url_template = @url_template
56
+ request_info.path_parameters = @path_parameters
57
+ request_info.http_method = :POST
58
+ request_info.headers.try_add('Accept', 'application/json')
59
+ return request_info
60
+ end
61
+ ##
62
+ ## Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
63
+ ## @param raw_url The raw URL to use for the request builder.
64
+ ## @return a mouse_request_builder
65
+ ##
66
+ def with_url(raw_url)
67
+ raise StandardError, 'raw_url cannot be null' if raw_url.nil?
68
+ return MouseRequestBuilder.new(raw_url, @request_adapter)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -1,13 +1,18 @@
1
1
  require 'microsoft_kiota_abstractions'
2
2
  require_relative '../../ghostcrawl'
3
3
  require_relative '../v1'
4
+ require_relative './arrival/arrival_request_builder'
5
+ require_relative './close_popups/close_popups_request_builder'
4
6
  require_relative './cookies/cookies_request_builder'
5
7
  require_relative './dom_snapshot/dom_snapshot_request_builder'
6
8
  require_relative './download/download_request_builder'
7
9
  require_relative './eval/eval_request_builder'
8
10
  require_relative './har/har_request_builder'
11
+ require_relative './mouse/mouse_request_builder'
9
12
  require_relative './page'
10
13
  require_relative './scroll/scroll_request_builder'
14
+ require_relative './tab_visit/tab_visit_request_builder'
15
+ require_relative './touch/touch_request_builder'
11
16
  require_relative './upload/upload_request_builder'
12
17
  require_relative './wait/wait_request_builder'
13
18
 
@@ -18,6 +23,16 @@ module GhostCrawl
18
23
  # Builds and executes requests for operations under #v1#page
19
24
  class PageRequestBuilder < MicrosoftKiotaAbstractions::BaseRequestBuilder
20
25
 
26
+ ##
27
+ # The arrival property
28
+ def arrival()
29
+ return GhostCrawl::V1::Page::Arrival::ArrivalRequestBuilder.new(@path_parameters, @request_adapter)
30
+ end
31
+ ##
32
+ # The closePopups property
33
+ def close_popups()
34
+ return GhostCrawl::V1::Page::ClosePopups::ClosePopupsRequestBuilder.new(@path_parameters, @request_adapter)
35
+ end
21
36
  ##
22
37
  # The cookies property
23
38
  def cookies()
@@ -44,11 +59,26 @@ module GhostCrawl
44
59
  return GhostCrawl::V1::Page::Har::HarRequestBuilder.new(@path_parameters, @request_adapter)
45
60
  end
46
61
  ##
62
+ # The mouse property
63
+ def mouse()
64
+ return GhostCrawl::V1::Page::Mouse::MouseRequestBuilder.new(@path_parameters, @request_adapter)
65
+ end
66
+ ##
47
67
  # The scroll property
48
68
  def scroll()
49
69
  return GhostCrawl::V1::Page::Scroll::ScrollRequestBuilder.new(@path_parameters, @request_adapter)
50
70
  end
51
71
  ##
72
+ # The tabVisit property
73
+ def tab_visit()
74
+ return GhostCrawl::V1::Page::TabVisit::TabVisitRequestBuilder.new(@path_parameters, @request_adapter)
75
+ end
76
+ ##
77
+ # The touch property
78
+ def touch()
79
+ return GhostCrawl::V1::Page::Touch::TouchRequestBuilder.new(@path_parameters, @request_adapter)
80
+ end
81
+ ##
52
82
  # The upload property
53
83
  def upload()
54
84
  return GhostCrawl::V1::Page::Upload::UploadRequestBuilder.new(@path_parameters, @request_adapter)
File without changes
@@ -0,0 +1,74 @@
1
+ require 'microsoft_kiota_abstractions'
2
+ require_relative '../../../ghostcrawl'
3
+ require_relative '../../../models/problem_details'
4
+ require_relative '../../../models/tab_visit_body'
5
+ require_relative '../../v1'
6
+ require_relative '../page'
7
+ require_relative './tab_visit'
8
+
9
+ module GhostCrawl
10
+ module V1
11
+ module Page
12
+ module TabVisit
13
+ ##
14
+ # Builds and executes requests for operations under #v1#page#tab-visit
15
+ class TabVisitRequestBuilder < MicrosoftKiotaAbstractions::BaseRequestBuilder
16
+
17
+ ##
18
+ ## Instantiates a new TabVisitRequestBuilder and sets the default values.
19
+ ## @param path_parameters Path parameters for the request
20
+ ## @param request_adapter The request adapter to use to execute the requests.
21
+ ## @return a void
22
+ ##
23
+ def initialize(path_parameters, request_adapter)
24
+ super(path_parameters, request_adapter, "{+baseurl}/v1/page/tab-visit")
25
+ end
26
+ ##
27
+ ## Visit ``url`` in a real new tab of the session's context: load it, read it briefly, then close it (the session continues on its original tab). Chrome engine only; other engines return ``unsupported``. The URL is validated server-side. Tier and ownership checks mirror /v1/cdp/input.
28
+ ## @param body The request body
29
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
30
+ ## @return a Fiber of binary
31
+ ##
32
+ def post(body, request_configuration=nil)
33
+ raise StandardError, 'body cannot be null' if body.nil?
34
+ request_info = self.to_post_request_information(
35
+ body, request_configuration
36
+ )
37
+ error_mapping = Hash.new
38
+ error_mapping["422"] = lambda {|pn| GhostCrawl::Models::ProblemDetails.create_from_discriminator_value(pn) }
39
+ return @request_adapter.send_async(request_info, Binary, error_mapping)
40
+ end
41
+ ##
42
+ ## Visit ``url`` in a real new tab of the session's context: load it, read it briefly, then close it (the session continues on its original tab). Chrome engine only; other engines return ``unsupported``. The URL is validated server-side. Tier and ownership checks mirror /v1/cdp/input.
43
+ ## @param body The request body
44
+ ## @param request_configuration Configuration for the request such as headers, query parameters, and middleware options.
45
+ ## @return a request_information
46
+ ##
47
+ def to_post_request_information(body, request_configuration=nil)
48
+ raise StandardError, 'body cannot be null' if body.nil?
49
+ request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
50
+ unless request_configuration.nil?
51
+ request_info.add_headers_from_raw_object(request_configuration.headers)
52
+ request_info.add_request_options(request_configuration.options)
53
+ end
54
+ request_info.set_content_from_parsable(@request_adapter, 'application/json', body)
55
+ request_info.url_template = @url_template
56
+ request_info.path_parameters = @path_parameters
57
+ request_info.http_method = :POST
58
+ request_info.headers.try_add('Accept', 'application/json')
59
+ return request_info
60
+ end
61
+ ##
62
+ ## Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
63
+ ## @param raw_url The raw URL to use for the request builder.
64
+ ## @return a tab_visit_request_builder
65
+ ##
66
+ def with_url(raw_url)
67
+ raise StandardError, 'raw_url cannot be null' if raw_url.nil?
68
+ return TabVisitRequestBuilder.new(raw_url, @request_adapter)
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
File without changes