MCPcopy Index your code
hub / github.com/dataforseo/PythonClient / update_params_for_auth

Method update_params_for_auth

dataforseo_client/api_client.py:566–611  ·  view source on GitHub ↗

Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. :resource_path: A string r

(
        self,
        headers,
        queries,
        auth_settings,
        resource_path,
        method,
        body,
        request_auth=None
    )

Source from the content-addressed store, hash-verified

564 return content_types[0]
565
566 def update_params_for_auth(
567 self,
568 headers,
569 queries,
570 auth_settings,
571 resource_path,
572 method,
573 body,
574 request_auth=None
575 ) -> None:
576 """Updates header and query params based on authentication setting.
577
578 :param headers: Header parameters dict to be updated.
579 :param queries: Query parameters tuple list to be updated.
580 :param auth_settings: Authentication setting identifiers list.
581 :resource_path: A string representation of the HTTP request resource path.
582 :method: A string representation of the HTTP request method.
583 :body: A object representing the body of the HTTP request.
584 The object type is the return value of sanitize_for_serialization().
585 :param request_auth: if set, the provided settings will
586 override the token in the configuration.
587 """
588 if not auth_settings:
589 return
590
591 if request_auth:
592 self._apply_auth_params(
593 headers,
594 queries,
595 resource_path,
596 method,
597 body,
598 request_auth
599 )
600 else:
601 for auth in auth_settings:
602 auth_setting = self.configuration.auth_settings().get(auth)
603 if auth_setting:
604 self._apply_auth_params(
605 headers,
606 queries,
607 resource_path,
608 method,
609 body,
610 auth_setting
611 )
612
613 def _apply_auth_params(
614 self,

Callers 1

param_serializeMethod · 0.95

Calls 2

_apply_auth_paramsMethod · 0.95
auth_settingsMethod · 0.80

Tested by

no test coverage detected