From d74c073ee118b019ae61b9e87b84b06ca63fc6a4 Mon Sep 17 00:00:00 2001 From: ask-pyth Date: Mon, 2 Mar 2020 19:54:57 +0000 Subject: [PATCH] Release 1.1.1. For changelog, check CHANGELOG.rst --- ask-smapi-model/CHANGELOG.rst | 9 ++ .../ask_smapi_model/__version__.py | 2 +- .../skill_management_service_client.py | 42 +++--- .../ask_smapi_model/v1/skill/__init__.py | 1 + .../v1/skill/interaction_model/__init__.py | 3 - .../catalog_value_supplier_slot.py | 114 --------------- .../has_entity_resolution_match.py | 2 +- .../inline_value_supplier.py | 4 +- .../interaction_model/is_greater_than.py | 2 +- .../is_greater_than_or_equal_to.py | 2 +- .../skill/interaction_model/is_in_duration.py | 2 +- .../v1/skill/interaction_model/is_in_set.py | 2 +- .../skill/interaction_model/is_less_than.py | 2 +- .../is_less_than_or_equal_to.py | 2 +- .../interaction_model/is_not_in_duration.py | 2 +- .../skill/interaction_model/is_not_in_set.py | 2 +- .../interaction_model/model_type/__init__.py | 1 - .../model_type/bad_request.py | 4 +- .../interaction_model/model_type/error.py | 12 +- .../model_type/slot_type_definition_output.py | 10 +- .../model_type/slot_type_entity.py | 115 --------------- .../model_type/slot_type_response.py | 4 +- .../model_type/slot_type_update_definition.py | 4 +- .../interaction_model/model_type/warning.py | 12 +- .../v1/skill/interaction_model/slot_type.py | 9 +- .../interaction_model/slot_validation.py | 40 +++--- .../v1/skill/interaction_model/type_value.py | 4 +- .../interaction_model/type_value_object.py | 4 +- .../type_version/__init__.py | 1 + .../type_version/slot_type_version_data.py | 13 +- .../slot_type_version_data_object.py | 4 +- .../type_version/slot_type_version_item.py | 4 +- .../type_version/value_supplier_object.py | 10 +- .../skill/interaction_model/value_catalog.py | 20 +-- .../interaction_model/value_catalog_slot.py | 115 --------------- .../skill/interaction_model/value_supplier.py | 7 +- .../interaction_model/value_supplier_slot.py | 135 ------------------ .../interaction_model/version/__init__.py | 1 - .../v1/skill/publication_status.py | 70 +++++++++ .../ask_smapi_model/v1/skill/skill_summary.py | 45 +++++- 40 files changed, 242 insertions(+), 595 deletions(-) delete mode 100644 ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/catalog_value_supplier_slot.py delete mode 100644 ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_entity.py rename ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/{version => type_version}/slot_type_version_data_object.py (97%) delete mode 100644 ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog_slot.py delete mode 100644 ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier_slot.py create mode 100644 ask-smapi-model/ask_smapi_model/v1/skill/publication_status.py diff --git a/ask-smapi-model/CHANGELOG.rst b/ask-smapi-model/CHANGELOG.rst index 8b6d013..e4ba1d0 100644 --- a/ask-smapi-model/CHANGELOG.rst +++ b/ask-smapi-model/CHANGELOG.rst @@ -14,3 +14,12 @@ This release contains the following changes : - Add model definitions for new `APIS related to slot type management `__. Skill developers can create slot types outside the context of a skill and use it across multiple skills. + + +1.1.1 +^^^^^ + +This release contains the following changes : + +- Updated properties for `skill response `__ in `ListSkills` API. +- Updated interaction model values for `validation rules `__. diff --git a/ask-smapi-model/ask_smapi_model/__version__.py b/ask-smapi-model/ask_smapi_model/__version__.py index fbd7662..6b9609c 100644 --- a/ask-smapi-model/ask_smapi_model/__version__.py +++ b/ask-smapi-model/ask_smapi_model/__version__.py @@ -14,7 +14,7 @@ __pip_package_name__ = 'ask-smapi-model' __description__ = 'The SMAPI SDK Model package provides model definitions for making Skill Management API calls.' __url__ = 'https://github.com/alexa/alexa-apis-for-python' -__version__ = '1.1.0' +__version__ = '1.1.1' __author__ = 'Alexa Skills Kit' __author_email__ = 'ask-sdk-dynamic@amazon.com' __license__ = 'Apache 2.0' diff --git a/ask-smapi-model/ask_smapi_model/services/skill_management/skill_management_service_client.py b/ask-smapi-model/ask_smapi_model/services/skill_management/skill_management_service_client.py index f1e2fae..ebe71a6 100644 --- a/ask-smapi-model/ask_smapi_model/services/skill_management/skill_management_service_client.py +++ b/ask-smapi-model/ask_smapi_model/services/skill_management/skill_management_service_client.py @@ -2216,7 +2216,7 @@ def create_interaction_model_slot_type_v1(self, slot_type, **kwargs): error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_response.SlotTypeResponse", status_code=200, message="Returns the generated slotTypeId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.bad_request.BadRequest", status_code=400, message="Server cannot process the request due to a client error e.g. the slot type definition is invalid.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=429, message="The operation being requested is not allowed.")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=429, message="Exceeds the permitted request limit. Throttling criteria includes total requests, per API, ClientId, and CustomerId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=500, message="Internal Server Error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=503, message="Service Unavailable.")) @@ -2240,7 +2240,7 @@ def delete_interaction_model_slot_type_v1(self, slot_type_id, **kwargs): """ Delete the slot type. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param full_response: Boolean value to check if response should contain headers and status code information. This value had to be passed through keyword arguments, by default the parameter value is set to False. @@ -2310,9 +2310,9 @@ def delete_interaction_model_slot_type_v1(self, slot_type_id, **kwargs): def get_interaction_model_slot_type_definition_v1(self, slot_type_id, **kwargs): # type: (str, **Any) -> Union[ApiResponse, BadRequest, StandardizedError, SlotTypeDefinitionOutput] """ - get the slot type definition + Get the slot type definition. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param full_response: Boolean value to check if response should contain headers and status code information. This value had to be passed through keyword arguments, by default the parameter value is set to False. @@ -2355,7 +2355,7 @@ def get_interaction_model_slot_type_definition_v1(self, slot_type_id, **kwargs): header_params.append(('Authorization', authorization_value)) error_definitions = [] # type: List - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_definition_output.SlotTypeDefinitionOutput", status_code=200, message="the slot type definition")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_definition_output.SlotTypeDefinitionOutput", status_code=200, message="The slot type definition.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.bad_request.BadRequest", status_code=400, message="The slot type cannot be retrieved due to errors listed.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=403, message="The operation being requested is not allowed.")) @@ -2382,9 +2382,9 @@ def get_interaction_model_slot_type_definition_v1(self, slot_type_id, **kwargs): def update_interaction_model_slot_type_v1(self, slot_type_id, update_request, **kwargs): # type: (str, UpdateRequest, **Any) -> Union[ApiResponse, BadRequest, StandardizedError] """ - update description and vendorGuidance string for certain version of a slot type. + Update description and vendorGuidance string for certain version of a slot type. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param update_request: (required) :type update_request: ask_smapi_model.v1.skill.interaction_model.model_type.update_request.UpdateRequest @@ -2464,7 +2464,7 @@ def get_interaction_model_slot_type_build_status_v1(self, slot_type_id, update_r """ Get the status of slot type resource and its sub-resources for a given slotTypeId. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param update_request_id: (required) The identifier for slotType version creation process :type update_request_id: str @@ -2515,12 +2515,12 @@ def get_interaction_model_slot_type_build_status_v1(self, slot_type_id, update_r header_params.append(('Authorization', authorization_value)) error_definitions = [] # type: List - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_status.SlotTypeStatus", status_code=200, message="Returns the build status and error codes for the given slotTypeId")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_status.SlotTypeStatus", status_code=200, message="Returns the build status and error codes for the given slotTypeId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.bad_request.BadRequest", status_code=400, message="Server cannot process the request due to a client error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=403, message="The operation being requested is not allowed.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=404, message="There is no slot type defined for the slotTypeId.")) - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=429, message="Exceed the permitted request limit. Throttling criteria includes total requests, per API, ClientId, and CustomerId.")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=429, message="Exceeds the permitted request limit. Throttling criteria includes total requests, per API, ClientId, and CustomerId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=500, message="Internal Server Error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=503, message="Service Unavailable.")) @@ -2544,7 +2544,7 @@ def list_interaction_model_slot_type_versions_v1(self, slot_type_id, **kwargs): """ List all slot type versions for the slot type id. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param max_results: Sets the maximum number of results returned in the response body. If you want to retrieve fewer than upper limit of 50 results, you can add this parameter to your request. maxResults should not exceed the upper limit. The response might contain fewer results than maxResults, but it will never contain more. If there are additional results that satisfy the search criteria, but these results were not returned, the response contains isTruncated = true. :type max_results: float @@ -2627,7 +2627,7 @@ def create_interaction_model_slot_type_version_v1(self, slot_type_id, slot_type, """ Create a new version of slot type entity for the given slotTypeId. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param slot_type: (required) :type slot_type: ask_smapi_model.v1.skill.interaction_model.type_version.version_data.VersionData @@ -2707,7 +2707,7 @@ def delete_interaction_model_slot_type_version_v1(self, slot_type_id, version, * """ Delete slot type version. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param version: (required) Version for interaction model. :type version: str @@ -2787,7 +2787,7 @@ def get_interaction_model_slot_type_version_v1(self, slot_type_id, version, **kw """ Get slot type version data of given slot type version. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param version: (required) Version for interaction model. :type version: str @@ -2867,7 +2867,7 @@ def update_interaction_model_slot_type_version_v1(self, slot_type_id, version, s """ Update description and vendorGuidance string for certain version of a slot type. - :param slot_type_id: (required) The identitfier for a slot type + :param slot_type_id: (required) The identifier for a slot type. :type slot_type_id: str :param version: (required) Version for interaction model. :type version: str @@ -2930,7 +2930,7 @@ def update_interaction_model_slot_type_version_v1(self, slot_type_id, version, s error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.model_type.bad_request.BadRequest", status_code=400, message="Server cannot process the request due to a client error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=403, message="The operation being requested is not allowed.")) - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=404, message="There is no slot type defined for the slotTypeId")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=404, message="There is no slot type defined for the slotTypeId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=429, message="Exceeds the permitted request limit. Throttling criteria includes total requests, per API, ClientId, and CustomerId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=500, message="Internal Server Error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=503, message="Service Unavailable.")) @@ -6193,7 +6193,7 @@ def get_interaction_model_v1(self, skill_id, stage_v2, locale, **kwargs): header_params.append(('Authorization', authorization_value)) error_definitions = [] # type: List - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.interaction_model_data.InteractionModelData", status_code=200, message="Returns interaction model object on success")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.interaction_model.interaction_model_data.InteractionModelData", status_code=200, message="Returns interaction model object on success.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=400, message="Server cannot process the request due to a client error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=403, message="The operation being requested is not allowed.")) @@ -6220,7 +6220,7 @@ def get_interaction_model_v1(self, skill_id, stage_v2, locale, **kwargs): def get_interaction_model_metadata_v1(self, skill_id, stage_v2, locale, **kwargs): # type: (str, str, str, **Any) -> Union[ApiResponse, StandardizedError, BadRequestError] """ - Get the latest metadata for the interaction model resource for the given stage + Get the latest metadata for the interaction model resource for the given stage. :param skill_id: (required) The skill ID. :type skill_id: str @@ -6281,7 +6281,7 @@ def get_interaction_model_metadata_v1(self, skill_id, stage_v2, locale, **kwargs header_params.append(('Authorization', authorization_value)) error_definitions = [] # type: List - error_definitions.append(ServiceClientResponse(response_type=None, status_code=204, message="success. There is no content but returns etag")) + error_definitions.append(ServiceClientResponse(response_type=None, status_code=204, message="Success. There is no content but returns etag.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=400, message="Server cannot process the request due to a client error.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=403, message="The operation being requested is not allowed.")) @@ -6382,10 +6382,10 @@ def set_interaction_model_v1(self, skill_id, stage_v2, locale, interaction_model error_definitions = [] # type: List error_definitions.append(ServiceClientResponse(response_type=None, status_code=202, message="Returns build status location link on success.")) - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=400, message="Server cannot process the request due to a client error e.g. the input interaction model is invalid")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=400, message="Server cannot process the request due to a client error e.g. the input interaction model is invalid.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=401, message="The auth token is invalid/expired or doesn't have access to the resource.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.bad_request_error.BadRequestError", status_code=403, message="The operation being requested is not allowed.")) - error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=404, message="The specified skill or stage or locale does not exist")) + error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=404, message="The specified skill or stage or locale does not exist.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=412, message="Precondition failed.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=429, message="Exceeds the permitted request limit. Throttling criteria includes total requests, per API, ClientId, and CustomerId.")) error_definitions.append(ServiceClientResponse(response_type="ask_smapi_model.v1.skill.standardized_error.StandardizedError", status_code=500, message="Internal Server Error.")) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/__init__.py b/ask-smapi-model/ask_smapi_model/v1/skill/__init__.py index b2c2b8d..1c2b77a 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/__init__.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/__init__.py @@ -24,6 +24,7 @@ from .ssl_certificate_payload import SSLCertificatePayload from .build_step import BuildStep from .interface_intent import InterfaceIntent +from .publication_status import PublicationStatus from .interface_definition import InterfaceDefinition from .standardized_error import StandardizedError from .validation_details import ValidationDetails diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/__init__.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/__init__.py index e4faa05..fee4e76 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/__init__.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/__init__.py @@ -17,14 +17,12 @@ from .dialog_prompts import DialogPrompts from .prompt_items import PromptItems from .has_entity_resolution_match import HasEntityResolutionMatch -from .value_catalog_slot import ValueCatalogSlot from .is_less_than import IsLessThan from .is_not_in_set import IsNotInSet from .dialog_intents import DialogIntents from .interaction_model_schema import InteractionModelSchema from .value_catalog import ValueCatalog from .is_greater_than import IsGreaterThan -from .catalog_value_supplier_slot import CatalogValueSupplierSlot from .is_greater_than_or_equal_to import IsGreaterThanOrEqualTo from .slot_definition import SlotDefinition from .interaction_model_data import InteractionModelData @@ -40,7 +38,6 @@ from .value_supplier import ValueSupplier from .prompt_items_type import PromptItemsType from .language_model import LanguageModel -from .value_supplier_slot import ValueSupplierSlot from .dialog_slot_items import DialogSlotItems from .dialog import Dialog from .prompt import Prompt diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/catalog_value_supplier_slot.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/catalog_value_supplier_slot.py deleted file mode 100644 index 617521d..0000000 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/catalog_value_supplier_slot.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -# -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file -# except in compliance with the License. A copy of the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for -# the specific language governing permissions and limitations under the License. -# - -import pprint -import re # noqa: F401 -import six -import typing -from enum import Enum -from ask_smapi_model.v1.skill.interaction_model.value_supplier_slot import ValueSupplierSlot - - -if typing.TYPE_CHECKING: - from typing import Dict, List, Optional, Union - from datetime import datetime - from ask_smapi_model.v1.skill.interaction_model.value_catalog_slot import ValueCatalogSlot - - -class CatalogValueSupplierSlot(ValueSupplierSlot): - """ - Supply slot values from catalog(s). - - - :param value_catalog: - :type value_catalog: (optional) ask_smapi_model.v1.skill.interaction_model.value_catalog_slot.ValueCatalogSlot - - """ - deserialized_types = { - 'object_type': 'str', - 'value_catalog': 'ask_smapi_model.v1.skill.interaction_model.value_catalog_slot.ValueCatalogSlot' - } # type: Dict - - attribute_map = { - 'object_type': 'type', - 'value_catalog': 'valueCatalog' - } # type: Dict - supports_multiple_types = False - - def __init__(self, value_catalog=None): - # type: (Optional[ValueCatalogSlot]) -> None - """Supply slot values from catalog(s). - - :param value_catalog: - :type value_catalog: (optional) ask_smapi_model.v1.skill.interaction_model.value_catalog_slot.ValueCatalogSlot - """ - self.__discriminator_value = "CatalogValueSupplier" # type: str - - self.object_type = self.__discriminator_value - super(CatalogValueSupplierSlot, self).__init__(object_type=self.__discriminator_value) - self.value_catalog = value_catalog - - def to_dict(self): - # type: () -> Dict[str, object] - """Returns the model properties as a dict""" - result = {} # type: Dict - - for attr, _ in six.iteritems(self.deserialized_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else - x.value if isinstance(x, Enum) else x, - value - )) - elif isinstance(value, Enum): - result[attr] = value.value - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else - (item[0], item[1].value) - if isinstance(item[1], Enum) else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - # type: () -> str - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - # type: () -> str - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - # type: (object) -> bool - """Returns true if both objects are equal""" - if not isinstance(other, CatalogValueSupplierSlot): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - # type: (object) -> bool - """Returns true if both objects are not equal""" - return not self == other diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/has_entity_resolution_match.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/has_entity_resolution_match.py index 2a05df3..37741a3 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/has_entity_resolution_match.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/has_entity_resolution_match.py @@ -53,7 +53,7 @@ def __init__(self, prompt=None): :param prompt: The prompt id that should be used if validation fails. :type prompt: (optional) str """ - self.__discriminator_value = "HasEntityResolutionMatch" # type: str + self.__discriminator_value = "hasEntityResolutionMatch" # type: str self.object_type = self.__discriminator_value super(HasEntityResolutionMatch, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/inline_value_supplier.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/inline_value_supplier.py index 8722be1..74f7387 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/inline_value_supplier.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/inline_value_supplier.py @@ -18,7 +18,7 @@ import six import typing from enum import Enum -from ask_smapi_model.v1.skill.interaction_model.value_supplier_slot import ValueSupplierSlot +from ask_smapi_model.v1.skill.interaction_model.value_supplier import ValueSupplier if typing.TYPE_CHECKING: @@ -27,7 +27,7 @@ from ask_smapi_model.v1.skill.interaction_model.type_value import TypeValue -class InlineValueSupplier(ValueSupplierSlot): +class InlineValueSupplier(ValueSupplier): """ Supplies inline slot type values. diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than.py index 374fd02..cc5e469 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than.py @@ -59,7 +59,7 @@ def __init__(self, prompt=None, value=None): :param value: Value to compare to. :type value: (optional) str """ - self.__discriminator_value = "IsGreaterThan" # type: str + self.__discriminator_value = "isGreaterThan" # type: str self.object_type = self.__discriminator_value super(IsGreaterThan, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than_or_equal_to.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than_or_equal_to.py index 5419917..1833874 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than_or_equal_to.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_greater_than_or_equal_to.py @@ -59,7 +59,7 @@ def __init__(self, prompt=None, value=None): :param value: Value to compare to. :type value: (optional) str """ - self.__discriminator_value = "IsGreaterThanOrEqualTo" # type: str + self.__discriminator_value = "isGreaterThanOrEqualTo" # type: str self.object_type = self.__discriminator_value super(IsGreaterThanOrEqualTo, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_duration.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_duration.py index 7c84490..4df83b7 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_duration.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_duration.py @@ -65,7 +65,7 @@ def __init__(self, prompt=None, start=None, end=None): :param end: * `AMAZON.DATE`: ISO 8601 Duration using Y, M or D components or ISO 8601 Calendar Date in YYYY-MM-DD format. * `AMAZON.TIME`: ISO 8601 Duration using H or M component or ISO 8601 24-Hour Clock Time in hh:mm format. :type end: (optional) str """ - self.__discriminator_value = "IsInDuration" # type: str + self.__discriminator_value = "isInDuration" # type: str self.object_type = self.__discriminator_value super(IsInDuration, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_set.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_set.py index 926ce9c..cc449cc 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_set.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_in_set.py @@ -59,7 +59,7 @@ def __init__(self, prompt=None, values=None): :param values: List of values to check. :type values: (optional) list[str] """ - self.__discriminator_value = "IsInSet" # type: str + self.__discriminator_value = "isInSet" # type: str self.object_type = self.__discriminator_value super(IsInSet, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than.py index e24fbd3..2486309 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than.py @@ -59,7 +59,7 @@ def __init__(self, prompt=None, value=None): :param value: Value to compare to. :type value: (optional) str """ - self.__discriminator_value = "IsLessThan" # type: str + self.__discriminator_value = "isLessThan" # type: str self.object_type = self.__discriminator_value super(IsLessThan, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than_or_equal_to.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than_or_equal_to.py index c98c644..63adb51 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than_or_equal_to.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_less_than_or_equal_to.py @@ -59,7 +59,7 @@ def __init__(self, prompt=None, value=None): :param value: Value to compare to. :type value: (optional) str """ - self.__discriminator_value = "IsLessThanOrEqualTo" # type: str + self.__discriminator_value = "isLessThanOrEqualTo" # type: str self.object_type = self.__discriminator_value super(IsLessThanOrEqualTo, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_duration.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_duration.py index 0b2e2ad..26405c6 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_duration.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_duration.py @@ -65,7 +65,7 @@ def __init__(self, prompt=None, start=None, end=None): :param end: * `AMAZON.DATE`: ISO 8601 Duration using Y, M or D components or ISO 8601 Calendar Date in YYYY-MM-DD format. * `AMAZON.TIME`: ISO 8601 Duration using H or M component or ISO 8601 24-Hour Clock Time in hh:mm format. :type end: (optional) str """ - self.__discriminator_value = "IsNotInDuration" # type: str + self.__discriminator_value = "isNotInDuration" # type: str self.object_type = self.__discriminator_value super(IsNotInDuration, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_set.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_set.py index 7a7865c..43ab3fa 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_set.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/is_not_in_set.py @@ -59,7 +59,7 @@ def __init__(self, prompt=None, values=None): :param values: List of values to check. :type values: (optional) list[str] """ - self.__discriminator_value = "IsNotInSet" # type: str + self.__discriminator_value = "isNotInSet" # type: str self.object_type = self.__discriminator_value super(IsNotInSet, self).__init__(object_type=self.__discriminator_value, prompt=prompt) diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/__init__.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/__init__.py index 12ef7ac..796191d 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/__init__.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/__init__.py @@ -14,7 +14,6 @@ # from __future__ import absolute_import -from .slot_type_entity import SlotTypeEntity from .slot_type_response import SlotTypeResponse from .error import Error from .warning import Warning diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/bad_request.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/bad_request.py index 2d9877c..4879972 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/bad_request.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/bad_request.py @@ -29,7 +29,7 @@ class BadRequest(object): """ - The body of the bad request exception + The body of the bad request exception. :param errors: @@ -51,7 +51,7 @@ class BadRequest(object): def __init__(self, errors=None, warnings=None): # type: (Optional[List[Error]], Optional[List[Warning]]) -> None - """The body of the bad request exception + """The body of the bad request exception. :param errors: :type errors: (optional) list[ask_smapi_model.v1.skill.interaction_model.model_type.error.Error] diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/error.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/error.py index decac0e..bb77324 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/error.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/error.py @@ -27,12 +27,12 @@ class Error(object): """ - The Error which would fail requests + The error which would fail requests. - :param code: The error code + :param code: The error code. :type code: (optional) str - :param message: The error message + :param message: The error message. :type message: (optional) str """ @@ -49,11 +49,11 @@ class Error(object): def __init__(self, code=None, message=None): # type: (Optional[str], Optional[str]) -> None - """The Error which would fail requests + """The error which would fail requests. - :param code: The error code + :param code: The error code. :type code: (optional) str - :param message: The error message + :param message: The error message. :type message: (optional) str """ self.__discriminator_value = None # type: str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_definition_output.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_definition_output.py index e7e15e5..7888737 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_definition_output.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_definition_output.py @@ -23,7 +23,7 @@ if typing.TYPE_CHECKING: from typing import Dict, List, Optional, Union from datetime import datetime - from ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_entity import SlotTypeEntity + from ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_input import SlotTypeInput class SlotTypeDefinitionOutput(object): @@ -32,13 +32,13 @@ class SlotTypeDefinitionOutput(object): :param slot_type: - :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_entity.SlotTypeEntity + :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_input.SlotTypeInput :param total_versions: Total number of versions. :type total_versions: (optional) str """ deserialized_types = { - 'slot_type': 'ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_entity.SlotTypeEntity', + 'slot_type': 'ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_input.SlotTypeInput', 'total_versions': 'str' } # type: Dict @@ -49,11 +49,11 @@ class SlotTypeDefinitionOutput(object): supports_multiple_types = False def __init__(self, slot_type=None, total_versions=None): - # type: (Optional[SlotTypeEntity], Optional[str]) -> None + # type: (Optional[SlotTypeInput], Optional[str]) -> None """Slot Type request definitions. :param slot_type: - :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_entity.SlotTypeEntity + :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_input.SlotTypeInput :param total_versions: Total number of versions. :type total_versions: (optional) str """ diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_entity.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_entity.py deleted file mode 100644 index a97f39b..0000000 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_entity.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -# -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file -# except in compliance with the License. A copy of the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for -# the specific language governing permissions and limitations under the License. -# - -import pprint -import re # noqa: F401 -import six -import typing -from enum import Enum - - -if typing.TYPE_CHECKING: - from typing import Dict, List, Optional, Union - from datetime import datetime - - -class SlotTypeEntity(object): - """ - Definition for slot type entity. - - - :param name: Name of the slot type. - :type name: (optional) str - :param description: Description string about the slot type. - :type description: (optional) str - - """ - deserialized_types = { - 'name': 'str', - 'description': 'str' - } # type: Dict - - attribute_map = { - 'name': 'name', - 'description': 'description' - } # type: Dict - supports_multiple_types = False - - def __init__(self, name=None, description=None): - # type: (Optional[str], Optional[str]) -> None - """Definition for slot type entity. - - :param name: Name of the slot type. - :type name: (optional) str - :param description: Description string about the slot type. - :type description: (optional) str - """ - self.__discriminator_value = None # type: str - - self.name = name - self.description = description - - def to_dict(self): - # type: () -> Dict[str, object] - """Returns the model properties as a dict""" - result = {} # type: Dict - - for attr, _ in six.iteritems(self.deserialized_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else - x.value if isinstance(x, Enum) else x, - value - )) - elif isinstance(value, Enum): - result[attr] = value.value - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else - (item[0], item[1].value) - if isinstance(item[1], Enum) else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - # type: () -> str - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - # type: () -> str - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - # type: (object) -> bool - """Returns true if both objects are equal""" - if not isinstance(other, SlotTypeEntity): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - # type: (object) -> bool - """Returns true if both objects are not equal""" - return not self == other diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_response.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_response.py index 2e85ce1..c353aac 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_response.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_response.py @@ -28,7 +28,7 @@ class SlotTypeResponse(object): """ - SlotTypeId information. + Slot Type information. :param slot_type: @@ -46,7 +46,7 @@ class SlotTypeResponse(object): def __init__(self, slot_type=None): # type: (Optional[SlotTypeResponseEntity]) -> None - """SlotTypeId information. + """Slot Type information. :param slot_type: :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.model_type.slot_type_response_entity.SlotTypeResponseEntity diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_update_definition.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_update_definition.py index a8feec3..842a773 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_update_definition.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/slot_type_update_definition.py @@ -27,7 +27,7 @@ class SlotTypeUpdateDefinition(object): """ - Slot type update request object. + Slot type update definition object. :param description: The slot type description with a 255 character maximum. @@ -45,7 +45,7 @@ class SlotTypeUpdateDefinition(object): def __init__(self, description=None): # type: (Optional[str]) -> None - """Slot type update request object. + """Slot type update definition object. :param description: The slot type description with a 255 character maximum. :type description: (optional) str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/warning.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/warning.py index 6707da5..c3d19ce 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/warning.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/model_type/warning.py @@ -27,12 +27,12 @@ class Warning(object): """ - The warning which would not fail requests + The warning which would not fail requests. - :param code: The warning code + :param code: The warning code. :type code: (optional) str - :param message: The warning message + :param message: The warning message. :type message: (optional) str """ @@ -49,11 +49,11 @@ class Warning(object): def __init__(self, code=None, message=None): # type: (Optional[str], Optional[str]) -> None - """The warning which would not fail requests + """The warning which would not fail requests. - :param code: The warning code + :param code: The warning code. :type code: (optional) str - :param message: The warning message + :param message: The warning message. :type message: (optional) str """ self.__discriminator_value = None # type: str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_type.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_type.py index c29ce89..e12096b 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_type.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_type.py @@ -23,6 +23,7 @@ if typing.TYPE_CHECKING: from typing import Dict, List, Optional, Union from datetime import datetime + from ask_smapi_model.v1.skill.interaction_model.type_value import TypeValue from ask_smapi_model.v1.skill.interaction_model.value_supplier import ValueSupplier @@ -34,14 +35,14 @@ class SlotType(object): :param name: The name of the custom slot type. :type name: (optional) str :param values: List of expected values. Values outside the list are still returned. - :type values: (optional) list[str] + :type values: (optional) list[ask_smapi_model.v1.skill.interaction_model.type_value.TypeValue] :param value_supplier: :type value_supplier: (optional) ask_smapi_model.v1.skill.interaction_model.value_supplier.ValueSupplier """ deserialized_types = { 'name': 'str', - 'values': 'list[str]', + 'values': 'list[ask_smapi_model.v1.skill.interaction_model.type_value.TypeValue]', 'value_supplier': 'ask_smapi_model.v1.skill.interaction_model.value_supplier.ValueSupplier' } # type: Dict @@ -53,13 +54,13 @@ class SlotType(object): supports_multiple_types = False def __init__(self, name=None, values=None, value_supplier=None): - # type: (Optional[str], Optional[List[object]], Optional[ValueSupplier]) -> None + # type: (Optional[str], Optional[List[TypeValue]], Optional[ValueSupplier]) -> None """Custom slot type to define a list of possible values for a slot. Used for items that are not covered by Amazon's built-in slot types. :param name: The name of the custom slot type. :type name: (optional) str :param values: List of expected values. Values outside the list are still returned. - :type values: (optional) list[str] + :type values: (optional) list[ask_smapi_model.v1.skill.interaction_model.type_value.TypeValue] :param value_supplier: :type value_supplier: (optional) ask_smapi_model.v1.skill.interaction_model.value_supplier.ValueSupplier """ diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_validation.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_validation.py index e43e1cc..54a24be 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_validation.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/slot_validation.py @@ -31,7 +31,7 @@ class SlotValidation(object): Validation on a slot with support for prompt and confirmation. - :param object_type: The exact type of validation e.g. IsLessThan,IsGreaterThan etc. + :param object_type: The exact type of validation e.g. isLessThan,isGreaterThan etc. :type object_type: (optional) str :param prompt: The prompt id that should be used if validation fails. :type prompt: (optional) str @@ -41,23 +41,23 @@ class SlotValidation(object): This is an abstract class. Use the following mapping, to figure out the model class to be instantiated, that sets ``type`` variable. - | HasEntityResolutionMatch: :py:class:`ask_smapi_model.v1.skill.interaction_model.has_entity_resolution_match.HasEntityResolutionMatch`, + | hasEntityResolutionMatch: :py:class:`ask_smapi_model.v1.skill.interaction_model.has_entity_resolution_match.HasEntityResolutionMatch`, | - | IsLessThanOrEqualTo: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_less_than_or_equal_to.IsLessThanOrEqualTo`, + | isLessThanOrEqualTo: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_less_than_or_equal_to.IsLessThanOrEqualTo`, | - | IsInDuration: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_in_duration.IsInDuration`, + | isInDuration: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_in_duration.IsInDuration`, | - | IsLessThan: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_less_than.IsLessThan`, + | isLessThan: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_less_than.IsLessThan`, | - | IsGreaterThan: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_greater_than.IsGreaterThan`, + | isGreaterThan: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_greater_than.IsGreaterThan`, | - | IsNotInSet: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_not_in_set.IsNotInSet`, + | isNotInSet: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_not_in_set.IsNotInSet`, | - | IsNotInDuration: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_not_in_duration.IsNotInDuration`, + | isNotInDuration: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_not_in_duration.IsNotInDuration`, | - | IsGreaterThanOrEqualTo: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_greater_than_or_equal_to.IsGreaterThanOrEqualTo`, + | isGreaterThanOrEqualTo: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_greater_than_or_equal_to.IsGreaterThanOrEqualTo`, | - | IsInSet: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_in_set.IsInSet` + | isInSet: :py:class:`ask_smapi_model.v1.skill.interaction_model.is_in_set.IsInSet` """ deserialized_types = { @@ -72,15 +72,15 @@ class SlotValidation(object): supports_multiple_types = False discriminator_value_class_map = { - 'HasEntityResolutionMatch': 'ask_smapi_model.v1.skill.interaction_model.has_entity_resolution_match.HasEntityResolutionMatch', - 'IsLessThanOrEqualTo': 'ask_smapi_model.v1.skill.interaction_model.is_less_than_or_equal_to.IsLessThanOrEqualTo', - 'IsInDuration': 'ask_smapi_model.v1.skill.interaction_model.is_in_duration.IsInDuration', - 'IsLessThan': 'ask_smapi_model.v1.skill.interaction_model.is_less_than.IsLessThan', - 'IsGreaterThan': 'ask_smapi_model.v1.skill.interaction_model.is_greater_than.IsGreaterThan', - 'IsNotInSet': 'ask_smapi_model.v1.skill.interaction_model.is_not_in_set.IsNotInSet', - 'IsNotInDuration': 'ask_smapi_model.v1.skill.interaction_model.is_not_in_duration.IsNotInDuration', - 'IsGreaterThanOrEqualTo': 'ask_smapi_model.v1.skill.interaction_model.is_greater_than_or_equal_to.IsGreaterThanOrEqualTo', - 'IsInSet': 'ask_smapi_model.v1.skill.interaction_model.is_in_set.IsInSet' + 'hasEntityResolutionMatch': 'ask_smapi_model.v1.skill.interaction_model.has_entity_resolution_match.HasEntityResolutionMatch', + 'isLessThanOrEqualTo': 'ask_smapi_model.v1.skill.interaction_model.is_less_than_or_equal_to.IsLessThanOrEqualTo', + 'isInDuration': 'ask_smapi_model.v1.skill.interaction_model.is_in_duration.IsInDuration', + 'isLessThan': 'ask_smapi_model.v1.skill.interaction_model.is_less_than.IsLessThan', + 'isGreaterThan': 'ask_smapi_model.v1.skill.interaction_model.is_greater_than.IsGreaterThan', + 'isNotInSet': 'ask_smapi_model.v1.skill.interaction_model.is_not_in_set.IsNotInSet', + 'isNotInDuration': 'ask_smapi_model.v1.skill.interaction_model.is_not_in_duration.IsNotInDuration', + 'isGreaterThanOrEqualTo': 'ask_smapi_model.v1.skill.interaction_model.is_greater_than_or_equal_to.IsGreaterThanOrEqualTo', + 'isInSet': 'ask_smapi_model.v1.skill.interaction_model.is_in_set.IsInSet' } json_discriminator_key = "type" @@ -92,7 +92,7 @@ def __init__(self, object_type=None, prompt=None): # type: (Optional[str], Optional[str]) -> None """Validation on a slot with support for prompt and confirmation. - :param object_type: The exact type of validation e.g. IsLessThan,IsGreaterThan etc. + :param object_type: The exact type of validation e.g. isLessThan,isGreaterThan etc. :type object_type: (optional) str :param prompt: The prompt id that should be used if validation fails. :type prompt: (optional) str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value.py index 3b6e089..a9e538c 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value.py @@ -28,7 +28,7 @@ class TypeValue(object): """ - the value schema in type object of interaction model + The value schema in type object of interaction model. :param id: @@ -50,7 +50,7 @@ class TypeValue(object): def __init__(self, id=None, name=None): # type: (Optional[str], Optional[TypeValueObject]) -> None - """the value schema in type object of interaction model + """The value schema in type object of interaction model. :param id: :type id: (optional) str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value_object.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value_object.py index c617436..701d570 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value_object.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_value_object.py @@ -27,7 +27,7 @@ class TypeValueObject(object): """ - The object that contains individual type values + The object that contains individual type values. :param value: @@ -49,7 +49,7 @@ class TypeValueObject(object): def __init__(self, value=None, synonyms=None): # type: (Optional[str], Optional[List[object]]) -> None - """The object that contains individual type values + """The object that contains individual type values. :param value: :type value: (optional) str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/__init__.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/__init__.py index 6cc754c..f853ff4 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/__init__.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/__init__.py @@ -20,5 +20,6 @@ from .slot_type_update import SlotTypeUpdate from .slot_type_update_object import SlotTypeUpdateObject from .value_supplier_object import ValueSupplierObject +from .slot_type_version_data_object import SlotTypeVersionDataObject from .slot_type_version_item import SlotTypeVersionItem from .slot_type_version_data import SlotTypeVersionData diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data.py index a94a7cd..3087972 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data.py @@ -23,6 +23,7 @@ if typing.TYPE_CHECKING: from typing import Dict, List, Optional, Union from datetime import datetime + from ask_smapi_model.v1.skill.interaction_model.type_version.slot_type_version_data_object import SlotTypeVersionDataObject class SlotTypeVersionData(object): @@ -30,22 +31,30 @@ class SlotTypeVersionData(object): Slot Type version data with metadata. + :param slot_type: + :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.type_version.slot_type_version_data_object.SlotTypeVersionDataObject """ deserialized_types = { + 'slot_type': 'ask_smapi_model.v1.skill.interaction_model.type_version.slot_type_version_data_object.SlotTypeVersionDataObject' } # type: Dict attribute_map = { + 'slot_type': 'slotType' } # type: Dict supports_multiple_types = False - def __init__(self): - # type: () -> None + def __init__(self, slot_type=None): + # type: (Optional[SlotTypeVersionDataObject]) -> None """Slot Type version data with metadata. + :param slot_type: + :type slot_type: (optional) ask_smapi_model.v1.skill.interaction_model.type_version.slot_type_version_data_object.SlotTypeVersionDataObject """ self.__discriminator_value = None # type: str + self.slot_type = slot_type + def to_dict(self): # type: () -> Dict[str, object] """Returns the model properties as a dict""" diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/slot_type_version_data_object.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data_object.py similarity index 97% rename from ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/slot_type_version_data_object.py rename to ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data_object.py index 2cc4707..6ec8dc4 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/slot_type_version_data_object.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_data_object.py @@ -31,7 +31,7 @@ class SlotTypeVersionDataObject(object): Slot Type version fields with metadata. - :param id: slot type id associated with the slot type version + :param id: Slot type id associated with the slot type version. :type id: (optional) str :param definition: :type definition: (optional) ask_smapi_model.v1.skill.interaction_model.type_version.value_supplier_object.ValueSupplierObject @@ -60,7 +60,7 @@ def __init__(self, id=None, definition=None, description=None, version=None): # type: (Optional[str], Optional[ValueSupplierObject], Optional[str], Optional[str]) -> None """Slot Type version fields with metadata. - :param id: slot type id associated with the slot type version + :param id: Slot type id associated with the slot type version. :type id: (optional) str :param definition: :type definition: (optional) ask_smapi_model.v1.skill.interaction_model.type_version.value_supplier_object.ValueSupplierObject diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_item.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_item.py index 260ea49..bb21e20 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_item.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/slot_type_version_item.py @@ -31,7 +31,7 @@ class SlotTypeVersionItem(object): Definition for slot type entity. - :param version: version number of slot type + :param version: Version number of slot type. :type version: (optional) str :param description: Description string about the slot type version. :type description: (optional) str @@ -56,7 +56,7 @@ def __init__(self, version=None, description=None, links=None): # type: (Optional[str], Optional[str], Optional[Links]) -> None """Definition for slot type entity. - :param version: version number of slot type + :param version: Version number of slot type. :type version: (optional) str :param description: Description string about the slot type version. :type description: (optional) str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/value_supplier_object.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/value_supplier_object.py index f3d4952..252b608 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/value_supplier_object.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/type_version/value_supplier_object.py @@ -23,7 +23,7 @@ if typing.TYPE_CHECKING: from typing import Dict, List, Optional, Union from datetime import datetime - from ask_smapi_model.v1.skill.interaction_model.value_supplier_slot import ValueSupplierSlot + from ask_smapi_model.v1.skill.interaction_model.value_supplier import ValueSupplier class ValueSupplierObject(object): @@ -32,11 +32,11 @@ class ValueSupplierObject(object): :param value_supplier: - :type value_supplier: (optional) ask_smapi_model.v1.skill.interaction_model.value_supplier_slot.ValueSupplierSlot + :type value_supplier: (optional) ask_smapi_model.v1.skill.interaction_model.value_supplier.ValueSupplier """ deserialized_types = { - 'value_supplier': 'ask_smapi_model.v1.skill.interaction_model.value_supplier_slot.ValueSupplierSlot' + 'value_supplier': 'ask_smapi_model.v1.skill.interaction_model.value_supplier.ValueSupplier' } # type: Dict attribute_map = { @@ -45,11 +45,11 @@ class ValueSupplierObject(object): supports_multiple_types = False def __init__(self, value_supplier=None): - # type: (Optional[ValueSupplierSlot]) -> None + # type: (Optional[ValueSupplier]) -> None """Value supplier object for slot definition. :param value_supplier: - :type value_supplier: (optional) ask_smapi_model.v1.skill.interaction_model.value_supplier_slot.ValueSupplierSlot + :type value_supplier: (optional) ask_smapi_model.v1.skill.interaction_model.value_supplier.ValueSupplier """ self.__discriminator_value = None # type: str diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py index f7f6174..fd96597 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog.py @@ -30,35 +30,35 @@ class ValueCatalog(object): Catalog reference to provide values. - :param id: CatalogId - :type id: (optional) str - :param version: Catalog version + :param catalog_id: CatalogId. + :type catalog_id: (optional) str + :param version: Catalog version. :type version: (optional) str """ deserialized_types = { - 'id': 'str', + 'catalog_id': 'str', 'version': 'str' } # type: Dict attribute_map = { - 'id': 'id', + 'catalog_id': 'catalogId', 'version': 'version' } # type: Dict supports_multiple_types = False - def __init__(self, id=None, version=None): + def __init__(self, catalog_id=None, version=None): # type: (Optional[str], Optional[str]) -> None """Catalog reference to provide values. - :param id: CatalogId - :type id: (optional) str - :param version: Catalog version + :param catalog_id: CatalogId. + :type catalog_id: (optional) str + :param version: Catalog version. :type version: (optional) str """ self.__discriminator_value = None # type: str - self.id = id + self.catalog_id = catalog_id self.version = version def to_dict(self): diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog_slot.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog_slot.py deleted file mode 100644 index da4e289..0000000 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_catalog_slot.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -# -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file -# except in compliance with the License. A copy of the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for -# the specific language governing permissions and limitations under the License. -# - -import pprint -import re # noqa: F401 -import six -import typing -from enum import Enum - - -if typing.TYPE_CHECKING: - from typing import Dict, List, Optional, Union - from datetime import datetime - - -class ValueCatalogSlot(object): - """ - Catalog reference to provide values. - - - :param catalog_id: CatalogId - :type catalog_id: (optional) str - :param version: Catalog version - :type version: (optional) str - - """ - deserialized_types = { - 'catalog_id': 'str', - 'version': 'str' - } # type: Dict - - attribute_map = { - 'catalog_id': 'catalogId', - 'version': 'version' - } # type: Dict - supports_multiple_types = False - - def __init__(self, catalog_id=None, version=None): - # type: (Optional[str], Optional[str]) -> None - """Catalog reference to provide values. - - :param catalog_id: CatalogId - :type catalog_id: (optional) str - :param version: Catalog version - :type version: (optional) str - """ - self.__discriminator_value = None # type: str - - self.catalog_id = catalog_id - self.version = version - - def to_dict(self): - # type: () -> Dict[str, object] - """Returns the model properties as a dict""" - result = {} # type: Dict - - for attr, _ in six.iteritems(self.deserialized_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else - x.value if isinstance(x, Enum) else x, - value - )) - elif isinstance(value, Enum): - result[attr] = value.value - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else - (item[0], item[1].value) - if isinstance(item[1], Enum) else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - # type: () -> str - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - # type: () -> str - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - # type: (object) -> bool - """Returns true if both objects are equal""" - if not isinstance(other, ValueCatalogSlot): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - # type: (object) -> bool - """Returns true if both objects are not equal""" - return not self == other diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier.py index 3b91aec..cfb15e7 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier.py @@ -39,7 +39,9 @@ class ValueSupplier(object): This is an abstract class. Use the following mapping, to figure out the model class to be instantiated, that sets ``type`` variable. - | CatalogValueSupplier: :py:class:`ask_smapi_model.v1.skill.interaction_model.catalog_value_supplier.CatalogValueSupplier` + | CatalogValueSupplier: :py:class:`ask_smapi_model.v1.skill.interaction_model.catalog_value_supplier.CatalogValueSupplier`, + | + | InlineValueSupplier: :py:class:`ask_smapi_model.v1.skill.interaction_model.inline_value_supplier.InlineValueSupplier` """ deserialized_types = { @@ -52,7 +54,8 @@ class ValueSupplier(object): supports_multiple_types = False discriminator_value_class_map = { - 'CatalogValueSupplier': 'ask_smapi_model.v1.skill.interaction_model.catalog_value_supplier.CatalogValueSupplier' + 'CatalogValueSupplier': 'ask_smapi_model.v1.skill.interaction_model.catalog_value_supplier.CatalogValueSupplier', + 'InlineValueSupplier': 'ask_smapi_model.v1.skill.interaction_model.inline_value_supplier.InlineValueSupplier' } json_discriminator_key = "type" diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier_slot.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier_slot.py deleted file mode 100644 index 1149d61..0000000 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/value_supplier_slot.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding: utf-8 - -# -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file -# except in compliance with the License. A copy of the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for -# the specific language governing permissions and limitations under the License. -# - -import pprint -import re # noqa: F401 -import six -import typing -from enum import Enum -from abc import ABCMeta, abstractmethod - - -if typing.TYPE_CHECKING: - from typing import Dict, List, Optional, Union - from datetime import datetime - - -class ValueSupplierSlot(object): - """ - Supplier object to provide slot values. - - - :param object_type: The exact type of validation e.g.CatalogValueSupplier etc. - :type object_type: (optional) str - - .. note:: - - This is an abstract class. Use the following mapping, to figure out - the model class to be instantiated, that sets ``type`` variable. - - | CatalogValueSupplier: :py:class:`ask_smapi_model.v1.skill.interaction_model.catalog_value_supplier_slot.CatalogValueSupplierSlot`, - | - | InlineValueSupplier: :py:class:`ask_smapi_model.v1.skill.interaction_model.inline_value_supplier.InlineValueSupplier` - - """ - deserialized_types = { - 'object_type': 'str' - } # type: Dict - - attribute_map = { - 'object_type': 'type' - } # type: Dict - supports_multiple_types = False - - discriminator_value_class_map = { - 'CatalogValueSupplier': 'ask_smapi_model.v1.skill.interaction_model.catalog_value_supplier_slot.CatalogValueSupplierSlot', - 'InlineValueSupplier': 'ask_smapi_model.v1.skill.interaction_model.inline_value_supplier.InlineValueSupplier' - } - - json_discriminator_key = "type" - - __metaclass__ = ABCMeta - - @abstractmethod - def __init__(self, object_type=None): - # type: (Optional[str]) -> None - """Supplier object to provide slot values. - - :param object_type: The exact type of validation e.g.CatalogValueSupplier etc. - :type object_type: (optional) str - """ - self.__discriminator_value = None # type: str - - self.object_type = object_type - - @classmethod - def get_real_child_model(cls, data): - # type: (Dict[str, str]) -> Optional[str] - """Returns the real base class specified by the discriminator""" - discriminator_value = data[cls.json_discriminator_key] - return cls.discriminator_value_class_map.get(discriminator_value) - - def to_dict(self): - # type: () -> Dict[str, object] - """Returns the model properties as a dict""" - result = {} # type: Dict - - for attr, _ in six.iteritems(self.deserialized_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else - x.value if isinstance(x, Enum) else x, - value - )) - elif isinstance(value, Enum): - result[attr] = value.value - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else - (item[0], item[1].value) - if isinstance(item[1], Enum) else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - # type: () -> str - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - # type: () -> str - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - # type: (object) -> bool - """Returns true if both objects are equal""" - if not isinstance(other, ValueSupplierSlot): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - # type: (object) -> bool - """Returns true if both objects are not equal""" - return not self == other diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/__init__.py b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/__init__.py index 78b8f74..726dc90 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/__init__.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/interaction_model/version/__init__.py @@ -21,7 +21,6 @@ from .catalog_values import CatalogValues from .links import Links from .catalog_update import CatalogUpdate -from .slot_type_version_data_object import SlotTypeVersionDataObject from .catalog_version_data import CatalogVersionData from .version_items import VersionItems from .input_source import InputSource diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/publication_status.py b/ask-smapi-model/ask_smapi_model/v1/skill/publication_status.py new file mode 100644 index 0000000..86da1ff --- /dev/null +++ b/ask-smapi-model/ask_smapi_model/v1/skill/publication_status.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +# +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file +# except in compliance with the License. A copy of the License is located at +# +# http://aws.amazon.com/apache2.0/ +# +# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for +# the specific language governing permissions and limitations under the License. +# + +import pprint +import re # noqa: F401 +import six +import typing +from enum import Enum + + +if typing.TYPE_CHECKING: + from typing import Dict, List, Optional, Union + from datetime import datetime + + +class PublicationStatus(Enum): + """ + Publication status of the skill. It is associated with the skill's stage. Skill in 'development' stage can have publication status as 'DEVELOPMENT' or 'CERTIFICATION'. Skill in 'certified' stage can have publication status as 'CERTIFIED'. 'Skill in 'live' stage can have publication status as 'PUBLISHED', 'HIDDEN' or 'REMOVED'. * `DEVELOPMENT` - The skill is available only to you. If you have enabled it for testing, you can test it on devices registered to your developer account. * `CERTIFICATION` - Amazon is currently reviewing the skill for publication. During this time, you cannot edit the configuration. * `CERTIFIED` - The skill has been certified and ready to be published. Skill can be either published immediately or an future release date can be set for the skill. You cannot edit the configuration for the certified skills. To start development, make your changes on the development version. * `PUBLISHED` - The skill has been published and is available to users. You cannot edit the configuration for live skills. To start development on an updated version, make your changes on the development version instead. * `HIDDEN` - The skill has been published but is no longer available to new users for activation. Existing users can still invoke this skill. * `REMOVED` - The skill has been published but removed for use, due to Amazon's policy violation. You can update your skill and publish a new version to live to address the policy violation. + + + + Allowed enum values: [DEVELOPMENT, CERTIFICATION, CERTIFIED, PUBLISHED, HIDDEN, REMOVED] + """ + DEVELOPMENT = "DEVELOPMENT" + CERTIFICATION = "CERTIFICATION" + CERTIFIED = "CERTIFIED" + PUBLISHED = "PUBLISHED" + HIDDEN = "HIDDEN" + REMOVED = "REMOVED" + + def to_dict(self): + # type: () -> Dict[str, object] + """Returns the model properties as a dict""" + result = {self.name: self.value} + return result + + def to_str(self): + # type: () -> str + """Returns the string representation of the model""" + return pprint.pformat(self.value) + + def __repr__(self): + # type: () -> str + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + # type: (object) -> bool + """Returns true if both objects are equal""" + if not isinstance(other, PublicationStatus): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + # type: (object) -> bool + """Returns true if both objects are not equal""" + return not self == other diff --git a/ask-smapi-model/ask_smapi_model/v1/skill/skill_summary.py b/ask-smapi-model/ask_smapi_model/v1/skill/skill_summary.py index d41fcd0..6eb44e3 100644 --- a/ask-smapi-model/ask_smapi_model/v1/skill/skill_summary.py +++ b/ask-smapi-model/ask_smapi_model/v1/skill/skill_summary.py @@ -24,6 +24,8 @@ from typing import Dict, List, Optional, Union from datetime import datetime from ask_smapi_model.v1.skill.skill_summary_apis import SkillSummaryApis + from ask_smapi_model.v1.links import Links + from ask_smapi_model.v1.skill.publication_status import PublicationStatus class SkillSummary(object): @@ -35,32 +37,67 @@ class SkillSummary(object): :type skill_id: (optional) str :param apis: List of APIs currently implemented by the skill. :type apis: (optional) list[ask_smapi_model.v1.skill.skill_summary_apis.SkillSummaryApis] + :param publication_status: + :type publication_status: (optional) ask_smapi_model.v1.skill.publication_status.PublicationStatus + :param last_updated: + :type last_updated: (optional) datetime + :param name_by_locale: Name of the skill in skill locales (keys are locale names (e.g. 'en-US') whereas values are name of the skill in that locale. + :type name_by_locale: (optional) dict(str, str) + :param asin: Amazon Standard Identification Number (ASIN) is unique blocks of 10 letters and/or numbers that identify items. More info about ASIN can be found here: https://www.amazon.com/gp/seller/asin-upc-isbn-info.html ASIN is available for those skills only, that have been published, at least once. + :type asin: (optional) str + :param links: + :type links: (optional) ask_smapi_model.v1.links.Links """ deserialized_types = { 'skill_id': 'str', - 'apis': 'list[ask_smapi_model.v1.skill.skill_summary_apis.SkillSummaryApis]' + 'apis': 'list[ask_smapi_model.v1.skill.skill_summary_apis.SkillSummaryApis]', + 'publication_status': 'ask_smapi_model.v1.skill.publication_status.PublicationStatus', + 'last_updated': 'datetime', + 'name_by_locale': 'dict(str, str)', + 'asin': 'str', + 'links': 'ask_smapi_model.v1.links.Links' } # type: Dict attribute_map = { 'skill_id': 'skillId', - 'apis': 'apis' + 'apis': 'apis', + 'publication_status': 'publicationStatus', + 'last_updated': 'lastUpdated', + 'name_by_locale': 'nameByLocale', + 'asin': 'asin', + 'links': '_links' } # type: Dict supports_multiple_types = False - def __init__(self, skill_id=None, apis=None): - # type: (Optional[str], Optional[List[SkillSummaryApis]]) -> None + def __init__(self, skill_id=None, apis=None, publication_status=None, last_updated=None, name_by_locale=None, asin=None, links=None): + # type: (Optional[str], Optional[List[SkillSummaryApis]], Optional[PublicationStatus], Optional[datetime], Optional[Dict[str, object]], Optional[str], Optional[Links]) -> None """Information about the skills. :param skill_id: :type skill_id: (optional) str :param apis: List of APIs currently implemented by the skill. :type apis: (optional) list[ask_smapi_model.v1.skill.skill_summary_apis.SkillSummaryApis] + :param publication_status: + :type publication_status: (optional) ask_smapi_model.v1.skill.publication_status.PublicationStatus + :param last_updated: + :type last_updated: (optional) datetime + :param name_by_locale: Name of the skill in skill locales (keys are locale names (e.g. 'en-US') whereas values are name of the skill in that locale. + :type name_by_locale: (optional) dict(str, str) + :param asin: Amazon Standard Identification Number (ASIN) is unique blocks of 10 letters and/or numbers that identify items. More info about ASIN can be found here: https://www.amazon.com/gp/seller/asin-upc-isbn-info.html ASIN is available for those skills only, that have been published, at least once. + :type asin: (optional) str + :param links: + :type links: (optional) ask_smapi_model.v1.links.Links """ self.__discriminator_value = None # type: str self.skill_id = skill_id self.apis = apis + self.publication_status = publication_status + self.last_updated = last_updated + self.name_by_locale = name_by_locale + self.asin = asin + self.links = links def to_dict(self): # type: () -> Dict[str, object]