MCPcopy Index your code
hub / github.com/kubernetes-client/python / object_hook

Method object_hook

kubernetes/base/dynamic/discovery.py:422–432  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

420 json.JSONDecoder.__init__(self, object_hook=self.object_hook, *args, **kwargs)
421
422 def object_hook(self, obj):
423 if '_type' not in obj:
424 return obj
425 _type = obj.pop('_type')
426 if _type == 'Resource':
427 return Resource(client=self.client, **obj)
428 elif _type == 'ResourceList':
429 return ResourceList(self.client, **obj)
430 elif _type == 'ResourceGroup':
431 return ResourceGroup(obj['preferred'], resources=self.object_hook(obj['resources']))
432 return obj

Callers

nothing calls this directly

Calls 3

ResourceClass · 0.85
ResourceListClass · 0.85
ResourceGroupClass · 0.85

Tested by

no test coverage detected