(self, as_client: httpx.AsyncClient, project_number: int)
| 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 |
no test coverage detected