redemais-white-label-python-sdk 1.0.0__py3-none-any.whl

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.
__init__.py ADDED
File without changes
redemais/__init__.py ADDED
File without changes
File without changes
@@ -0,0 +1,21 @@
1
+ import os, base64, logging
2
+ from fmconsult.http.api import ApiBase
3
+
4
+ class RedeMaisWhiteLabelApi(ApiBase):
5
+
6
+ def __init__(self):
7
+ try:
8
+ self.api_token = os.environ['redemais.whitelabel.api.token']
9
+ self.api_environment = os.environ['redemais.whitelabel.api.environment']
10
+ self.id_cliente = os.environ('redemais.whitelabel.api.id_cliente')
11
+ self.id_contrato_plano = os.environ('redemais.whitelabel.api.id_contrato_plano')
12
+
13
+ self.headers = {
14
+ 'x-api-key': self.api_token
15
+ }
16
+
17
+ url_endpoint = (lambda env: 'prd-v1' if env == 'live' else 'hml-v1' if env == 'sandbox' else None)(self.environment)
18
+
19
+ self.base_url = f'https://ddt8urmaeb.execute-api.us-east-1.amazonaws.com/{url_endpoint}/rms1'
20
+ except:
21
+ raise
File without changes
@@ -0,0 +1,40 @@
1
+ import logging, jsonpickle
2
+ from http import HTTPMethod
3
+ from fmconsult.utils.url import UrlUtil
4
+ from redemais.whitelabel.api import RedeMaisWhiteLabelApi
5
+ from redemais.whitelabel.dtos.beneficiario import Beneficiario
6
+
7
+ class Beneficiarios(RedeMaisWhiteLabelApi):
8
+
9
+ def adesao(self, data:Beneficiario, id_tipo_plano: int):
10
+ try:
11
+ logging.info(f'add new person...')
12
+ payload = {
13
+ "idClienteContrato": int(self.id_contrato_plano),
14
+ "idBeneficiarioTipo": 1,
15
+ "nome": data.nome,
16
+ "codigoExterno": data.codigo_externo,
17
+ "idCliente": int(self.id_cliente),
18
+ "cpf": data.cpf,
19
+ "dataNascimento": data.data_nascimento,
20
+ "sexo": data.sexo,
21
+ "celular": data.celular,
22
+ "email": data.email,
23
+ "cep": data.cep,
24
+ "logradouro": data.endereco,
25
+ "numero": data.numero_endereco,
26
+ "complemento": data.complemento_endereco,
27
+ "bairro": data.bairro,
28
+ "cidade": data.cidade,
29
+ "uf": data.uf,
30
+ "tipoPlano": id_tipo_plano
31
+ }
32
+
33
+ if not data.cpf_titular is None:
34
+ payload['cpfTitular'] = data.cpf_titular
35
+
36
+ self.endpoint_url = UrlUtil().make_url(self.base_url, ['adesao'])
37
+ res = self.call_request(HTTPMethod.POST, self.endpoint_url, None, payload=payload)
38
+ return jsonpickle.decode(res)
39
+ except:
40
+ raise
File without changes
@@ -0,0 +1,25 @@
1
+ from dataclasses import dataclass, asdict
2
+ from typing import Optional
3
+ from fmconsult.utils.object import CustomObject
4
+
5
+ @dataclass
6
+ class Beneficiario(CustomObject):
7
+ nome: str
8
+ codigo_externo: str
9
+ cpf: str
10
+ data_nascimento: str
11
+ sexo: str
12
+ celular: str
13
+ email: str
14
+ cep: str
15
+ endereco: str
16
+ numero_endereco: str
17
+ complemento_endereco: str
18
+ bairro: str
19
+ cidade: str
20
+ uf: str
21
+ cpf_titular: Optional[str] = None
22
+
23
+ def to_dict(self):
24
+ data = asdict(self)
25
+ return data
@@ -0,0 +1,21 @@
1
+ Metadata-Version: 2.4
2
+ Name: redemais-white-label-python-sdk
3
+ Version: 1.0.0
4
+ Summary: Client de comunicaçao c/ API White Label da Rede+
5
+ Author-email: Filipe Coelho <filipe@fmconsult.com.br>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 Seu Nome
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy...
11
+
12
+ Project-URL: Homepage, https://github.com/seuuser/minha-biblioteca
13
+ Project-URL: Bug Tracker, https://github.com/seuuser/minha-biblioteca/issues
14
+ Keywords: sdk,api,redemais,whitelabel,fmconsult
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Dynamic: license-file
@@ -0,0 +1,13 @@
1
+ __init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ redemais/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ redemais/whitelabel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ redemais/whitelabel/api.py,sha256=yrYjreQXgRdpsmVeKDk-sVgR6b-wfU5hYWJRXClyjoM,852
5
+ redemais/whitelabel/apis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ redemais/whitelabel/apis/beneficiarios.py,sha256=0Fo2Vs7bVQ9oKjxH8ev7OOdAepcaWJVCk725a8lwJAs,1578
7
+ redemais/whitelabel/dtos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ redemais/whitelabel/dtos/beneficiario.py,sha256=Ls3QfE-8LCRtXuFSZWGoRCccNPImQPDCRRqf0MsYhdQ,525
9
+ redemais_white_label_python_sdk-1.0.0.dist-info/licenses/LICENSE,sha256=YZjQnFjzXGFa0D3iCQkNDwGBNuTGJREkRmItGX1B3YM,122
10
+ redemais_white_label_python_sdk-1.0.0.dist-info/METADATA,sha256=2AeyH7dGfYpiXFs2q8G2kpwI4jvnvlZ2rRaTt_8m5-Y,807
11
+ redemais_white_label_python_sdk-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
12
+ redemais_white_label_python_sdk-1.0.0.dist-info/top_level.txt,sha256=QTbRfDDFZLVs3ww31khjGiB-VI9eZT4d9j9QmZbmCig,18
13
+ redemais_white_label_python_sdk-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,5 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Seu Nome
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy...
@@ -0,0 +1,2 @@
1
+ __init__
2
+ redemais