pldpro_sdk.api_client.LicenasApi
All URIs are relative to /v1
| Method | HTTP request | Description |
|---|---|---|
| check_valid_license | GET /licenses/check | Busca a licença do tenant por modelo |
| create_license | POST /licenses | Faz upload de um arquivo de licença |
| get_all_licenses_by_tenant | GET /licenses | Lista todas as licenças do tenant |
| get_all_valid_licenses_by_tenant | GET /licenses/available | Lista as licenças válidas do tenant |
| get_license_by_model | GET /licenses/by-model/{modelType} | Busca a licença do tenant por modelo na URL |
check_valid_license
bool check_valid_license(model_type)
Busca a licença do tenant por modelo
Retorna a licença mais recente do tenant para o modelo informado via query string.
Example
- Api Key Authentication (TenantIdAuth):
- Api Key Authentication (ApiKeyAuth):
import pldpro_sdk.api_client
from pldpro_sdk.api_client.models.model_type_enum import ModelTypeEnum
from pldpro_sdk.api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pldpro_sdk.api_client.Configuration(
host = "/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: TenantIdAuth
configuration.api_key['TenantIdAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TenantIdAuth'] = 'Bearer'
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with pldpro_sdk.api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pldpro_sdk.api_client.LicenasApi(api_client)
model_type = pldpro_sdk.api_client.ModelTypeEnum() # ModelTypeEnum | Modelo cuja licença deve ser consultada.
try:
# Busca a licença do tenant por modelo
api_response = api_instance.check_valid_license(model_type)
print("The response of LicenasApi->check_valid_license:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LicenasApi->check_valid_license: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| model_type | ModelTypeEnum | Modelo cuja licença deve ser consultada. |
Return type
bool
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Resultado da verificação da licença. | - |
| 400 | Erro ao consultar licença | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
create_license
LicenseResponse create_license(multipart_files, license_request)
Faz upload de um arquivo de licença
Envia um arquivo de licença para o tenant informado no header X-Tenant-ID, junto com os metadados obrigatórios da licença no part licenseRequest em JSON.
Example
- Api Key Authentication (TenantIdAuth):
- Api Key Authentication (ApiKeyAuth):
import pldpro_sdk.api_client
from pldpro_sdk.api_client.models.license_response import LicenseResponse
from pldpro_sdk.api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pldpro_sdk.api_client.Configuration(
host = "/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: TenantIdAuth
configuration.api_key['TenantIdAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TenantIdAuth'] = 'Bearer'
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with pldpro_sdk.api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pldpro_sdk.api_client.LicenasApi(api_client)
multipart_files = None # bytes | Arquivo de licença a ser enviado no part `multipartFiles`.
license_request = pldpro_sdk.api_client.LicenseRequest() # LicenseRequest | Metadados obrigatórios da licença enviados no formulário no part `licenseRequest` como JSON.
try:
# Faz upload de um arquivo de licença
api_response = api_instance.create_license(multipart_files, license_request)
print("The response of LicenasApi->create_license:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LicenasApi->create_license: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| multipart_files | bytes | Arquivo de licença a ser enviado no part `multipartFiles`. | |
| license_request | LicenseRequest | Metadados obrigatórios da licença enviados no formulário no part `licenseRequest` como JSON. |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Licença criada com sucesso. | - |
| 400 | Erro ao criar licença | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_all_licenses_by_tenant
List[LicenseResponse] get_all_licenses_by_tenant()
Lista todas as licenças do tenant
Retorna todas as licenças associadas ao tenant informado no header X-Tenant-ID, sem filtrar por validade.
Example
- Api Key Authentication (TenantIdAuth):
- Api Key Authentication (ApiKeyAuth):
import pldpro_sdk.api_client
from pldpro_sdk.api_client.models.license_response import LicenseResponse
from pldpro_sdk.api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pldpro_sdk.api_client.Configuration(
host = "/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: TenantIdAuth
configuration.api_key['TenantIdAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TenantIdAuth'] = 'Bearer'
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with pldpro_sdk.api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pldpro_sdk.api_client.LicenasApi(api_client)
try:
# Lista todas as licenças do tenant
api_response = api_instance.get_all_licenses_by_tenant()
print("The response of LicenasApi->get_all_licenses_by_tenant:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LicenasApi->get_all_licenses_by_tenant: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Lista de licenças retornada com sucesso. | - |
| 400 | Erro ao listar licenças | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_all_valid_licenses_by_tenant
List[LicenseResponse] get_all_valid_licenses_by_tenant()
Lista as licenças válidas do tenant
Retorna somente as licenças válidas associadas ao tenant informado no header X-Tenant-ID.
Example
- Api Key Authentication (TenantIdAuth):
- Api Key Authentication (ApiKeyAuth):
import pldpro_sdk.api_client
from pldpro_sdk.api_client.models.license_response import LicenseResponse
from pldpro_sdk.api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pldpro_sdk.api_client.Configuration(
host = "/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: TenantIdAuth
configuration.api_key['TenantIdAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TenantIdAuth'] = 'Bearer'
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with pldpro_sdk.api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pldpro_sdk.api_client.LicenasApi(api_client)
try:
# Lista as licenças válidas do tenant
api_response = api_instance.get_all_valid_licenses_by_tenant()
print("The response of LicenasApi->get_all_valid_licenses_by_tenant:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LicenasApi->get_all_valid_licenses_by_tenant: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Lista de licenças válidas retornada com sucesso. | - |
| 400 | Erro ao listar licenças válidas | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
get_license_by_model
LicenseResponse get_license_by_model(model_type)
Busca a licença do tenant por modelo na URL
Retorna a licença mais recente do tenant para o modelo informado no path.
Example
- Api Key Authentication (TenantIdAuth):
- Api Key Authentication (ApiKeyAuth):
import pldpro_sdk.api_client
from pldpro_sdk.api_client.models.license_response import LicenseResponse
from pldpro_sdk.api_client.models.model_type_enum import ModelTypeEnum
from pldpro_sdk.api_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /v1
# See configuration.py for a list of all supported configuration parameters.
configuration = pldpro_sdk.api_client.Configuration(
host = "/v1"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: TenantIdAuth
configuration.api_key['TenantIdAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['TenantIdAuth'] = 'Bearer'
# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'
# Enter a context with an instance of the API client
with pldpro_sdk.api_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = pldpro_sdk.api_client.LicenasApi(api_client)
model_type = pldpro_sdk.api_client.ModelTypeEnum() # ModelTypeEnum | Modelo cuja licença deve ser consultada.
try:
# Busca a licença do tenant por modelo na URL
api_response = api_instance.get_license_by_model(model_type)
print("The response of LicenasApi->get_license_by_model:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling LicenasApi->get_license_by_model: %s\n" % e)
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| model_type | ModelTypeEnum | Modelo cuja licença deve ser consultada. |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Licença encontrada com sucesso. | - |
| 400 | Erro ao consultar licença | - |
| 404 | Licença não encontrada para o modelo informado | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]