Commit ecff74b0 authored by Adriana Fernández-Fernández's avatar Adriana Fernández-Fernández
Browse files

Updates models for integration with the SDK

parent bcbffd85
Loading
Loading
Loading
Loading
+24 −8
Original line number Original line Diff line number Diff line
@@ -20,23 +20,23 @@ from datetime import date, datetime # noqa: F401
from typing import List, Dict  # noqa: F401
from typing import List, Dict  # noqa: F401


from models.base_model_ import Model
from models.base_model_ import Model
from models.federation_context_idapplicationonboardingappapp_id_app_component_specs import FederationContextIdapplicationonboardingappappIdAppComponentSpecs  # noqa: F401,E501
from models.app_component_specs import AppComponentSpecs  # noqa: F401,E501
from models.federation_context_idapplicationonboardingappapp_id_app_upd_qo_s_profile import FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile  # noqa: F401,E501
from models.federation_context_idapplicationonboardingappapp_id_app_upd_qo_s_profile import FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile  # noqa: F401,E501
import util
import util




class AppAppIdBody(Model):
class AppAppIdBody(Model):
    def __init__(self, app_upd_qo_s_profile: FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile=None, app_component_specs: List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]=None):  # noqa: E501
    def __init__(self, app_upd_qo_s_profile: FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile=None, app_component_specs: AppComponentSpecs=None):  # noqa: E501
        """AppAppIdBody - a model defined in Swagger
        """AppAppIdBody - a model defined in Swagger


        :param app_upd_qo_s_profile: The app_upd_qo_s_profile of this AppAppIdBody.  # noqa: E501
        :param app_upd_qo_s_profile: The app_upd_qo_s_profile of this AppAppIdBody.  # noqa: E501
        :type app_upd_qo_s_profile: FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile
        :type app_upd_qo_s_profile: FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile
        :param app_component_specs: The app_component_specs of this AppAppIdBody.  # noqa: E501
        :param app_component_specs: The app_component_specs of this AppAppIdBody.  # noqa: E501
        :type app_component_specs: List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]
        :type app_component_specs: AppComponentSpecs
        """
        """
        self.swagger_types = {
        self.swagger_types = {
            'app_upd_qo_s_profile': FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile,
            'app_upd_qo_s_profile': FederationContextIdapplicationonboardingappappIdAppUpdQoSProfile,
            'app_component_specs': List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]
            'app_component_specs': AppComponentSpecs
        }
        }


        self.attribute_map = {
        self.attribute_map = {
@@ -79,24 +79,40 @@ class AppAppIdBody(Model):
        self._app_upd_qo_s_profile = app_upd_qo_s_profile
        self._app_upd_qo_s_profile = app_upd_qo_s_profile


    @property
    @property
    def app_component_specs(self) -> List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]:
    def app_component_specs(self) -> AppComponentSpecs:
        """Gets the app_component_specs of this AppAppIdBody.
        """Gets the app_component_specs of this AppAppIdBody.


        An application may consist of more than one component. Each component is associated with a descriptor and may exposes its services externally or internally.  App providers are required to provide details about all these components, their associated descriptors and their DNS names.  # noqa: E501
        An application may consist of more than one component. Each component is associated with a descriptor and may exposes its services externally or internally.  App providers are required to provide details about all these components, their associated descriptors and their DNS names.  # noqa: E501


        :return: The app_component_specs of this AppAppIdBody.
        :return: The app_component_specs of this AppAppIdBody.
        :rtype: List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]
        :rtype: AppComponentSpecs
        """
        """
        return self._app_component_specs
        return self._app_component_specs


    @app_component_specs.setter
    @app_component_specs.setter
    def app_component_specs(self, app_component_specs: List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]):
    def app_component_specs(self, app_component_specs: AppComponentSpecs):
        """Sets the app_component_specs of this AppAppIdBody.
        """Sets the app_component_specs of this AppAppIdBody.


        An application may consist of more than one component. Each component is associated with a descriptor and may exposes its services externally or internally.  App providers are required to provide details about all these components, their associated descriptors and their DNS names.  # noqa: E501
        An application may consist of more than one component. Each component is associated with a descriptor and may exposes its services externally or internally.  App providers are required to provide details about all these components, their associated descriptors and their DNS names.  # noqa: E501


        :param app_component_specs: The app_component_specs of this AppAppIdBody.
        :param app_component_specs: The app_component_specs of this AppAppIdBody.
        :type app_component_specs: List[FederationContextIdapplicationonboardingappappIdAppComponentSpecs]
        :type app_component_specs: AppComponentSpecs
        """
        """


        self._app_component_specs = app_component_specs
        self._app_component_specs = app_component_specs

    def to_gsma_input(self):
        result = {}
        for attr, gsma_key in self.attribute_map.items():
            value = getattr(self, attr, None)
            if value is None:
                continue
            if hasattr(value, "to_gsma_input"):
                result[gsma_key] = value.to_gsma_input()
            elif isinstance(value, list) and value and hasattr(value[0], "to_gsma_input"):
                result[gsma_key] = [v.to_gsma_input() for v in value]
            elif isinstance(value, (datetime, date)):
                result[gsma_key] = value.isoformat()
            else:
                result[gsma_key] = value
        return result
