bely-api 2025.3.dev0__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.
- bely_api-2025.3.dev0/BelyApiFactory.py +153 -0
- bely_api-2025.3.dev0/PKG-INFO +8 -0
- bely_api-2025.3.dev0/belyApi/__init__.py +96 -0
- bely_api-2025.3.dev0/belyApi/api/__init__.py +15 -0
- bely_api-2025.3.dev0/belyApi/api/authentication_api.py +357 -0
- bely_api-2025.3.dev0/belyApi/api/domain_api.py +1149 -0
- bely_api-2025.3.dev0/belyApi/api/downloads_api.py +504 -0
- bely_api-2025.3.dev0/belyApi/api/logbook_api.py +1159 -0
- bely_api-2025.3.dev0/belyApi/api/notification_configuration_api.py +1131 -0
- bely_api-2025.3.dev0/belyApi/api/notification_configurations_api.py +1131 -0
- bely_api-2025.3.dev0/belyApi/api/property_value_api.py +844 -0
- bely_api-2025.3.dev0/belyApi/api/search_api.py +154 -0
- bely_api-2025.3.dev0/belyApi/api/system_log_api.py +674 -0
- bely_api-2025.3.dev0/belyApi/api/test_api.py +347 -0
- bely_api-2025.3.dev0/belyApi/api/users_api.py +468 -0
- bely_api-2025.3.dev0/belyApi/api_client.py +667 -0
- bely_api-2025.3.dev0/belyApi/configuration.py +404 -0
- bely_api-2025.3.dev0/belyApi/exceptions.py +121 -0
- bely_api-2025.3.dev0/belyApi/models/__init__.py +72 -0
- bely_api-2025.3.dev0/belyApi/models/allowed_property_value.py +243 -0
- bely_api-2025.3.dev0/belyApi/models/api_exception_message.py +173 -0
- bely_api-2025.3.dev0/belyApi/models/api_exception_message_exception.py +225 -0
- bely_api-2025.3.dev0/belyApi/models/api_exception_message_exception_cause.py +199 -0
- bely_api-2025.3.dev0/belyApi/models/api_exception_message_exception_cause_stack_trace.py +303 -0
- bely_api-2025.3.dev0/belyApi/models/api_exception_message_exception_cause_suppressed.py +173 -0
- bely_api-2025.3.dev0/belyApi/models/cdb_entity.py +121 -0
- bely_api-2025.3.dev0/belyApi/models/connector.py +316 -0
- bely_api-2025.3.dev0/belyApi/models/connector_type.py +212 -0
- bely_api-2025.3.dev0/belyApi/models/domain.py +444 -0
- bely_api-2025.3.dev0/belyApi/models/entity_info.py +357 -0
- bely_api-2025.3.dev0/belyApi/models/entity_type.py +544 -0
- bely_api-2025.3.dev0/belyApi/models/inline_object.py +147 -0
- bely_api-2025.3.dev0/belyApi/models/item.py +538 -0
- bely_api-2025.3.dev0/belyApi/models/item_category.py +238 -0
- bely_api-2025.3.dev0/belyApi/models/item_connector.py +517 -0
- bely_api-2025.3.dev0/belyApi/models/item_domain_logbook.py +590 -0
- bely_api-2025.3.dev0/belyApi/models/item_domain_logbook_all_of.py +147 -0
- bely_api-2025.3.dev0/belyApi/models/item_element.py +601 -0
- bely_api-2025.3.dev0/belyApi/models/item_element_history.py +561 -0
- bely_api-2025.3.dev0/belyApi/models/item_element_relationship.py +841 -0
- bely_api-2025.3.dev0/belyApi/models/item_element_relationship_history.py +530 -0
- bely_api-2025.3.dev0/belyApi/models/item_project.py +186 -0
- bely_api-2025.3.dev0/belyApi/models/item_resource.py +373 -0
- bely_api-2025.3.dev0/belyApi/models/item_source.py +459 -0
- bely_api-2025.3.dev0/belyApi/models/item_type.py +264 -0
- bely_api-2025.3.dev0/belyApi/models/list_tbl.py +290 -0
- bely_api-2025.3.dev0/belyApi/models/log.py +416 -0
- bely_api-2025.3.dev0/belyApi/models/log_document_options.py +225 -0
- bely_api-2025.3.dev0/belyApi/models/log_document_section.py +147 -0
- bely_api-2025.3.dev0/belyApi/models/log_entry.py +329 -0
- bely_api-2025.3.dev0/belyApi/models/log_reaction.py +173 -0
- bely_api-2025.3.dev0/belyApi/models/notification_configuration.py +349 -0
- bely_api-2025.3.dev0/belyApi/models/notification_configuration_handler_setting.py +206 -0
- bely_api-2025.3.dev0/belyApi/models/notification_configuration_setting.py +205 -0
- bely_api-2025.3.dev0/belyApi/models/notification_handler_config_key.py +335 -0
- bely_api-2025.3.dev0/belyApi/models/notification_provider.py +238 -0
- bely_api-2025.3.dev0/belyApi/models/notification_provider_config_key.py +291 -0
- bely_api-2025.3.dev0/belyApi/models/property_metadata.py +187 -0
- bely_api-2025.3.dev0/belyApi/models/property_type.py +438 -0
- bely_api-2025.3.dev0/belyApi/models/property_value.py +651 -0
- bely_api-2025.3.dev0/belyApi/models/property_value_history.py +418 -0
- bely_api-2025.3.dev0/belyApi/models/reaction.py +239 -0
- bely_api-2025.3.dev0/belyApi/models/relationship_type.py +238 -0
- bely_api-2025.3.dev0/belyApi/models/relationship_type_handler.py +212 -0
- bely_api-2025.3.dev0/belyApi/models/resource_type.py +412 -0
- bely_api-2025.3.dev0/belyApi/models/resource_type_category.py +212 -0
- bely_api-2025.3.dev0/belyApi/models/role_type.py +186 -0
- bely_api-2025.3.dev0/belyApi/models/search_entities_options.py +537 -0
- bely_api-2025.3.dev0/belyApi/models/search_entities_results.py +511 -0
- bely_api-2025.3.dev0/belyApi/models/search_result.py +329 -0
- bely_api-2025.3.dev0/belyApi/models/source.py +302 -0
- bely_api-2025.3.dev0/belyApi/models/user_group.py +186 -0
- bely_api-2025.3.dev0/belyApi/models/user_info.py +394 -0
- bely_api-2025.3.dev0/belyApi/models/user_role.py +147 -0
- bely_api-2025.3.dev0/belyApi/rest.py +292 -0
- bely_api-2025.3.dev0/bely_api.egg-info/PKG-INFO +8 -0
- bely_api-2025.3.dev0/bely_api.egg-info/SOURCES.txt +81 -0
- bely_api-2025.3.dev0/bely_api.egg-info/dependency_links.txt +1 -0
- bely_api-2025.3.dev0/bely_api.egg-info/entry_points.txt +2 -0
- bely_api-2025.3.dev0/bely_api.egg-info/requires.txt +4 -0
- bely_api-2025.3.dev0/bely_api.egg-info/top_level.txt +2 -0
- bely_api-2025.3.dev0/setup.cfg +4 -0
- bely_api-2025.3.dev0/setup.py +29 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
# Copyright (c) UChicago Argonne, LLC. All rights reserved.
|
|
4
|
+
# See LICENSE file.
|
|
5
|
+
import base64
|
|
6
|
+
import os
|
|
7
|
+
|
|
8
|
+
from belyApi import Configuration, ApiClient
|
|
9
|
+
from belyApi import (
|
|
10
|
+
DomainApi,
|
|
11
|
+
DownloadsApi,
|
|
12
|
+
UsersApi,
|
|
13
|
+
PropertyValueApi,
|
|
14
|
+
SystemLogApi,
|
|
15
|
+
SearchApi,
|
|
16
|
+
AuthenticationApi,
|
|
17
|
+
LogbookApi,
|
|
18
|
+
NotificationConfigurationApi,
|
|
19
|
+
)
|
|
20
|
+
from belyApi import ApiExceptionMessage
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class BelyApiFactory:
|
|
24
|
+
|
|
25
|
+
HEADER_TOKEN_KEY = "token"
|
|
26
|
+
URL_FORMAT = "%s/views/item/view?id=%s"
|
|
27
|
+
|
|
28
|
+
LOGBOOK_DOMAIN_ID = 1
|
|
29
|
+
|
|
30
|
+
def __init__(self, bely_url):
|
|
31
|
+
self.bely_url = bely_url
|
|
32
|
+
self.config = Configuration(host=self.bely_url)
|
|
33
|
+
self.api_client = ApiClient(configuration=self.config)
|
|
34
|
+
|
|
35
|
+
self.logbook_api = LogbookApi(api_client=self.api_client)
|
|
36
|
+
self.notification_configuration_api = NotificationConfigurationApi(
|
|
37
|
+
api_client=self.api_client
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
self.downloadsApi = DownloadsApi(api_client=self.api_client)
|
|
41
|
+
self.propertyValueApi = PropertyValueApi(api_client=self.api_client)
|
|
42
|
+
self.usersApi = UsersApi(api_client=self.api_client)
|
|
43
|
+
self.domainApi = DomainApi(api_client=self.api_client)
|
|
44
|
+
|
|
45
|
+
self.systemlogApi = SystemLogApi(api_client=self.api_client)
|
|
46
|
+
self.searchApi = SearchApi(api_client=self.api_client)
|
|
47
|
+
|
|
48
|
+
self.auth_api = AuthenticationApi(api_client=self.api_client)
|
|
49
|
+
|
|
50
|
+
def get_lobook_api(self) -> LogbookApi:
|
|
51
|
+
return self.logbook_api
|
|
52
|
+
|
|
53
|
+
def getDomainApi(self) -> DomainApi:
|
|
54
|
+
return self.domainApi
|
|
55
|
+
|
|
56
|
+
def getDownloadApi(self) -> DownloadsApi:
|
|
57
|
+
return self.downloadsApi
|
|
58
|
+
|
|
59
|
+
def getPropertyValueApi(self) -> PropertyValueApi:
|
|
60
|
+
return self.propertyValueApi
|
|
61
|
+
|
|
62
|
+
def getUsersApi(self) -> UsersApi:
|
|
63
|
+
return self.usersApi
|
|
64
|
+
|
|
65
|
+
def getSearchApi(self) -> SearchApi:
|
|
66
|
+
return self.searchApi
|
|
67
|
+
|
|
68
|
+
def getNotificationConfigurationApi(self):
|
|
69
|
+
return self.notification_configuration_api
|
|
70
|
+
|
|
71
|
+
def generateCDBUrlForItemId(self, itemId):
|
|
72
|
+
return self.URL_FORMAT % (self.cdbUrl, str(itemId))
|
|
73
|
+
|
|
74
|
+
def authenticate_user(self, username, password):
|
|
75
|
+
response = self.auth_api.authenticate_user_with_http_info(
|
|
76
|
+
username=username, password=password
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
token = response[-1][self.HEADER_TOKEN_KEY]
|
|
80
|
+
self.__set_authenticate_token(token)
|
|
81
|
+
|
|
82
|
+
def __set_authenticate_token(self, token):
|
|
83
|
+
self.api_client.set_default_header(self.HEADER_TOKEN_KEY, token)
|
|
84
|
+
|
|
85
|
+
def getAuthenticateToken(self):
|
|
86
|
+
return self.apiClient.default_headers[self.HEADER_TOKEN_KEY]
|
|
87
|
+
|
|
88
|
+
def test_authenticated(self):
|
|
89
|
+
self.auth_api.verify_authenticated()
|
|
90
|
+
|
|
91
|
+
def logout_user(self):
|
|
92
|
+
self.auth_api.log_out()
|
|
93
|
+
|
|
94
|
+
# Restore later
|
|
95
|
+
# @classmethod
|
|
96
|
+
# def createFileUploadObject(cls, filePath):
|
|
97
|
+
# data = open(filePath, "rb").read()
|
|
98
|
+
# b64String = base64.b64encode(data).decode()
|
|
99
|
+
|
|
100
|
+
# fileName = os.path.basename(filePath)
|
|
101
|
+
# return FileUploadObject(file_name=fileName, base64_binary=b64String)
|
|
102
|
+
|
|
103
|
+
def parseApiException(self, openApiException):
|
|
104
|
+
responseType = ApiExceptionMessage.__name__
|
|
105
|
+
openApiException.data = openApiException.body
|
|
106
|
+
exObj = self.apiClient.deserialize(openApiException, responseType)
|
|
107
|
+
exObj.status = openApiException.status
|
|
108
|
+
return exObj
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
# def run_command():
|
|
112
|
+
# Example
|
|
113
|
+
# print("\nEnter cdb URL (ex: https://cdb.aps.anl.gov/cdb): ")
|
|
114
|
+
# hostname = input()
|
|
115
|
+
|
|
116
|
+
# apiFactory = CdbApiFactory(hostname)
|
|
117
|
+
# itemApi = apiFactory.getItemApi()
|
|
118
|
+
|
|
119
|
+
# catalogItems = itemApi.get_catalog_items()
|
|
120
|
+
# catalogItem = catalogItems[0]
|
|
121
|
+
|
|
122
|
+
# # Lists of items seem to be lists of dict items
|
|
123
|
+
# catalogId = catalogItem.id
|
|
124
|
+
|
|
125
|
+
# # Single items seem to be appropriate type
|
|
126
|
+
# catalogFetchedById = itemApi.get_item_by_id(catalogId)
|
|
127
|
+
# print(catalogFetchedById.name)
|
|
128
|
+
|
|
129
|
+
# inventoryItemPerCatalog = itemApi.get_items_derived_from_item_by_item_id(catalogId)
|
|
130
|
+
# print(inventoryItemPerCatalog)
|
|
131
|
+
|
|
132
|
+
# print("\n\n\nWould you like to test authentication? (y/N): ")
|
|
133
|
+
# resp = input()
|
|
134
|
+
# if resp == 'y' or resp == "Y":
|
|
135
|
+
# import getpass
|
|
136
|
+
# print("Username: ")
|
|
137
|
+
# username = input()
|
|
138
|
+
# print("Password: ")
|
|
139
|
+
# password = getpass.getpass()
|
|
140
|
+
|
|
141
|
+
# try:
|
|
142
|
+
# apiFactory.authenticateUser(username, password)
|
|
143
|
+
# apiFactory.testAuthenticated()
|
|
144
|
+
# apiFactory.logOutUser()
|
|
145
|
+
# except ApiException:
|
|
146
|
+
# print("Authentication failed!")
|
|
147
|
+
# exit(1)
|
|
148
|
+
|
|
149
|
+
# print("Success!")
|
|
150
|
+
|
|
151
|
+
if __name__ == "__main__":
|
|
152
|
+
pass
|
|
153
|
+
# run_command()
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: bely_api
|
|
3
|
+
Version: 2025.3.dev0
|
|
4
|
+
Summary: Python client API library used to communicate with BELY API.
|
|
5
|
+
Home-page: https://git.aps.anl.gov/controls/hla/bely
|
|
6
|
+
Maintainer: Dariusz Jarosz
|
|
7
|
+
Maintainer-email: djarosz@aps.anl.gov
|
|
8
|
+
License: Copyright (c) UChicago Argonne, LLC. All rights reserved.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
BELY API
|
|
7
|
+
|
|
8
|
+
The API that provides access to BELY data. # noqa: E501
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: 2024.5
|
|
11
|
+
Contact: djarosz@anl.gov
|
|
12
|
+
Generated by: https://openapi-generator.tech
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import absolute_import
|
|
17
|
+
|
|
18
|
+
__version__ = "1.0.0"
|
|
19
|
+
|
|
20
|
+
# import apis into sdk package
|
|
21
|
+
from belyApi.api.authentication_api import AuthenticationApi
|
|
22
|
+
from belyApi.api.downloads_api import DownloadsApi
|
|
23
|
+
from belyApi.api.logbook_api import LogbookApi
|
|
24
|
+
from belyApi.api.notification_configuration_api import NotificationConfigurationApi
|
|
25
|
+
from belyApi.api.property_value_api import PropertyValueApi
|
|
26
|
+
from belyApi.api.search_api import SearchApi
|
|
27
|
+
from belyApi.api.system_log_api import SystemLogApi
|
|
28
|
+
from belyApi.api.test_api import TestApi
|
|
29
|
+
from belyApi.api.users_api import UsersApi
|
|
30
|
+
from belyApi.api.domain_api import DomainApi
|
|
31
|
+
|
|
32
|
+
# import ApiClient
|
|
33
|
+
from belyApi.api_client import ApiClient
|
|
34
|
+
from belyApi.configuration import Configuration
|
|
35
|
+
from belyApi.exceptions import OpenApiException
|
|
36
|
+
from belyApi.exceptions import ApiTypeError
|
|
37
|
+
from belyApi.exceptions import ApiValueError
|
|
38
|
+
from belyApi.exceptions import ApiKeyError
|
|
39
|
+
from belyApi.exceptions import ApiException
|
|
40
|
+
# import models into sdk package
|
|
41
|
+
from belyApi.models.allowed_property_value import AllowedPropertyValue
|
|
42
|
+
from belyApi.models.api_exception_message import ApiExceptionMessage
|
|
43
|
+
from belyApi.models.api_exception_message_exception import ApiExceptionMessageException
|
|
44
|
+
from belyApi.models.api_exception_message_exception_cause import ApiExceptionMessageExceptionCause
|
|
45
|
+
from belyApi.models.api_exception_message_exception_cause_stack_trace import ApiExceptionMessageExceptionCauseStackTrace
|
|
46
|
+
from belyApi.models.api_exception_message_exception_cause_suppressed import ApiExceptionMessageExceptionCauseSuppressed
|
|
47
|
+
from belyApi.models.cdb_entity import CdbEntity
|
|
48
|
+
from belyApi.models.connector import Connector
|
|
49
|
+
from belyApi.models.connector_type import ConnectorType
|
|
50
|
+
from belyApi.models.domain import Domain
|
|
51
|
+
from belyApi.models.entity_info import EntityInfo
|
|
52
|
+
from belyApi.models.entity_type import EntityType
|
|
53
|
+
from belyApi.models.inline_object import InlineObject
|
|
54
|
+
from belyApi.models.item import Item
|
|
55
|
+
from belyApi.models.item_category import ItemCategory
|
|
56
|
+
from belyApi.models.item_connector import ItemConnector
|
|
57
|
+
from belyApi.models.item_domain_logbook import ItemDomainLogbook
|
|
58
|
+
from belyApi.models.item_domain_logbook_all_of import ItemDomainLogbookAllOf
|
|
59
|
+
from belyApi.models.item_element import ItemElement
|
|
60
|
+
from belyApi.models.item_element_history import ItemElementHistory
|
|
61
|
+
from belyApi.models.item_element_relationship import ItemElementRelationship
|
|
62
|
+
from belyApi.models.item_element_relationship_history import ItemElementRelationshipHistory
|
|
63
|
+
from belyApi.models.item_project import ItemProject
|
|
64
|
+
from belyApi.models.item_resource import ItemResource
|
|
65
|
+
from belyApi.models.item_source import ItemSource
|
|
66
|
+
from belyApi.models.item_type import ItemType
|
|
67
|
+
from belyApi.models.list_tbl import ListTbl
|
|
68
|
+
from belyApi.models.log import Log
|
|
69
|
+
from belyApi.models.log_document_options import LogDocumentOptions
|
|
70
|
+
from belyApi.models.log_document_section import LogDocumentSection
|
|
71
|
+
from belyApi.models.log_entry import LogEntry
|
|
72
|
+
from belyApi.models.log_reaction import LogReaction
|
|
73
|
+
from belyApi.models.notification_configuration import NotificationConfiguration
|
|
74
|
+
from belyApi.models.notification_configuration_handler_setting import NotificationConfigurationHandlerSetting
|
|
75
|
+
from belyApi.models.notification_configuration_setting import NotificationConfigurationSetting
|
|
76
|
+
from belyApi.models.notification_handler_config_key import NotificationHandlerConfigKey
|
|
77
|
+
from belyApi.models.notification_provider import NotificationProvider
|
|
78
|
+
from belyApi.models.notification_provider_config_key import NotificationProviderConfigKey
|
|
79
|
+
from belyApi.models.property_metadata import PropertyMetadata
|
|
80
|
+
from belyApi.models.property_type import PropertyType
|
|
81
|
+
from belyApi.models.property_value import PropertyValue
|
|
82
|
+
from belyApi.models.property_value_history import PropertyValueHistory
|
|
83
|
+
from belyApi.models.reaction import Reaction
|
|
84
|
+
from belyApi.models.relationship_type import RelationshipType
|
|
85
|
+
from belyApi.models.relationship_type_handler import RelationshipTypeHandler
|
|
86
|
+
from belyApi.models.resource_type import ResourceType
|
|
87
|
+
from belyApi.models.resource_type_category import ResourceTypeCategory
|
|
88
|
+
from belyApi.models.role_type import RoleType
|
|
89
|
+
from belyApi.models.search_entities_options import SearchEntitiesOptions
|
|
90
|
+
from belyApi.models.search_entities_results import SearchEntitiesResults
|
|
91
|
+
from belyApi.models.search_result import SearchResult
|
|
92
|
+
from belyApi.models.source import Source
|
|
93
|
+
from belyApi.models.user_group import UserGroup
|
|
94
|
+
from belyApi.models.user_info import UserInfo
|
|
95
|
+
from belyApi.models.user_role import UserRole
|
|
96
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
# import apis into api package
|
|
6
|
+
from belyApi.api.authentication_api import AuthenticationApi
|
|
7
|
+
from belyApi.api.downloads_api import DownloadsApi
|
|
8
|
+
from belyApi.api.logbook_api import LogbookApi
|
|
9
|
+
from belyApi.api.notification_configuration_api import NotificationConfigurationApi
|
|
10
|
+
from belyApi.api.property_value_api import PropertyValueApi
|
|
11
|
+
from belyApi.api.search_api import SearchApi
|
|
12
|
+
from belyApi.api.system_log_api import SystemLogApi
|
|
13
|
+
from belyApi.api.test_api import TestApi
|
|
14
|
+
from belyApi.api.users_api import UsersApi
|
|
15
|
+
from belyApi.api.domain_api import DomainApi
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
BELY API
|
|
5
|
+
|
|
6
|
+
The API that provides access to BELY data. # noqa: E501
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2024.5
|
|
9
|
+
Contact: djarosz@anl.gov
|
|
10
|
+
Generated by: https://openapi-generator.tech
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from __future__ import absolute_import
|
|
15
|
+
|
|
16
|
+
import re # noqa: F401
|
|
17
|
+
|
|
18
|
+
# python 2 and python 3 compatibility library
|
|
19
|
+
import six
|
|
20
|
+
|
|
21
|
+
from belyApi.api_client import ApiClient
|
|
22
|
+
from belyApi.exceptions import ( # noqa: F401
|
|
23
|
+
ApiTypeError,
|
|
24
|
+
ApiValueError
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class AuthenticationApi(object):
|
|
29
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
30
|
+
Ref: https://openapi-generator.tech
|
|
31
|
+
|
|
32
|
+
Do not edit the class manually.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
def __init__(self, api_client=None):
|
|
36
|
+
if api_client is None:
|
|
37
|
+
api_client = ApiClient()
|
|
38
|
+
self.api_client = api_client
|
|
39
|
+
|
|
40
|
+
def authenticate_user(self, **kwargs): # noqa: E501
|
|
41
|
+
"""Logs user into the system # noqa: E501
|
|
42
|
+
|
|
43
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
44
|
+
asynchronous HTTP request, please pass async_req=True
|
|
45
|
+
>>> thread = api.authenticate_user(async_req=True)
|
|
46
|
+
>>> result = thread.get()
|
|
47
|
+
|
|
48
|
+
:param async_req bool: execute request asynchronously
|
|
49
|
+
:param str username:
|
|
50
|
+
:param str password:
|
|
51
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
52
|
+
be returned without reading/decoding response
|
|
53
|
+
data. Default is True.
|
|
54
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
55
|
+
number provided, it will be total request
|
|
56
|
+
timeout. It can also be a pair (tuple) of
|
|
57
|
+
(connection, read) timeouts.
|
|
58
|
+
:return: None
|
|
59
|
+
If the method is called asynchronously,
|
|
60
|
+
returns the request thread.
|
|
61
|
+
"""
|
|
62
|
+
kwargs['_return_http_data_only'] = True
|
|
63
|
+
return self.authenticate_user_with_http_info(**kwargs) # noqa: E501
|
|
64
|
+
|
|
65
|
+
def authenticate_user_with_http_info(self, **kwargs): # noqa: E501
|
|
66
|
+
"""Logs user into the system # noqa: E501
|
|
67
|
+
|
|
68
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
69
|
+
asynchronous HTTP request, please pass async_req=True
|
|
70
|
+
>>> thread = api.authenticate_user_with_http_info(async_req=True)
|
|
71
|
+
>>> result = thread.get()
|
|
72
|
+
|
|
73
|
+
:param async_req bool: execute request asynchronously
|
|
74
|
+
:param str username:
|
|
75
|
+
:param str password:
|
|
76
|
+
:param _return_http_data_only: response data without head status code
|
|
77
|
+
and headers
|
|
78
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
79
|
+
be returned without reading/decoding response
|
|
80
|
+
data. Default is True.
|
|
81
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
82
|
+
number provided, it will be total request
|
|
83
|
+
timeout. It can also be a pair (tuple) of
|
|
84
|
+
(connection, read) timeouts.
|
|
85
|
+
:return: None
|
|
86
|
+
If the method is called asynchronously,
|
|
87
|
+
returns the request thread.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
local_var_params = locals()
|
|
91
|
+
|
|
92
|
+
all_params = [
|
|
93
|
+
'username',
|
|
94
|
+
'password'
|
|
95
|
+
]
|
|
96
|
+
all_params.extend(
|
|
97
|
+
[
|
|
98
|
+
'async_req',
|
|
99
|
+
'_return_http_data_only',
|
|
100
|
+
'_preload_content',
|
|
101
|
+
'_request_timeout'
|
|
102
|
+
]
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
for key, val in six.iteritems(local_var_params['kwargs']):
|
|
106
|
+
if key not in all_params:
|
|
107
|
+
raise ApiTypeError(
|
|
108
|
+
"Got an unexpected keyword argument '%s'"
|
|
109
|
+
" to method authenticate_user" % key
|
|
110
|
+
)
|
|
111
|
+
local_var_params[key] = val
|
|
112
|
+
del local_var_params['kwargs']
|
|
113
|
+
|
|
114
|
+
collection_formats = {}
|
|
115
|
+
|
|
116
|
+
path_params = {}
|
|
117
|
+
|
|
118
|
+
query_params = []
|
|
119
|
+
|
|
120
|
+
header_params = {}
|
|
121
|
+
|
|
122
|
+
form_params = []
|
|
123
|
+
local_var_files = {}
|
|
124
|
+
if 'username' in local_var_params:
|
|
125
|
+
form_params.append(('username', local_var_params['username'])) # noqa: E501
|
|
126
|
+
if 'password' in local_var_params:
|
|
127
|
+
form_params.append(('password', local_var_params['password'])) # noqa: E501
|
|
128
|
+
|
|
129
|
+
body_params = None
|
|
130
|
+
# HTTP header `Content-Type`
|
|
131
|
+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
|
132
|
+
['application/x-www-form-urlencoded']) # noqa: E501
|
|
133
|
+
|
|
134
|
+
# Authentication setting
|
|
135
|
+
auth_settings = [] # noqa: E501
|
|
136
|
+
|
|
137
|
+
return self.api_client.call_api(
|
|
138
|
+
'/api/auth/login', 'POST',
|
|
139
|
+
path_params,
|
|
140
|
+
query_params,
|
|
141
|
+
header_params,
|
|
142
|
+
body=body_params,
|
|
143
|
+
post_params=form_params,
|
|
144
|
+
files=local_var_files,
|
|
145
|
+
response_type=None, # noqa: E501
|
|
146
|
+
auth_settings=auth_settings,
|
|
147
|
+
async_req=local_var_params.get('async_req'),
|
|
148
|
+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
149
|
+
_preload_content=local_var_params.get('_preload_content', True),
|
|
150
|
+
_request_timeout=local_var_params.get('_request_timeout'),
|
|
151
|
+
collection_formats=collection_formats)
|
|
152
|
+
|
|
153
|
+
def log_out(self, **kwargs): # noqa: E501
|
|
154
|
+
"""log_out # noqa: E501
|
|
155
|
+
|
|
156
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
157
|
+
asynchronous HTTP request, please pass async_req=True
|
|
158
|
+
>>> thread = api.log_out(async_req=True)
|
|
159
|
+
>>> result = thread.get()
|
|
160
|
+
|
|
161
|
+
:param async_req bool: execute request asynchronously
|
|
162
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
163
|
+
be returned without reading/decoding response
|
|
164
|
+
data. Default is True.
|
|
165
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
166
|
+
number provided, it will be total request
|
|
167
|
+
timeout. It can also be a pair (tuple) of
|
|
168
|
+
(connection, read) timeouts.
|
|
169
|
+
:return: None
|
|
170
|
+
If the method is called asynchronously,
|
|
171
|
+
returns the request thread.
|
|
172
|
+
"""
|
|
173
|
+
kwargs['_return_http_data_only'] = True
|
|
174
|
+
return self.log_out_with_http_info(**kwargs) # noqa: E501
|
|
175
|
+
|
|
176
|
+
def log_out_with_http_info(self, **kwargs): # noqa: E501
|
|
177
|
+
"""log_out # noqa: E501
|
|
178
|
+
|
|
179
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
180
|
+
asynchronous HTTP request, please pass async_req=True
|
|
181
|
+
>>> thread = api.log_out_with_http_info(async_req=True)
|
|
182
|
+
>>> result = thread.get()
|
|
183
|
+
|
|
184
|
+
:param async_req bool: execute request asynchronously
|
|
185
|
+
:param _return_http_data_only: response data without head status code
|
|
186
|
+
and headers
|
|
187
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
188
|
+
be returned without reading/decoding response
|
|
189
|
+
data. Default is True.
|
|
190
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
191
|
+
number provided, it will be total request
|
|
192
|
+
timeout. It can also be a pair (tuple) of
|
|
193
|
+
(connection, read) timeouts.
|
|
194
|
+
:return: None
|
|
195
|
+
If the method is called asynchronously,
|
|
196
|
+
returns the request thread.
|
|
197
|
+
"""
|
|
198
|
+
|
|
199
|
+
local_var_params = locals()
|
|
200
|
+
|
|
201
|
+
all_params = [
|
|
202
|
+
]
|
|
203
|
+
all_params.extend(
|
|
204
|
+
[
|
|
205
|
+
'async_req',
|
|
206
|
+
'_return_http_data_only',
|
|
207
|
+
'_preload_content',
|
|
208
|
+
'_request_timeout'
|
|
209
|
+
]
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
for key, val in six.iteritems(local_var_params['kwargs']):
|
|
213
|
+
if key not in all_params:
|
|
214
|
+
raise ApiTypeError(
|
|
215
|
+
"Got an unexpected keyword argument '%s'"
|
|
216
|
+
" to method log_out" % key
|
|
217
|
+
)
|
|
218
|
+
local_var_params[key] = val
|
|
219
|
+
del local_var_params['kwargs']
|
|
220
|
+
|
|
221
|
+
collection_formats = {}
|
|
222
|
+
|
|
223
|
+
path_params = {}
|
|
224
|
+
|
|
225
|
+
query_params = []
|
|
226
|
+
|
|
227
|
+
header_params = {}
|
|
228
|
+
|
|
229
|
+
form_params = []
|
|
230
|
+
local_var_files = {}
|
|
231
|
+
|
|
232
|
+
body_params = None
|
|
233
|
+
# HTTP header `Accept`
|
|
234
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
235
|
+
['*/*']) # noqa: E501
|
|
236
|
+
|
|
237
|
+
# Authentication setting
|
|
238
|
+
auth_settings = [] # noqa: E501
|
|
239
|
+
|
|
240
|
+
return self.api_client.call_api(
|
|
241
|
+
'/api/auth/logout', 'POST',
|
|
242
|
+
path_params,
|
|
243
|
+
query_params,
|
|
244
|
+
header_params,
|
|
245
|
+
body=body_params,
|
|
246
|
+
post_params=form_params,
|
|
247
|
+
files=local_var_files,
|
|
248
|
+
response_type=None, # noqa: E501
|
|
249
|
+
auth_settings=auth_settings,
|
|
250
|
+
async_req=local_var_params.get('async_req'),
|
|
251
|
+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
252
|
+
_preload_content=local_var_params.get('_preload_content', True),
|
|
253
|
+
_request_timeout=local_var_params.get('_request_timeout'),
|
|
254
|
+
collection_formats=collection_formats)
|
|
255
|
+
|
|
256
|
+
def verify_authenticated(self, **kwargs): # noqa: E501
|
|
257
|
+
"""verify_authenticated # noqa: E501
|
|
258
|
+
|
|
259
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
260
|
+
asynchronous HTTP request, please pass async_req=True
|
|
261
|
+
>>> thread = api.verify_authenticated(async_req=True)
|
|
262
|
+
>>> result = thread.get()
|
|
263
|
+
|
|
264
|
+
:param async_req bool: execute request asynchronously
|
|
265
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
266
|
+
be returned without reading/decoding response
|
|
267
|
+
data. Default is True.
|
|
268
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
269
|
+
number provided, it will be total request
|
|
270
|
+
timeout. It can also be a pair (tuple) of
|
|
271
|
+
(connection, read) timeouts.
|
|
272
|
+
:return: bool
|
|
273
|
+
If the method is called asynchronously,
|
|
274
|
+
returns the request thread.
|
|
275
|
+
"""
|
|
276
|
+
kwargs['_return_http_data_only'] = True
|
|
277
|
+
return self.verify_authenticated_with_http_info(**kwargs) # noqa: E501
|
|
278
|
+
|
|
279
|
+
def verify_authenticated_with_http_info(self, **kwargs): # noqa: E501
|
|
280
|
+
"""verify_authenticated # noqa: E501
|
|
281
|
+
|
|
282
|
+
This method makes a synchronous HTTP request by default. To make an
|
|
283
|
+
asynchronous HTTP request, please pass async_req=True
|
|
284
|
+
>>> thread = api.verify_authenticated_with_http_info(async_req=True)
|
|
285
|
+
>>> result = thread.get()
|
|
286
|
+
|
|
287
|
+
:param async_req bool: execute request asynchronously
|
|
288
|
+
:param _return_http_data_only: response data without head status code
|
|
289
|
+
and headers
|
|
290
|
+
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
|
291
|
+
be returned without reading/decoding response
|
|
292
|
+
data. Default is True.
|
|
293
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
294
|
+
number provided, it will be total request
|
|
295
|
+
timeout. It can also be a pair (tuple) of
|
|
296
|
+
(connection, read) timeouts.
|
|
297
|
+
:return: tuple(bool, status_code(int), headers(HTTPHeaderDict))
|
|
298
|
+
If the method is called asynchronously,
|
|
299
|
+
returns the request thread.
|
|
300
|
+
"""
|
|
301
|
+
|
|
302
|
+
local_var_params = locals()
|
|
303
|
+
|
|
304
|
+
all_params = [
|
|
305
|
+
]
|
|
306
|
+
all_params.extend(
|
|
307
|
+
[
|
|
308
|
+
'async_req',
|
|
309
|
+
'_return_http_data_only',
|
|
310
|
+
'_preload_content',
|
|
311
|
+
'_request_timeout'
|
|
312
|
+
]
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
for key, val in six.iteritems(local_var_params['kwargs']):
|
|
316
|
+
if key not in all_params:
|
|
317
|
+
raise ApiTypeError(
|
|
318
|
+
"Got an unexpected keyword argument '%s'"
|
|
319
|
+
" to method verify_authenticated" % key
|
|
320
|
+
)
|
|
321
|
+
local_var_params[key] = val
|
|
322
|
+
del local_var_params['kwargs']
|
|
323
|
+
|
|
324
|
+
collection_formats = {}
|
|
325
|
+
|
|
326
|
+
path_params = {}
|
|
327
|
+
|
|
328
|
+
query_params = []
|
|
329
|
+
|
|
330
|
+
header_params = {}
|
|
331
|
+
|
|
332
|
+
form_params = []
|
|
333
|
+
local_var_files = {}
|
|
334
|
+
|
|
335
|
+
body_params = None
|
|
336
|
+
# HTTP header `Accept`
|
|
337
|
+
header_params['Accept'] = self.api_client.select_header_accept(
|
|
338
|
+
['application/json']) # noqa: E501
|
|
339
|
+
|
|
340
|
+
# Authentication setting
|
|
341
|
+
auth_settings = ['belyAuth'] # noqa: E501
|
|
342
|
+
|
|
343
|
+
return self.api_client.call_api(
|
|
344
|
+
'/api/auth/Verify', 'GET',
|
|
345
|
+
path_params,
|
|
346
|
+
query_params,
|
|
347
|
+
header_params,
|
|
348
|
+
body=body_params,
|
|
349
|
+
post_params=form_params,
|
|
350
|
+
files=local_var_files,
|
|
351
|
+
response_type='bool', # noqa: E501
|
|
352
|
+
auth_settings=auth_settings,
|
|
353
|
+
async_req=local_var_params.get('async_req'),
|
|
354
|
+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
|
355
|
+
_preload_content=local_var_params.get('_preload_content', True),
|
|
356
|
+
_request_timeout=local_var_params.get('_request_timeout'),
|
|
357
|
+
collection_formats=collection_formats)
|