diff --git a/src/datadog_api_client/api_client.py b/src/datadog_api_client/api_client.py index d9794ede9c..fa809d9ef9 100644 --- a/src/datadog_api_client/api_client.py +++ b/src/datadog_api_client/api_client.py @@ -623,7 +623,7 @@ def __init__( settings: Dict[str, Any], params_map: Dict[str, Dict[str, Any]], headers_map: Dict[str, List[str]], - api_client: ApiClient, + api_client: "ApiClient", ): """Creates an endpoint. @@ -653,6 +653,7 @@ def __init__( :param api_client API client instance. :type api_client: ApiClient """ + # Direct attribute assignments are fastest in Python self.settings = settings self.params_map = params_map self.headers_map = headers_map @@ -778,11 +779,15 @@ def _validate_and_get_host(self, kwargs): return host def call_with_http_info(self, **kwargs): - host = self._validate_and_get_host(kwargs) + # Local variable usages improve attribute lookup time + _validate_and_get_host = self._validate_and_get_host + _gather_params = self.gather_params + _call_api = self.api_client.call_api - params = self.gather_params(kwargs) + host = _validate_and_get_host(kwargs) + params = _gather_params(kwargs) - return self.api_client.call_api( + return _call_api( self.settings["endpoint_path"], self.settings["http_method"], params["path"], diff --git a/src/datadog_api_client/v2/api/application_security_api.py b/src/datadog_api_client/v2/api/application_security_api.py index 5b2608c90e..afe75f5364 100644 --- a/src/datadog_api_client/v2/api/application_security_api.py +++ b/src/datadog_api_client/v2/api/application_security_api.py @@ -378,8 +378,7 @@ def list_application_security_waf_custom_rules( :rtype: ApplicationSecurityWafCustomRuleListResponse """ - kwargs: Dict[str, Any] = {} - return self._list_application_security_waf_custom_rules_endpoint.call_with_http_info(**kwargs) + return self._list_application_security_waf_custom_rules_endpoint.call_with_http_info() def list_application_security_waf_exclusion_filters( self,