Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
header_parameters['Accept-Language'] = self._serialize.header("accept_language", accept_language, 'str')
if user_agent is not None:
header_parameters['User-Agent'] = self._serialize.header("user_agent", user_agent, 'str')
if client_id is not None:
header_parameters['X-MSEdge-ClientID'] = self._serialize.header("client_id", client_id, 'str')
if client_ip is not None:
header_parameters['X-MSEdge-ClientIP'] = self._serialize.header("client_ip", client_ip, 'str')
if location is not None:
header_parameters['X-Search-Location'] = self._serialize.header("location", location, 'str')
# Construct and send request
request = self._client.get(url, query_parameters)
response = self._client.send(request, header_parameters, stream=False, **operation_config)
if response.status_code not in [200]:
raise models.ErrorResponseException(self._deserialize, response)
deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('TrendingImages', response)
if raw:
client_raw_response = ClientRawResponse(deserialized, response)
return client_raw_response
return deserialized
trending.metadata = {'url': '/images/trending'}