def get_change_for_period_for_type(self, type_id, from_date, to_date, st_code): """/Services/ObjectBase/GetChangedObjects.do""" builder = GetChangeBuilder() get_change_request = builder.build(type_id, from_date, to_date) response = HttpSender.send_request(get_change_request) assert response.status_code == st_code return response.json()
def get_objects_from_folder(self, id_folder, st_code): """/Services/CategoryObject/GetList.do""" builder = GetObjectsFromFolderRequestBuilder() get_tree_folders_request = builder.build(id_folder) response = HttpSender.send_request(get_tree_folders_request) assert response.status_code == st_code return response.json()
def create_object(self, lement_object, st_code): """/Services/ObjectBase/Create.do""" builder = CreateObjectRequestBuilder() create_object_request = builder.build(lement_object) response = HttpSender.send_request(create_object_request) assert response.status_code == st_code return response.json()
def get_default_template(self, lement_object, st_code): """/Services/ObjectsBase/Template/GetDefaultTemplate.do""" builder = GetDefaultTemplateBuilder() get_template_request = builder.build(lement_object) response = HttpSender.send_request(get_template_request) assert response.status_code == st_code return response.json()
def get_actions_by_id(self, object_id, st_code): """/Services/Action/GetList.do""" builder = GetActionRequestBuilder() get_action_request = builder.build(object_id) response = HttpSender.send_request(get_action_request) assert response.status_code == st_code return response.json()
def get_object(self, object_id, st_code): """/Services/ObjectBase/Get.do""" builder = GetObjectRequestBuilder() get_object_request = builder.build(object_id) response = HttpSender.send_request(get_object_request) assert response.status_code == st_code return response.json()
def get_values_by_attribute(self, atribut, st_code): """/Services/ObjectTypes/AttributeListOfValues/GetValuesByAttribute.do""" builder = GetValuesByAttributeBuilder() get_values_by_attribute_request = builder.build(atribut) response = HttpSender.send_request(get_values_by_attribute_request) assert response.status_code == st_code return response.json()
def get_all_types_for_category(self, id_category, st_code): get_all_types_request_builder = GetAllTypesRequestBuilder() get_all_types_request = get_all_types_request_builder.build( id_category) response = HttpSender.send_request(get_all_types_request) assert response.status_code == st_code return response.json()
def send_massage_to_external_user(self, object, external_emails_list, message, st_code): """/Services/Action/Create.do""" builder = SendMessageToExternalUserRequestBuilder() get_tree_folders_request = builder.build(object, external_emails_list, message) response = HttpSender.send_request(get_tree_folders_request) assert response.status_code == st_code return response.json()
def login(self, username, password, rememberme, host, st_code): login_request_builder = LoginRequestBuilder() login_request = login_request_builder.build_login_request( username, password, rememberme) response = HttpSender.send_request(login_request, host) assert response.status_code == st_code if response.cookies: BaseHttpRequest.auth_cookies['auth'] = response.cookies['auth'] BaseHttpRequest.auth_cookies['host'] = host return response.json()
def get_employee_detail(self, employ_id, st_code): builder = GetEmployeeDetailRequestBuilder() get_tree_folders_request = builder.build(employ_id) response = HttpSender.send_request(get_tree_folders_request) assert response.status_code == st_code return response.json()
def get_objects_from_dict(self, id_dict, st_code): builder = GetObjectsFromDictRequestBuilder() get_tree_folders_request = builder.build(id_dict) response = HttpSender.send_request(get_tree_folders_request) assert response.status_code == st_code return response.json()
def get_all_categoty(self, st_code): get_all_categoty_request_builder = GetAllCategoryRequestBuilder() get_all_categoty_request = get_all_categoty_request_builder.build() response = HttpSender.send_request(get_all_categoty_request) assert response.status_code == st_code return response.json()
def remove_folder(self, folder_object, category_id, st_code): builder = CreateFolderRequestBuilder() create_folder_request = builder.build(folder_object, category_id) response = HttpSender.send_request(create_folder_request) assert response.status_code == st_code return response.json()
def get_tree_folders_for_category(self, id_categiry, st_code): builder = GetTreeFolderCategoryRequestBuilder() get_tree_folders_request = builder.build(id_categiry) response = HttpSender.send_request(get_tree_folders_request) assert response.status_code == st_code return response.json()
def get_operations(self, date_from, date_to, st_code): builder = GetOperationLogRequestBuilder() get_operations_request = builder.build(date_from, date_to) response = HttpSender.send_request(get_operations_request) assert response.status_code == st_code return response.json()
def get_employs(self, department, include_sub_dep, st_code): builder = GetListEmploysBuilder() get_id_request = builder.build(department, include_sub_dep) response = HttpSender.send_request(get_id_request) assert response.status_code == st_code return response.json()