masstack-python-client 0.0.3__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {masstack_python_client-0.0.3/src/masstack_python_client.egg-info → masstack_python_client-0.0.4}/PKG-INFO +5 -1
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/README.md +4 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/__init__.py +1 -1
- masstack_python_client-0.0.4/src/masstack_python_client/resources/catalogue.py +110 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/__init__.py +0 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/bundled_product_category.py +12 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/commercial_segment_name.py +6 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/customer_segment_name.py +8 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/customer_type_name.py +6 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/sale_type_name.py +9 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/technology_name.py +6 -0
- masstack_python_client-0.0.4/src/masstack_python_client/resources/models/bundled.py +58 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4/src/masstack_python_client.egg-info}/PKG-INFO +5 -1
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client.egg-info/SOURCES.txt +9 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/LICENSE +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/MANIFEST.in +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/pyproject.toml +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/setup.cfg +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/auth/__init__.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/auth/token.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/auth/token_manager.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/auth/token_store.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/client.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/data/data_utils.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/data/province_translation.csv +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/data/street_type_translation.csv +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/data/unit_translation.csv +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/exceptions.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/__init__.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/customers.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/enums/document_type_search.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/feasibility.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/address.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/client_address.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/client_attribute.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/client_payment.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/products.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/signup.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/models/user.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/resources/utils/serialize.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client.egg-info/dependency_links.txt +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client.egg-info/requires.txt +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client.egg-info/top_level.txt +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/tests/test_client.py +0 -0
- {masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/tests/test_exceptions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: masstack-python-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: This Python API client provides access to masmovil core API domains
|
|
5
5
|
Author-email: Borja Gimeno <borja.gimeno@somconnexio.coop>
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -45,6 +45,10 @@ This Python API client provides access to masmovil core API domains.
|
|
|
45
45
|
- returns customer tree data associated to a given document identification, email or number of the client.
|
|
46
46
|
- returns user data by userId
|
|
47
47
|
|
|
48
|
+
* Catalogue
|
|
49
|
+
- bundled_products - access to bundled products
|
|
50
|
+
- get sellable bundled products
|
|
51
|
+
|
|
48
52
|
## Installation
|
|
49
53
|
|
|
50
54
|
```commandline
|
|
@@ -28,6 +28,10 @@ This Python API client provides access to masmovil core API domains.
|
|
|
28
28
|
- returns customer tree data associated to a given document identification, email or number of the client.
|
|
29
29
|
- returns user data by userId
|
|
30
30
|
|
|
31
|
+
* Catalogue
|
|
32
|
+
- bundled_products - access to bundled products
|
|
33
|
+
- get sellable bundled products
|
|
34
|
+
|
|
31
35
|
## Installation
|
|
32
36
|
|
|
33
37
|
```commandline
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from typing import Optional, List
|
|
2
|
+
from masstack_python_client.client import MasstackClient
|
|
3
|
+
from masstack_python_client.resources.enums.bundled_product_category import (
|
|
4
|
+
BundleCategory,
|
|
5
|
+
)
|
|
6
|
+
from masstack_python_client.resources.enums.commercial_segment_name import (
|
|
7
|
+
CommercialSegmentName,
|
|
8
|
+
)
|
|
9
|
+
from masstack_python_client.resources.enums.customer_segment_name import (
|
|
10
|
+
CustomerSegmentName,
|
|
11
|
+
)
|
|
12
|
+
from masstack_python_client.resources.enums.customer_type_name import CustomerTypeName
|
|
13
|
+
from masstack_python_client.resources.enums.sale_type_name import SaleTypeName
|
|
14
|
+
from masstack_python_client.resources.enums.technology_name import TechnologyName
|
|
15
|
+
from masstack_python_client.resources.models.bundled import BundledProduct
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class CatalogueResource:
|
|
19
|
+
"""Support sales and post-sales operations from catalogue perspective
|
|
20
|
+
https://developers.masstack.com/en/docs/apis_catalogue_doc_swagger/2/apioverview/
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
_api_domain = "catalogue"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class BundledProducts(CatalogueResource):
|
|
27
|
+
_api_path = "bundled_products"
|
|
28
|
+
_version = "v2"
|
|
29
|
+
|
|
30
|
+
@classmethod
|
|
31
|
+
def _get_endpoint(cls, subpath: str) -> str:
|
|
32
|
+
return f"{cls._api_path}/{subpath}"
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def _request(
|
|
36
|
+
cls,
|
|
37
|
+
method: str,
|
|
38
|
+
subpath: str,
|
|
39
|
+
params: Optional[dict] = None,
|
|
40
|
+
data: Optional[dict] = None,
|
|
41
|
+
) -> dict:
|
|
42
|
+
client = MasstackClient()
|
|
43
|
+
func = getattr(client, method)
|
|
44
|
+
|
|
45
|
+
return func(
|
|
46
|
+
api=cls._api_domain,
|
|
47
|
+
version=cls._version,
|
|
48
|
+
endpoint=cls._get_endpoint(subpath),
|
|
49
|
+
params=params,
|
|
50
|
+
data=data,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class Sellable(BundledProducts):
|
|
55
|
+
|
|
56
|
+
_api_subpath = "sellable"
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def get(
|
|
60
|
+
cls,
|
|
61
|
+
commercial_profile_name: Optional[str] = None,
|
|
62
|
+
technology_name: Optional[TechnologyName] = None,
|
|
63
|
+
territory_owner_id: Optional[str] = None,
|
|
64
|
+
category: Optional[BundleCategory] = None,
|
|
65
|
+
customer_segment_name: Optional[CustomerSegmentName] = None,
|
|
66
|
+
commercial_segment_name: Optional[CommercialSegmentName] = None,
|
|
67
|
+
customer_type_name: Optional[CustomerTypeName] = None,
|
|
68
|
+
sale_type_name: Optional[SaleTypeName] = None,
|
|
69
|
+
) -> List[BundledProduct]:
|
|
70
|
+
"""Returns an array of sellable bundled products based on input criteria,
|
|
71
|
+
including the mandatory bundled commercial products for each bundled product.
|
|
72
|
+
Provides details for each bundled commercial product about the marketing name.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
commercial_profile_name (str): commercial profile name
|
|
76
|
+
technology_name (TechnologyName): technology name
|
|
77
|
+
territory_owner_id (str): territory owner identifier
|
|
78
|
+
category (BundleCategory): bundled product category
|
|
79
|
+
customer_segment_name (CustomerSegmentName): customer segment name
|
|
80
|
+
commercial_segment_name(CommercialSegmentName): SmallMediumEnterprise or Consumer
|
|
81
|
+
customer_type_name(CustomerTypeName): customer type name
|
|
82
|
+
sale_type_name(SaleTypeName): sale type name
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
BundledProduct
|
|
86
|
+
|
|
87
|
+
"""
|
|
88
|
+
params = {
|
|
89
|
+
"commercial_profile_name": commercial_profile_name,
|
|
90
|
+
"technology_name": technology_name,
|
|
91
|
+
"territory_owner_id": territory_owner_id,
|
|
92
|
+
"category": category,
|
|
93
|
+
"customer_segment_name": customer_segment_name,
|
|
94
|
+
"commercial_segment_name": commercial_segment_name,
|
|
95
|
+
"customer_type_name": customer_type_name,
|
|
96
|
+
"sale_type_name": sale_type_name,
|
|
97
|
+
}
|
|
98
|
+
sellable_bundled_products = cls._request(
|
|
99
|
+
"get",
|
|
100
|
+
cls._api_subpath,
|
|
101
|
+
{
|
|
102
|
+
k: (v.value if hasattr(v, "value") else v)
|
|
103
|
+
for k, v in params.items()
|
|
104
|
+
if v is not None
|
|
105
|
+
},
|
|
106
|
+
)
|
|
107
|
+
return [
|
|
108
|
+
BundledProduct.from_dict(**sellable_bundled_product)
|
|
109
|
+
for sellable_bundled_product in sellable_bundled_products
|
|
110
|
+
]
|
|
File without changes
|
masstack_python_client-0.0.4/src/masstack_python_client/resources/enums/bundled_product_category.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class BundleCategory(Enum):
|
|
5
|
+
MOBILE = "Mobile"
|
|
6
|
+
TV = "TV"
|
|
7
|
+
FIXED_BROADBAND = "Fixed+Broadband"
|
|
8
|
+
FIXED_MOBILE = "Fixed+Mobile"
|
|
9
|
+
FIXED_BROADBAND_MOBILE = "Fixed+Broadband+Mobile"
|
|
10
|
+
FIXED_BROADBAND_TV = "Fixed+Broadband+TV"
|
|
11
|
+
FIXED_BROADBAND_MOBILE_NTX = "Fixed+Broadband+Mobile+Netflix"
|
|
12
|
+
FIXED_BROADBAND_MOBILE_TV = "Fixed+Broadband+Mobile+TV"
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass(frozen=True)
|
|
5
|
+
class SubsType:
|
|
6
|
+
id: str
|
|
7
|
+
name: str
|
|
8
|
+
description: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True)
|
|
12
|
+
class ComercialProduct:
|
|
13
|
+
id: str
|
|
14
|
+
name: str
|
|
15
|
+
|
|
16
|
+
@classmethod
|
|
17
|
+
def from_dict(cls, commercial_product, **kwargs) -> "ComercialProduct":
|
|
18
|
+
return cls(commercial_product["id"], commercial_product["name"])
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass(frozen=True)
|
|
22
|
+
class BundledProductSubtype:
|
|
23
|
+
id: str
|
|
24
|
+
bundled_commercial_products: list[ComercialProduct]
|
|
25
|
+
subs_type: SubsType
|
|
26
|
+
|
|
27
|
+
@classmethod
|
|
28
|
+
def from_dict(
|
|
29
|
+
cls, id, bundled_commercial_products, subs_type, **kwargs
|
|
30
|
+
) -> "BundledProductSubtype":
|
|
31
|
+
return cls(
|
|
32
|
+
id,
|
|
33
|
+
bundled_commercial_products=[
|
|
34
|
+
ComercialProduct.from_dict(**bundled_commercial_product)
|
|
35
|
+
for bundled_commercial_product in bundled_commercial_products
|
|
36
|
+
],
|
|
37
|
+
subs_type=SubsType(**subs_type),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(frozen=True)
|
|
42
|
+
class BundledProduct:
|
|
43
|
+
id: str
|
|
44
|
+
name: str
|
|
45
|
+
bundled_product_subs_types: list[BundledProductSubtype]
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(
|
|
49
|
+
cls, id, name, bundled_product_subs_types, **kwargs
|
|
50
|
+
) -> "BundledProduct":
|
|
51
|
+
return cls(
|
|
52
|
+
id,
|
|
53
|
+
name,
|
|
54
|
+
bundled_product_subs_types=[
|
|
55
|
+
BundledProductSubtype.from_dict(**bundled_product_subs_type)
|
|
56
|
+
for bundled_product_subs_type in bundled_product_subs_types
|
|
57
|
+
],
|
|
58
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: masstack-python-client
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: This Python API client provides access to masmovil core API domains
|
|
5
5
|
Author-email: Borja Gimeno <borja.gimeno@somconnexio.coop>
|
|
6
6
|
License: GPL-3.0-only
|
|
@@ -45,6 +45,10 @@ This Python API client provides access to masmovil core API domains.
|
|
|
45
45
|
- returns customer tree data associated to a given document identification, email or number of the client.
|
|
46
46
|
- returns user data by userId
|
|
47
47
|
|
|
48
|
+
* Catalogue
|
|
49
|
+
- bundled_products - access to bundled products
|
|
50
|
+
- get sellable bundled products
|
|
51
|
+
|
|
48
52
|
## Installation
|
|
49
53
|
|
|
50
54
|
```commandline
|
|
@@ -19,10 +19,19 @@ src/masstack_python_client/data/province_translation.csv
|
|
|
19
19
|
src/masstack_python_client/data/street_type_translation.csv
|
|
20
20
|
src/masstack_python_client/data/unit_translation.csv
|
|
21
21
|
src/masstack_python_client/resources/__init__.py
|
|
22
|
+
src/masstack_python_client/resources/catalogue.py
|
|
22
23
|
src/masstack_python_client/resources/customers.py
|
|
23
24
|
src/masstack_python_client/resources/feasibility.py
|
|
25
|
+
src/masstack_python_client/resources/enums/__init__.py
|
|
26
|
+
src/masstack_python_client/resources/enums/bundled_product_category.py
|
|
27
|
+
src/masstack_python_client/resources/enums/commercial_segment_name.py
|
|
28
|
+
src/masstack_python_client/resources/enums/customer_segment_name.py
|
|
29
|
+
src/masstack_python_client/resources/enums/customer_type_name.py
|
|
24
30
|
src/masstack_python_client/resources/enums/document_type_search.py
|
|
31
|
+
src/masstack_python_client/resources/enums/sale_type_name.py
|
|
32
|
+
src/masstack_python_client/resources/enums/technology_name.py
|
|
25
33
|
src/masstack_python_client/resources/models/address.py
|
|
34
|
+
src/masstack_python_client/resources/models/bundled.py
|
|
26
35
|
src/masstack_python_client/resources/models/client_address.py
|
|
27
36
|
src/masstack_python_client/resources/models/client_attribute.py
|
|
28
37
|
src/masstack_python_client/resources/models/client_payment.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{masstack_python_client-0.0.3 → masstack_python_client-0.0.4}/src/masstack_python_client/client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|