+7 −0
Original line number Original line Diff line number Diff line
@@ -45,3 +45,10 @@ class AppComponentSpecs(Model):
        :rtype: AppComponentSpecs
        :rtype: AppComponentSpecs
        """
        """
        return util.deserialize_model(dikt, cls)
        return util.deserialize_model(dikt, cls)

    def to_gsma_input(self):
        return {
            sdk_key: getattr(self, attr)
            for attr, sdk_key in self.attribute_map.items()
            if getattr(self, attr, None) is not None
        }
+7 −0
Original line number Original line Diff line number Diff line
@@ -158,3 +158,10 @@ class AppComponentSpecsInner(Model):
            raise ValueError("Invalid value for `artefact_id`, must not be `None`")  # noqa: E501
            raise ValueError("Invalid value for `artefact_id`, must not be `None`")  # noqa: E501


        self._artefact_id = artefact_id
        self._artefact_id = artefact_id

    def to_gsma_input(self):
        return {
            sdk_key: getattr(self, attr)
            for attr, sdk_key in self.attribute_map.items()
            if getattr(self, attr, None) is not None
        }
+8 −1
Original line number Original line Diff line number Diff line
@@ -218,10 +218,17 @@ class AppMetaData(Model):
        :type category: str
        :type category: str
        """
        """
        allowed_values = ["IOT", "HEALTH_CARE", "GAMING", "VIRTUAL_REALITY", "SOCIALIZING", "SURVEILLANCE", "ENTERTAINMENT", "CONNECTIVITY", "PRODUCTIVITY", "SECURITY", "INDUSTRIAL", "EDUCATION", "OTHERS"]  # noqa: E501
        allowed_values = ["IOT", "HEALTH_CARE", "GAMING", "VIRTUAL_REALITY", "SOCIALIZING", "SURVEILLANCE", "ENTERTAINMENT", "CONNECTIVITY", "PRODUCTIVITY", "SECURITY", "INDUSTRIAL", "EDUCATION", "OTHERS"]  # noqa: E501
        if category not in allowed_values:
        if category and category not in allowed_values:
            raise ValueError(
            raise ValueError(
                "Invalid value for `category` ({0}), must be one of {1}"
                "Invalid value for `category` ({0}), must be one of {1}"
                .format(category, allowed_values)
                .format(category, allowed_values)
            )
            )


        self._category = category
        self._category = category

    def to_gsma_input(self):
        return {
            gsma_key: getattr(self, attr)
            for attr, gsma_key in self.attribute_map.items()
            if getattr(self, attr, None) is not None
        }
+7 −0
Original line number Original line Diff line number Diff line
@@ -196,3 +196,10 @@ class AppQoSProfile(Model):
        """
        """


        self._app_provisioning = app_provisioning
        self._app_provisioning = app_provisioning

    def to_gsma_input(self):
        return {
            gsma_key: getattr(self, attr)
            for attr, gsma_key in self.attribute_map.items()
            if getattr(self, attr, None) is not None
        }
Loading