MCPcopy
hub / github.com/mxrch/GHunt / get_brand

Method get_brand

ghunt/apis/clientauthconfig.py:33–57  ·  view source on GitHub ↗
(self, as_client: httpx.AsyncClient, project_number: int)

Source from the content-addressed store, hash-verified

31 self._load_api(creds, headers)
32
33 async def get_brand(self, as_client: httpx.AsyncClient, project_number: int) -> Tuple[bool, CacBrand]:
34 endpoint_name = inspect.currentframe().f_code.co_name
35
36 verb = "GET"
37 base_url = f"/v1/brands/lookupkey/brand/{project_number}"
38 data_type = None # json, data or None
39
40 params = {
41 "readMask": "*",
42 "$outputDefaults": True
43 }
44
45 self._load_endpoint(endpoint_name)
46 req = await self._query(as_client, verb, endpoint_name, base_url, params, None, data_type)
47
48 # Parsing
49 data = json.loads(req.text)
50
51 brand = CacBrand()
52 if "error" in data:
53 return False, brand
54
55 brand._scrape(data)
56
57 return True, brand

Callers 1

huntFunction · 0.95

Calls 4

_scrapeMethod · 0.95
CacBrandClass · 0.90
_load_endpointMethod · 0.80
_queryMethod · 0.80

Tested by

no test coverage detected