Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
param_info = "refresh_token={}".format(
access_token_request.refresh_token)
else:
param_info = "scope={}".format(access_token_request.scope)
body_params += "&{}".format(param_info)
error_definitions = list() # type: List
error_definitions.append(ServiceClientResponse(
response_type=(
"ask_sdk_model.services.lwa.access_token_response."
"AccessTokenResponse"),
status_code=200, message="Success"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=400,
message="Bad Request"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=401,
message="Authentication failed"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=500,
message="Internal Server Error"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=503,
message="Service Unavailable"))
api_response = self.invoke(method="POST", endpoint=endpoint,
path=resource_path, path_params=path_params,
query_params=query_params,
header_params=header_params,
grant_type_param = "grant_type={}".format(self._grant_type)
client_id_param = "client_id={}".format(access_token_request.client_id)
client_secret_param = "client_secret={}".format(
access_token_request.client_secret)
body_params = "&".join(
[grant_type_param, client_id_param, client_secret_param])
if self._grant_type == self.LWA_CREDENTIALS_GRANT_TYPE:
param_info = "refresh_token={}".format(
access_token_request.refresh_token)
else:
param_info = "scope={}".format(access_token_request.scope)
body_params += "&{}".format(param_info)
error_definitions = list() # type: List
error_definitions.append(ServiceClientResponse(
response_type=(
"ask_sdk_model.services.lwa.access_token_response."
"AccessTokenResponse"),
status_code=200, message="Success"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=400,
message="Bad Request"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=401,
message="Authentication failed"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=500,
message="Internal Server Error"))
body_params = "&".join(
[grant_type_param, client_id_param, client_secret_param])
if self._grant_type == self.LWA_CREDENTIALS_GRANT_TYPE:
param_info = "refresh_token={}".format(
access_token_request.refresh_token)
else:
param_info = "scope={}".format(access_token_request.scope)
body_params += "&{}".format(param_info)
error_definitions = list() # type: List
error_definitions.append(ServiceClientResponse(
response_type=(
"ask_sdk_model.services.lwa.access_token_response."
"AccessTokenResponse"),
status_code=200, message="Success"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=400,
message="Bad Request"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=401,
message="Authentication failed"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=500,
message="Internal Server Error"))
error_definitions.append(ServiceClientResponse(
response_type="ask_sdk_model.services.lwa.error.Error",
status_code=503,
message="Service Unavailable"))