MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / data_as_class

Method data_as_class

github/Requester.py:692–701  ·  view source on GitHub ↗
(
        self, headers: dict[str, Any], data: dict[str, Any], data_path: list[str], klass: type[T_gh]
    )

Source from the content-addressed store, hash-verified

690 return {key: cls.paths_of_dict(val) if isinstance(val, dict) else None for key, val in d.items()}
691
692 def data_as_class(
693 self, headers: dict[str, Any], data: dict[str, Any], data_path: list[str], klass: type[T_gh]
694 ) -> T_gh:
695 for item in data_path:
696 if item not in data:
697 raise RuntimeError(f"GraphQL path {data_path} not found in data: {self.paths_of_dict(data)}")
698 data = data[item]
699 if klass.is_rest():
700 data = as_rest_api_attributes(data)
701 return klass(self, headers, data)
702
703 def graphql_query(self, query: str, variables: dict[str, Any]) -> tuple[dict[str, Any], dict[str, Any]]:
704 """

Callers 3

graphql_query_classMethod · 0.95
graphql_node_classMethod · 0.95

Calls 3

paths_of_dictMethod · 0.95
as_rest_api_attributesFunction · 0.90
is_restMethod · 0.45

Tested by

no test coverage detected