lib/selenium/webdriver/bidi/protocol/network.rb



# frozen_string_literal: true

# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

# This file is automatically generated. DO NOT EDIT!
# Regenerate with: bazel run //rb/lib/selenium/webdriver:bidi-generate

module Selenium
  module WebDriver
    class BiDi
      module Protocol
        # @api private
        # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
        class Network < Domain
          EVENTS = {
            auth_required: 'network.authRequired',
            before_request_sent: 'network.beforeRequestSent',
            fetch_error: 'network.fetchError',
            response_completed: 'network.responseCompleted',
            response_started: 'network.responseStarted'
          }.freeze

          COLLECTOR_TYPE = {
            blob: 'blob'
          }.freeze

          SAME_SITE = {
            strict: 'strict',
            lax: 'lax',
            none: 'none',
            default: 'default'
          }.freeze

          DATA_TYPE = {
            request: 'request',
            response: 'response'
          }.freeze

          INTERCEPT_PHASE = {
            before_request_sent: 'beforeRequestSent',
            response_started: 'responseStarted',
            auth_required: 'authRequired'
          }.freeze

          INITIATOR_TYPE = {
            parser: 'parser',
            script: 'script',
            preflight: 'preflight',
            other: 'other'
          }.freeze

          CONTINUE_WITH_AUTH_NO_CREDENTIALS_ACTION = {
            default: 'default',
            cancel: 'cancel'
          }.freeze

          SET_CACHE_BEHAVIOR_PARAMETERS_CACHE_BEHAVIOR = {
            default: 'default',
            bypass: 'bypass'
          }.freeze

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AuthChallenge = Serialization::Record.define(
            scheme: {wire_key: 'scheme', primitive: 'string'},
            realm: {wire_key: 'realm', primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AuthCredentials = Serialization::Record.define(
            type: {fixed: 'password'},
            username: {wire_key: 'username', primitive: 'string'},
            password: {wire_key: 'password', primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          BaseParameters = Serialization::Record.define(
            context: {wire_key: 'context', nullable: true},
            is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
            navigation: {wire_key: 'navigation', nullable: true},
            redirect_count: 'redirectCount',
            request: {wire_key: 'request', ref: 'Network::RequestData'},
            timestamp: 'timestamp',
            user_context: {wire_key: 'userContext', required: false, nullable: true},
            intercepts: {wire_key: 'intercepts', required: false, list: true}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          class BytesValue < Serialization::Union
            discriminator 'type', {string: 'string', base64: 'base64'}
            variants(
              string: 'Network::StringValue',
              base64: 'Network::Base64Value'
            )
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          StringValue = Serialization::Record.define(
            type: {fixed: 'string'},
            value: {wire_key: 'value', primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          Base64Value = Serialization::Record.define(
            type: {fixed: 'base64'},
            value: {wire_key: 'value', primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          Cookie = Serialization::Record.define(
            name: {wire_key: 'name', primitive: 'string'},
            value: {wire_key: 'value', ref: 'Network::BytesValue'},
            domain: {wire_key: 'domain', primitive: 'string'},
            path: {wire_key: 'path', primitive: 'string'},
            size: 'size',
            http_only: {wire_key: 'httpOnly', primitive: 'boolean'},
            secure: {wire_key: 'secure', primitive: 'boolean'},
            same_site: {wire_key: 'sameSite', enum: 'Network::SAME_SITE'},
            expiry: {wire_key: 'expiry', required: false},
            extensible: true
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          CookieHeader = Serialization::Record.define(
            name: {wire_key: 'name', primitive: 'string'},
            value: {wire_key: 'value', ref: 'Network::BytesValue'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          FetchTimingInfo = Serialization::Record.define(
            time_origin: {wire_key: 'timeOrigin', primitive: 'number'},
            request_time: {wire_key: 'requestTime', primitive: 'number'},
            redirect_start: {wire_key: 'redirectStart', primitive: 'number'},
            redirect_end: {wire_key: 'redirectEnd', primitive: 'number'},
            fetch_start: {wire_key: 'fetchStart', primitive: 'number'},
            dns_start: {wire_key: 'dnsStart', primitive: 'number'},
            dns_end: {wire_key: 'dnsEnd', primitive: 'number'},
            connect_start: {wire_key: 'connectStart', primitive: 'number'},
            connect_end: {wire_key: 'connectEnd', primitive: 'number'},
            tls_start: {wire_key: 'tlsStart', primitive: 'number'},
            request_start: {wire_key: 'requestStart', primitive: 'number'},
            response_start: {wire_key: 'responseStart', primitive: 'number'},
            response_end: {wire_key: 'responseEnd', primitive: 'number'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          Header = Serialization::Record.define(
            name: {wire_key: 'name', primitive: 'string'},
            value: {wire_key: 'value', ref: 'Network::BytesValue'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          Initiator = Serialization::Record.define(
            column_number: {wire_key: 'columnNumber', required: false},
            line_number: {wire_key: 'lineNumber', required: false},
            request: {wire_key: 'request', required: false},
            stack_trace: {wire_key: 'stackTrace', required: false, ref: 'Script::StackTrace'},
            type: {wire_key: 'type', required: false, enum: 'Network::INITIATOR_TYPE'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          RequestData = Serialization::Record.define(
            request: 'request',
            url: {wire_key: 'url', primitive: 'string'},
            method_: {wire_key: 'method', primitive: 'string'},
            headers: {wire_key: 'headers', ref: 'Network::Header', list: true},
            cookies: {wire_key: 'cookies', ref: 'Network::Cookie', list: true},
            headers_size: 'headersSize',
            body_size: {wire_key: 'bodySize', nullable: true},
            destination: {wire_key: 'destination', primitive: 'string'},
            initiator_type: {wire_key: 'initiatorType', nullable: true, primitive: 'string'},
            timings: {wire_key: 'timings', ref: 'Network::FetchTimingInfo'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ResponseContent = Serialization::Record.define(size: 'size')

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ResponseData = Serialization::Record.define(
            url: {wire_key: 'url', primitive: 'string'},
            protocol: {wire_key: 'protocol', primitive: 'string'},
            status: 'status',
            status_text: {wire_key: 'statusText', primitive: 'string'},
            from_cache: {wire_key: 'fromCache', primitive: 'boolean'},
            headers: {wire_key: 'headers', ref: 'Network::Header', list: true},
            mime_type: {wire_key: 'mimeType', primitive: 'string'},
            bytes_received: 'bytesReceived',
            headers_size: {wire_key: 'headersSize', nullable: true},
            body_size: {wire_key: 'bodySize', nullable: true},
            content: {wire_key: 'content', ref: 'Network::ResponseContent'},
            auth_challenges: {wire_key: 'authChallenges', required: false, ref: 'Network::AuthChallenge', list: true}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          SetCookieHeader = Serialization::Record.define(
            name: {wire_key: 'name', primitive: 'string'},
            value: {wire_key: 'value', ref: 'Network::BytesValue'},
            domain: {wire_key: 'domain', required: false, primitive: 'string'},
            http_only: {wire_key: 'httpOnly', required: false, primitive: 'boolean'},
            expiry: {wire_key: 'expiry', required: false, primitive: 'string'},
            max_age: {wire_key: 'maxAge', required: false},
            path: {wire_key: 'path', required: false, primitive: 'string'},
            same_site: {wire_key: 'sameSite', required: false, enum: 'Network::SAME_SITE'},
            secure: {wire_key: 'secure', required: false, primitive: 'boolean'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          class UrlPattern < Serialization::Union
            discriminator 'type', {pattern: 'pattern', string: 'string'}
            variants(
              pattern: 'Network::UrlPatternPattern',
              string: 'Network::UrlPatternString'
            )
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          UrlPatternPattern = Serialization::Record.define(
            type: {fixed: 'pattern'},
            protocol: {wire_key: 'protocol', required: false, primitive: 'string'},
            hostname: {wire_key: 'hostname', required: false, primitive: 'string'},
            port: {wire_key: 'port', required: false, primitive: 'string'},
            pathname: {wire_key: 'pathname', required: false, primitive: 'string'},
            search: {wire_key: 'search', required: false, primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          UrlPatternString = Serialization::Record.define(
            type: {fixed: 'string'},
            pattern: {wire_key: 'pattern', primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AddDataCollectorParameters = Serialization::Record.define(
            data_types: {wire_key: 'dataTypes', list: true, enum: 'Network::DATA_TYPE'},
            max_encoded_data_size: 'maxEncodedDataSize',
            collector_type: {wire_key: 'collectorType', required: false, enum: 'Network::COLLECTOR_TYPE'},
            contexts: {wire_key: 'contexts', required: false, list: true},
            user_contexts: {wire_key: 'userContexts', required: false, list: true}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AddDataCollectorResult = Serialization::Record.define(collector: 'collector')

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AddInterceptParameters = Serialization::Record.define(
            phases: {wire_key: 'phases', list: true, enum: 'Network::INTERCEPT_PHASE'},
            contexts: {wire_key: 'contexts', required: false, list: true},
            url_patterns: {wire_key: 'urlPatterns', required: false, ref: 'Network::UrlPattern', list: true}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AddInterceptResult = Serialization::Record.define(intercept: 'intercept')

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ContinueRequestParameters = Serialization::Record.define(
            request: 'request',
            body: {wire_key: 'body', required: false, ref: 'Network::BytesValue'},
            cookies: {wire_key: 'cookies', required: false, ref: 'Network::CookieHeader', list: true},
            headers: {wire_key: 'headers', required: false, ref: 'Network::Header', list: true},
            method_: {wire_key: 'method', required: false, primitive: 'string'},
            url: {wire_key: 'url', required: false, primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ContinueResponseParameters = Serialization::Record.define(
            request: 'request',
            cookies: {wire_key: 'cookies', required: false, ref: 'Network::SetCookieHeader', list: true},
            credentials: {wire_key: 'credentials', required: false, ref: 'Network::AuthCredentials'},
            headers: {wire_key: 'headers', required: false, ref: 'Network::Header', list: true},
            reason_phrase: {wire_key: 'reasonPhrase', required: false, primitive: 'string'},
            status_code: {wire_key: 'statusCode', required: false}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          class ContinueWithAuthParameters < Serialization::Union
            discriminator 'action', {provide_credentials: 'provideCredentials'}
            variants(
              provide_credentials: 'Network::ContinueWithAuthParameters::Credentials'
            )
            fallback 'Network::ContinueWithAuthParameters::NoCredentials'

            # @api private
            # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
            Credentials = Serialization::Record.define(
              action: {fixed: 'provideCredentials'},
              request: 'request',
              credentials: {wire_key: 'credentials', ref: 'Network::AuthCredentials'}
            )

            # @api private
            # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
            NoCredentials = Serialization::Record.define(
              request: 'request',
              action: {wire_key: 'action', enum: 'Network::CONTINUE_WITH_AUTH_NO_CREDENTIALS_ACTION'}
            )
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          DisownDataParameters = Serialization::Record.define(
            data_type: {wire_key: 'dataType', enum: 'Network::DATA_TYPE'},
            collector: 'collector',
            request: 'request'
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          FailRequestParameters = Serialization::Record.define(request: 'request')

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          GetDataParameters = Serialization::Record.define(
            data_type: {wire_key: 'dataType', enum: 'Network::DATA_TYPE'},
            collector: {wire_key: 'collector', required: false},
            disown: {wire_key: 'disown', required: false, primitive: 'boolean'},
            request: 'request'
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          GetDataResult = Serialization::Record.define(bytes: {wire_key: 'bytes', ref: 'Network::BytesValue'})

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ProvideResponseParameters = Serialization::Record.define(
            request: 'request',
            body: {wire_key: 'body', required: false, ref: 'Network::BytesValue'},
            cookies: {wire_key: 'cookies', required: false, ref: 'Network::SetCookieHeader', list: true},
            headers: {wire_key: 'headers', required: false, ref: 'Network::Header', list: true},
            reason_phrase: {wire_key: 'reasonPhrase', required: false, primitive: 'string'},
            status_code: {wire_key: 'statusCode', required: false}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          RemoveDataCollectorParameters = Serialization::Record.define(collector: 'collector')

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          RemoveInterceptParameters = Serialization::Record.define(intercept: 'intercept')

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          SetCacheBehaviorParameters = Serialization::Record.define(
            cache_behavior: {wire_key: 'cacheBehavior', enum: 'Network::SET_CACHE_BEHAVIOR_PARAMETERS_CACHE_BEHAVIOR'},
            contexts: {wire_key: 'contexts', required: false, list: true}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          SetExtraHeadersParameters = Serialization::Record.define(
            headers: {wire_key: 'headers', ref: 'Network::Header', list: true},
            contexts: {wire_key: 'contexts', required: false, list: true},
            user_contexts: {wire_key: 'userContexts', required: false, list: true}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          AuthRequiredParameters = Serialization::Record.define(
            context: {wire_key: 'context', nullable: true},
            is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
            navigation: {wire_key: 'navigation', nullable: true},
            redirect_count: 'redirectCount',
            request: {wire_key: 'request', ref: 'Network::RequestData'},
            timestamp: 'timestamp',
            user_context: {wire_key: 'userContext', required: false, nullable: true},
            intercepts: {wire_key: 'intercepts', required: false, list: true},
            response: {wire_key: 'response', ref: 'Network::ResponseData'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          BeforeRequestSentParameters = Serialization::Record.define(
            context: {wire_key: 'context', nullable: true},
            is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
            navigation: {wire_key: 'navigation', nullable: true},
            redirect_count: 'redirectCount',
            request: {wire_key: 'request', ref: 'Network::RequestData'},
            timestamp: 'timestamp',
            user_context: {wire_key: 'userContext', required: false, nullable: true},
            intercepts: {wire_key: 'intercepts', required: false, list: true},
            initiator: {wire_key: 'initiator', required: false, ref: 'Network::Initiator'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          FetchErrorParameters = Serialization::Record.define(
            context: {wire_key: 'context', nullable: true},
            is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
            navigation: {wire_key: 'navigation', nullable: true},
            redirect_count: 'redirectCount',
            request: {wire_key: 'request', ref: 'Network::RequestData'},
            timestamp: 'timestamp',
            user_context: {wire_key: 'userContext', required: false, nullable: true},
            intercepts: {wire_key: 'intercepts', required: false, list: true},
            error_text: {wire_key: 'errorText', primitive: 'string'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ResponseCompletedParameters = Serialization::Record.define(
            context: {wire_key: 'context', nullable: true},
            is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
            navigation: {wire_key: 'navigation', nullable: true},
            redirect_count: 'redirectCount',
            request: {wire_key: 'request', ref: 'Network::RequestData'},
            timestamp: 'timestamp',
            user_context: {wire_key: 'userContext', required: false, nullable: true},
            intercepts: {wire_key: 'intercepts', required: false, list: true},
            response: {wire_key: 'response', ref: 'Network::ResponseData'}
          )

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          ResponseStartedParameters = Serialization::Record.define(
            context: {wire_key: 'context', nullable: true},
            is_blocked: {wire_key: 'isBlocked', primitive: 'boolean'},
            navigation: {wire_key: 'navigation', nullable: true},
            redirect_count: 'redirectCount',
            request: {wire_key: 'request', ref: 'Network::RequestData'},
            timestamp: 'timestamp',
            user_context: {wire_key: 'userContext', required: false, nullable: true},
            intercepts: {wire_key: 'intercepts', required: false, list: true},
            response: {wire_key: 'response', ref: 'Network::ResponseData'}
          )

          EVENT_TYPES = {
            'network.authRequired' => Network::AuthRequiredParameters,
            'network.beforeRequestSent' => Network::BeforeRequestSentParameters,
            'network.fetchError' => Network::FetchErrorParameters,
            'network.responseCompleted' => Network::ResponseCompletedParameters,
            'network.responseStarted' => Network::ResponseStartedParameters
          }.freeze

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def add_data_collector(
            data_types:,
            max_encoded_data_size:,
            collector_type: Serialization::UNSET,
            contexts: Serialization::UNSET,
            user_contexts: Serialization::UNSET
          )
            Serialization.validate!('dataTypes', data_types, Network::DATA_TYPE)
            Serialization.validate!('collectorType', collector_type, Network::COLLECTOR_TYPE)
            params = AddDataCollectorParameters.new(
              data_types: data_types,
              max_encoded_data_size: max_encoded_data_size,
              collector_type: collector_type,
              contexts: contexts,
              user_contexts: user_contexts
            )
            execute(cmd: 'network.addDataCollector', params: params, result: Network::AddDataCollectorResult)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def add_intercept(phases:, contexts: Serialization::UNSET, url_patterns: Serialization::UNSET)
            Serialization.validate!('phases', phases, Network::INTERCEPT_PHASE)
            params = AddInterceptParameters.new(phases: phases, contexts: contexts, url_patterns: url_patterns)
            execute(cmd: 'network.addIntercept', params: params, result: Network::AddInterceptResult)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def continue_request(
            request:,
            body: Serialization::UNSET,
            cookies: Serialization::UNSET,
            headers: Serialization::UNSET,
            method_: Serialization::UNSET,
            url: Serialization::UNSET
          )
            params = ContinueRequestParameters.new(
              request: request,
              body: body,
              cookies: cookies,
              headers: headers,
              method_: method_,
              url: url
            )
            execute(cmd: 'network.continueRequest', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def continue_response(
            request:,
            cookies: Serialization::UNSET,
            credentials: Serialization::UNSET,
            headers: Serialization::UNSET,
            reason_phrase: Serialization::UNSET,
            status_code: Serialization::UNSET
          )
            params = ContinueResponseParameters.new(
              request: request,
              cookies: cookies,
              credentials: credentials,
              headers: headers,
              reason_phrase: reason_phrase,
              status_code: status_code
            )
            execute(cmd: 'network.continueResponse', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def continue_with_auth(request:, action:, credentials: Serialization::UNSET)
            Serialization.validate!(
              'action',
              action,
              {provide_credentials: 'provideCredentials', default: 'default', cancel: 'cancel'}
            )
            params = ContinueWithAuthParameters.build(request: request, action: action, credentials: credentials)
            execute(cmd: 'network.continueWithAuth', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def disown_data(data_type:, collector:, request:)
            Serialization.validate!('dataType', data_type, Network::DATA_TYPE)
            params = DisownDataParameters.new(data_type: data_type, collector: collector, request: request)
            execute(cmd: 'network.disownData', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def fail_request(request:)
            params = FailRequestParameters.new(request: request)
            execute(cmd: 'network.failRequest', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def get_data(data_type:, request:, collector: Serialization::UNSET, disown: Serialization::UNSET)
            Serialization.validate!('dataType', data_type, Network::DATA_TYPE)
            params = GetDataParameters.new(data_type: data_type, collector: collector, disown: disown, request: request)
            execute(cmd: 'network.getData', params: params, result: Network::GetDataResult)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def provide_response(
            request:,
            body: Serialization::UNSET,
            cookies: Serialization::UNSET,
            headers: Serialization::UNSET,
            reason_phrase: Serialization::UNSET,
            status_code: Serialization::UNSET
          )
            params = ProvideResponseParameters.new(
              request: request,
              body: body,
              cookies: cookies,
              headers: headers,
              reason_phrase: reason_phrase,
              status_code: status_code
            )
            execute(cmd: 'network.provideResponse', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def remove_data_collector(collector:)
            params = RemoveDataCollectorParameters.new(collector: collector)
            execute(cmd: 'network.removeDataCollector', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def remove_intercept(intercept:)
            params = RemoveInterceptParameters.new(intercept: intercept)
            execute(cmd: 'network.removeIntercept', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def set_cache_behavior(cache_behavior:, contexts: Serialization::UNSET)
            Serialization.validate!(
              'cacheBehavior',
              cache_behavior,
              Network::SET_CACHE_BEHAVIOR_PARAMETERS_CACHE_BEHAVIOR
            )
            params = SetCacheBehaviorParameters.new(cache_behavior: cache_behavior, contexts: contexts)
            execute(cmd: 'network.setCacheBehavior', params: params)
          end

          # @api private
          # @see https://www.selenium.dev/documentation/warnings/bidi-implementation/
          def set_extra_headers(headers:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
            params = SetExtraHeadersParameters.new(headers: headers, contexts: contexts, user_contexts: user_contexts)
            execute(cmd: 'network.setExtraHeaders', params: params)
          end
        end # Network
      end # Protocol
    end # BiDi
  end # WebDriver
end # Selenium