How to use the ask-sdk-model.ask_sdk_model.services.service_client_response.ServiceClientResponse function in ask-sdk-model

To help you get started, we’ve selected a few ask-sdk-model examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexa / alexa-apis-for-python / ask-sdk-model / ask_sdk_model / services / lwa / lwa_client.py View on Github external
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,
github alexa / alexa-apis-for-python / ask-sdk-model / ask_sdk_model / services / lwa / lwa_client.py View on Github external
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"))
github alexa / alexa-apis-for-python / ask-sdk-model / ask_sdk_model / services / lwa / lwa_client.py View on Github external
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"))

ask-sdk-model

The ASK SDK Model package provides model definitions, for building Alexa Skills.

Apache-2.0
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis

Popular ask-sdk-model functions

Similar packages