From 90e469feac7ddb23fa1850c05799818ca5a54cbf Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Mon, 28 Aug 2023 14:22:41 +0300 Subject: [PATCH] Added Python client, updated TS typings, readme --- .github/workflows/static.yml | 4 +- README.md | 10 +- generate.sh | 14 +- src/cinode-py-client/.gitignore | 23 + src/cinode-py-client/README.md | 131 +++ .../cinode_api_client/__init__.py | 7 + .../cinode_api_client/api/__init__.py | 1 + .../cinode_api_client/api/absence/__init__.py | 0 .../cinode_api_client/api/absence/absence.py | 196 +++++ .../api/absence/delete_absence.py | 191 +++++ .../api/absence/new_absence.py | 206 +++++ .../api/absence/update_absence.py | 217 +++++ .../api/absence_type/__init__.py | 0 .../api/absence_type/absence_types.py | 173 ++++ .../api/absences/__init__.py | 0 .../api/absences/absences.py | 185 +++++ .../api/availability/__init__.py | 0 .../api/availability/search_availability.py | 193 +++++ .../cinode_api_client/api/company/__init__.py | 0 .../cinode_api_client/api/company/company.py | 168 ++++ .../api/company_address_users/__init__.py | 0 .../company_address_users.py | 184 +++++ .../api/company_candidate/__init__.py | 0 .../add_company_candidate.py | 194 +++++ .../api/company_candidate/candidate.py | 187 +++++ .../delete_company_candidate.py | 189 +++++ .../api/company_candidate/invite_candidate.py | 207 +++++ .../patch_company_candidate.py | 209 +++++ .../api/company_candidate_event/__init__.py | 0 .../company_candidate_event.py | 204 +++++ .../__init__.py | 0 .../company_candidate_event_meeting.py | 204 +++++ .../delete_company_candidate_event_meeting.py | 199 +++++ .../new_company_candidate_event_meeting.py | 208 +++++ .../update_company_candidate_event_meeting.py | 219 ++++++ .../__init__.py | 0 .../company_candidate_meeting_event_list.py | 192 +++++ .../company_candidate_event_note/__init__.py | 0 .../company_candidate_event_note.py | 204 +++++ .../delete_company_candidate_event_note.py | 199 +++++ .../new_company_candidate_event_note.py | 208 +++++ .../update_company_candidate_event_note.py | 219 ++++++ .../company_candidate_event_notes/__init__.py | 0 .../company_candidate_note_event_list.py | 192 +++++ .../company_candidate_event_task/__init__.py | 0 .../company_candidate_event_task.py | 204 +++++ .../delete_company_candidate_event_task.py | 199 +++++ .../new_company_candidate_event_task.py | 208 +++++ .../update_company_candidate_event_task.py | 219 ++++++ .../company_candidate_event_tasks/__init__.py | 0 .../company_candidate_task_event_list.py | 192 +++++ .../api/company_candidate_events/__init__.py | 0 .../company_candidate_events.py | 192 +++++ .../__init__.py | 0 .../get_candidate_attachment.py | 200 +++++ .../__init__.py | 0 .../candidate_attachment.py | 205 +++++ .../company_candidate_pipelines/__init__.py | 0 .../candidate_pipelines.py | 178 +++++ .../api/company_candidate_skills/__init__.py | 0 .../delete_company_candidate_skill.py | 207 +++++ .../new_company_candidate_skill.py | 243 ++++++ .../__init__.py | 0 .../candidate_uri_attachment.py | 205 +++++ .../delete_candidate_uri_attachment.py | 199 +++++ .../__init__.py | 0 .../get_candidate_uri_attachment.py | 202 +++++ .../api/company_candidates/__init__.py | 0 .../api/company_candidates/candidates.py | 178 +++++ .../api/company_capabilities/__init__.py | 0 .../company_capabilities.py | 168 ++++ .../api/company_currencies/__init__.py | 0 .../company_currencies/company_currencies.py | 176 +++++ .../api/company_customer/__init__.py | 0 .../delete_company_customer.py | 203 +++++ .../company_customer/get_company_customer.py | 190 +++++ .../company_customer/new_company_customer.py | 191 +++++ .../patch_company_customer.py | 209 +++++ .../update_company_customer.py | 205 +++++ .../api/company_customer_address/__init__.py | 0 .../customer_address.py | 204 +++++ .../delete_company_customer_address.py | 199 +++++ .../edit_company_customer_address.py | 219 ++++++ .../new_company_customer_address.py | 205 +++++ .../api/company_customer_contact/__init__.py | 0 .../api/company_customer_contact/contact.py | 204 +++++ .../delete_company_customer_contact.py | 199 +++++ .../edit_company_customer_contact.py | 219 ++++++ .../new_company_customer_contact.py | 205 +++++ .../company_customer_contact_tags/__init__.py | 0 .../edit_customer_contact_tags.py | 301 +++++++ .../api/company_customer_contacts/__init__.py | 0 .../api/company_customer_contacts/contacts.py | 192 +++++ .../api/company_customer_event/__init__.py | 0 .../company_customer_event.py | 204 +++++ .../api/company_customer_events/__init__.py | 0 .../company_customer_events.py | 192 +++++ .../__init__.py | 0 .../company_customer_event_meeting.py | 204 +++++ .../delete_meeting.py | 199 +++++ .../new_meeting.py | 205 +++++ .../update_meeting.py | 219 ++++++ .../__init__.py | 0 .../company_customer_event_meetings.py | 192 +++++ .../company_customer_events_note/__init__.py | 0 .../company_customer_event_note.py | 204 +++++ .../delete_note.py | 199 +++++ .../company_customer_events_note/new_note.py | 205 +++++ .../update_note.py | 219 ++++++ .../company_customer_events_notes/__init__.py | 0 .../company_customer_event_notes.py | 192 +++++ .../company_customer_events_task/__init__.py | 0 .../company_customer_event_task.py | 204 +++++ .../delete_task.py | 199 +++++ .../company_customer_events_task/new_task.py | 205 +++++ .../update_task.py | 219 ++++++ .../company_customer_events_tasks/__init__.py | 0 .../company_customer_event_tasks.py | 192 +++++ .../__init__.py | 0 .../get_customer_attachment.py | 200 +++++ .../api/company_customer_managers/__init__.py | 0 .../add_company_customer_responsible.py | 244 ++++++ .../company_customer_managers.py | 198 +++++ .../remove_customer_manager.py | 207 +++++ .../api/company_customer_tags/__init__.py | 0 .../edit_customer_tags.py | 283 +++++++ .../api/company_customers/__init__.py | 0 .../company_customers/company_customers.py | 178 +++++ .../company_customers_extended/__init__.py | 0 .../customers_extended.py | 178 +++++ .../api/company_image/__init__.py | 0 .../api/company_image/company_image.py | 180 +++++ .../company_image/company_image_download.py | 192 +++++ .../api/company_images/__init__.py | 0 .../api/company_images/add_company_image.py | 197 +++++ .../api/company_images/company_images.py | 182 +++++ .../api/company_managers/__init__.py | 0 .../api/company_managers/company_managers.py | 192 +++++ .../api/company_profiles/__init__.py | 0 .../api/company_profiles/company_profiles.py | 242 ++++++ .../__init__.py | 0 .../get_project_attachment.py | 200 +++++ .../company_recruitment_managers/__init__.py | 0 .../recruitment_managers.py | 178 +++++ .../api/company_resumes/__init__.py | 0 .../api/company_resumes/company_resumes.py | 178 +++++ .../company_subcontractor_group/__init__.py | 0 .../get_company_subcontractor_group.py | 190 +++++ .../__init__.py | 0 .../add_company_subcontractor_group_member.py | 203 +++++ ...lete_company_subcontractor_group_member.py | 199 +++++ .../company_subcontractor_groups/__init__.py | 0 .../get_company_subcontractor_groups.py | 181 +++++ .../api/company_tag/__init__.py | 0 .../api/company_tag/company_tag.py | 204 +++++ .../api/company_tags/__init__.py | 0 .../api/company_tags/company_tags.py | 192 +++++ .../api/company_team/__init__.py | 0 .../api/company_team/new_team.py | 191 +++++ .../api/company_team/team.py | 182 +++++ .../api/company_team/update_team.py | 205 +++++ .../api/company_team_managers/__init__.py | 0 .../company_team_managers/add_team_manager.py | 234 ++++++ .../remove_team_manager.py | 207 +++++ .../company_team_managers/team_managers.py | 184 +++++ .../api/company_team_member/__init__.py | 0 .../company_team_member/add_team_member.py | 205 +++++ .../company_team_member/get_team_member.py | 196 +++++ .../company_team_member/move_team_member.py | 220 ++++++ .../company_team_member/remove_team_member.py | 199 +++++ .../company_team_member/update_team_member.py | 219 ++++++ .../api/company_team_members/__init__.py | 0 .../company_team_members/get_team_members.py | 184 +++++ .../api/company_team_users/__init__.py | 0 .../api/company_team_users/add_team_user.py | 210 +++++ .../api/company_team_users/get_team_users.py | 184 +++++ .../company_team_users/remove_team_user.py | 206 +++++ .../api/company_teams/__init__.py | 0 .../api/company_teams/company_teams.py | 173 ++++ .../api/company_user/__init__.py | 0 .../api/company_user/add_company_user.py | 191 +++++ .../api/company_user/delete_company_user.py | 228 ++++++ .../api/company_user/patch_company_user.py | 209 +++++ .../api/company_user/update_company_user.py | 205 +++++ .../api/company_user/user.py | 182 +++++ .../api/company_user_convert/__init__.py | 0 .../convert_user_to_aad_account.py | 203 +++++ .../company_user_employee_event/__init__.py | 0 .../company_user_employee_event.py | 204 +++++ .../__init__.py | 0 .../company_user_employee_event_meeting.py | 204 +++++ ...ete_company_user_employee_event_meeting.py | 199 +++++ ...new_company_user_employee_event_meeting.py | 208 +++++ ...ate_company_user_employee_event_meeting.py | 219 ++++++ .../__init__.py | 0 .../company_user_employee_event_note.py | 204 +++++ ...delete_company_user_employee_event_note.py | 199 +++++ .../new_company_user_employee_event_note.py | 208 +++++ ...update_company_user_employee_event_note.py | 219 ++++++ .../__init__.py | 0 .../company_user_employee_event_task.py | 204 +++++ ...delete_company_user_employee_event_task.py | 199 +++++ .../new_company_user_employee_event_task.py | 208 +++++ ...update_company_user_employee_event_task.py | 219 ++++++ .../company_user_employee_events/__init__.py | 0 .../company_user_employee_events.py | 195 +++++ .../__init__.py | 0 ...ompany_user_employee_event_meeting_list.py | 192 +++++ .../__init__.py | 0 .../company_user_employee_event_note_list.py | 192 +++++ .../__init__.py | 0 .../company_user_employee_event_task_list.py | 192 +++++ .../api/company_user_full/__init__.py | 0 .../api/company_user_full/user_full.py | 190 +++++ .../api/company_user_permissions/__init__.py | 0 .../update_permissions.py | 210 +++++ .../api/company_user_profile/__init__.py | 0 .../company_user_profile.py | 185 +++++ .../new_company_user_profile.py | 206 +++++ .../__init__.py | 0 .../company_user_profile_commitment.py | 199 +++++ .../delete_company_user_profile_commitment.py | 191 +++++ .../new_company_user_profile_commitment.py | 206 +++++ .../update_company_user_profile_commitment.py | 217 +++++ .../__init__.py | 0 .../company_user_profile_education.py | 199 +++++ .../delete_company_user_profile_education.py | 191 +++++ .../new_company_user_profile_education.py | 206 +++++ .../update_company_user_profile_education.py | 217 +++++ .../company_user_profile_employer/__init__.py | 0 .../company_user_profile_employer.py | 199 +++++ .../delete_company_user_profile_employer.py | 191 +++++ .../new_company_user_profile_employer.py | 206 +++++ .../update_company_user_profile_employer.py | 217 +++++ .../__init__.py | 0 .../company_user_profile_ext_skill.py | 199 +++++ .../delete_company_user_profile_ext_skill.py | 191 +++++ .../new_company_user_profile_ext_skill.py | 206 +++++ .../update_company_user_profile_ext_skill.py | 217 +++++ .../company_user_profile_import/__init__.py | 0 .../create_company_user_profile_import.py | 218 +++++ .../get_company_user_profile_import.py | 227 ++++++ .../company_user_profile_language/__init__.py | 0 .../company_user_profile_language.py | 199 +++++ .../delete_company_user_profile_language.py | 191 +++++ .../new_company_user_profile_language.py | 206 +++++ .../update_company_user_profile_language.py | 217 +++++ .../__init__.py | 0 .../profile_languages.py | 145 ++++ .../__init__.py | 0 .../company_user_profile_presentation.py | 185 +++++ ...pdate_company_user_profile_presentation.py | 203 +++++ .../__init__.py | 0 .../company_user_profile_reference.py | 199 +++++ .../delete_company_user_profile_reference.py | 191 +++++ .../new_company_user_profile_reference.py | 206 +++++ .../update_company_user_profile_reference.py | 217 +++++ .../company_user_profile_skill/__init__.py | 0 .../company_user_profile_skill.py | 199 +++++ .../delete_company_user_profile_skill.py | 191 +++++ .../new_company_user_profile_skill.py | 206 +++++ .../update_company_user_profile_skill.py | 217 +++++ .../company_user_profile_training/__init__.py | 0 .../company_user_profile_training.py | 199 +++++ .../delete_company_user_profile_training.py | 191 +++++ .../new_company_user_profile_training.py | 206 +++++ .../update_company_user_profile_training.py | 217 +++++ .../__init__.py | 0 .../company_user_profile_work_experience.py | 199 +++++ ...te_company_user_profile_work_experience.py | 191 +++++ ...ew_company_user_profile_work_experience.py | 206 +++++ ...te_company_user_profile_work_experience.py | 217 +++++ .../api/company_user_profiles/__init__.py | 0 .../company_user_profiles.py | 187 +++++ .../api/company_user_resume/__init__.py | 0 .../api/company_user_resume/get_resume.py | 204 +++++ .../api/company_user_resumes/__init__.py | 0 .../company_user_resumes.py | 195 +++++ .../api/company_user_roles/__init__.py | 0 .../company_user_roles/company_user_roles.py | 190 +++++ .../api/company_user_skill/__init__.py | 0 .../api/company_user_skill/skill.py | 196 +++++ .../api/company_user_skills/__init__.py | 0 .../api/company_user_skills/skills.py | 184 +++++ .../company_user_subcontractor/__init__.py | 0 .../add_company_user_subcontractor.py | 191 +++++ .../company_subcontractor.py | 190 +++++ .../delete_company_subcontractor.py | 224 ++++++ .../__init__.py | 0 .../company_user_subcontractor_event.py | 204 +++++ .../__init__.py | 0 ...ompany_user_subcontractor_event_meeting.py | 204 +++++ ...ompany_user_subcontractor_event_meeting.py | 199 +++++ ...ompany_user_subcontractor_event_meeting.py | 208 +++++ ...ompany_user_subcontractor_event_meeting.py | 219 ++++++ .../__init__.py | 0 .../company_user_subcontractor_event_note.py | 204 +++++ ...e_company_user_subcontractor_event_note.py | 199 +++++ ...w_company_user_subcontractor_event_note.py | 208 +++++ ...e_company_user_subcontractor_event_note.py | 219 ++++++ .../__init__.py | 0 .../company_user_subcontractor_event_task.py | 204 +++++ ...e_company_user_subcontractor_event_task.py | 199 +++++ ...w_company_user_subcontractor_event_task.py | 208 +++++ ...e_company_user_subcontractor_event_task.py | 219 ++++++ .../__init__.py | 0 .../company_user_subcontractor_events.py | 192 +++++ .../__init__.py | 0 ...y_user_subcontractor_event_meeting_list.py | 192 +++++ .../__init__.py | 0 ...company_user_subcontractor_events_notes.py | 192 +++++ .../__init__.py | 0 ...company_user_subcontractor_events_tasks.py | 192 +++++ .../__init__.py | 0 .../get_subcontractor_attachment.py | 200 +++++ .../__init__.py | 0 .../subcontractor_attachment.py | 207 +++++ .../__init__.py | 0 .../get_subcontractor_role.py | 204 +++++ .../get_subcontractor_roles.py | 190 +++++ .../company_user_subcontractors/__init__.py | 0 .../company_user_subcontractors.py | 178 +++++ .../api/company_user_tags/__init__.py | 0 .../edit_company_user_tags.py | 279 +++++++ .../api/company_user_teams/__init__.py | 0 .../api/company_user_teams/user_teams.py | 184 +++++ .../api/company_users/__init__.py | 0 .../api/company_users/company_users.py | 170 ++++ .../api/company_users_extended/__init__.py | 0 .../company_users_extended.py | 170 ++++ .../api/company_webhook/__init__.py | 0 .../install_webhook_manifest.py | 198 +++++ .../api/company_webhook/new_webhook.py | 273 +++++++ .../api/company_webhook/remove_webhook.py | 199 +++++ .../api/company_webhooks/__init__.py | 0 .../api/company_webhooks/company_webhooks.py | 192 +++++ .../dynamic_company_user_resume/__init__.py | 0 .../dynamic_resume.py | 204 +++++ .../api/keyword_search/__init__.py | 0 .../api/keyword_search/search_keyword.py | 184 +++++ .../api/mentions/__init__.py | 0 .../api/mentions/translate_mentions.py | 189 +++++ .../api/partners/__init__.py | 0 .../api/partners/search_partners.py | 192 +++++ .../cinode_api_client/api/project/__init__.py | 0 .../api/project/delete_company_project.py | 185 +++++ .../api/project/new_company_project.py | 191 +++++ .../cinode_api_client/api/project/project.py | 190 +++++ .../api/project/update_company_project.py | 205 +++++ .../api/project_assignment/__init__.py | 0 .../announce_project_assignment.py | 238 ++++++ .../delete_project_assignment.py | 201 +++++ .../new_project_assignment.py | 205 +++++ .../old_project_assignment.py | 204 +++++ .../project_assignment/project_assignment.py | 204 +++++ .../update_project_assignment.py | 219 ++++++ .../api/project_assignment_member/__init__.py | 0 .../add_project_assignment_member_employee.py | 219 ++++++ ...project_assignment_member_subcontractor.py | 219 ++++++ ...lete_project_assignment_member_employee.py | 215 +++++ ...date_project_assignment_member_employee.py | 233 ++++++ ...project_assignment_member_subcontractor.py | 233 ++++++ .../api/project_assignment_skills/__init__.py | 0 .../add_project_assignment_skill.py | 219 ++++++ .../delete_project_assignment_skill.py | 215 +++++ .../update_project_assignment_skill.py | 233 ++++++ .../api/project_assignments/__init__.py | 0 .../api/project_assignments/search_roles.py | 198 +++++ .../api/project_event/__init__.py | 0 .../api/project_event/project_event.py | 204 +++++ .../api/project_events/__init__.py | 0 .../api/project_events/project_events.py | 192 +++++ .../api/project_events_meeting/__init__.py | 0 .../delete_project_meeting.py | 199 +++++ .../new_project_meeting.py | 205 +++++ .../project_event_meeting.py | 204 +++++ .../update_project_meeting.py | 219 ++++++ .../api/project_events_meetings/__init__.py | 0 .../project_event_meetings.py | 192 +++++ .../api/project_events_note/__init__.py | 0 .../delete_project_note.py | 199 +++++ .../project_events_note/new_project_note.py | 205 +++++ .../project_events_note/project_event_note.py | 204 +++++ .../update_project_note.py | 219 ++++++ .../api/project_events_notes/__init__.py | 0 .../project_event_notes.py | 192 +++++ .../api/project_events_task/__init__.py | 0 .../delete_project_task.py | 199 +++++ .../project_events_task/new_project_task.py | 205 +++++ .../project_events_task/project_event_task.py | 204 +++++ .../update_project_task.py | 219 ++++++ .../api/project_events_tasks/__init__.py | 0 .../project_event_tasks.py | 192 +++++ .../api/project_pipelines/__init__.py | 0 .../project_pipelines/project_pipelines.py | 178 +++++ .../api/project_reference/__init__.py | 0 .../project_reference/project_reference.py | 204 +++++ .../api/project_references/__init__.py | 0 .../project_references/project_references.py | 192 +++++ .../api/project_tags/__init__.py | 0 .../api/project_tags/edit_project_tags.py | 283 +++++++ .../api/projects/__init__.py | 0 .../api/projects/projects.py | 182 +++++ .../api/recruitment_sources/__init__.py | 0 .../recruitment_sources.py | 178 +++++ .../api/search_company_candidate/__init__.py | 0 .../search_company_candidate.py | 259 ++++++ .../__init__.py | 0 .../search_company_customer_contact.py | 191 +++++ .../api/search_company_customers/__init__.py | 0 .../search_company_customer.py | 191 +++++ .../api/search_company_user/__init__.py | 0 .../search_company_user.py | 183 +++++ .../api/search_project/__init__.py | 0 .../api/search_project/search_project.py | 263 +++++++ .../api/skill_search/__init__.py | 0 .../api/skill_search/search_skill.py | 186 +++++ .../api/skill_search_term/__init__.py | 0 .../skill_search_term/search_skill_term.py | 186 +++++ .../cinode_api_client/client.py | 268 +++++++ .../cinode_api_client/errors.py | 14 + .../cinode_api_client/models/__init__.py | 665 ++++++++++++++++ .../models/abscence_period_day_model.py | 53 ++ .../models/absence_add_edit_model.py | 74 ++ .../models/absence_period_dto_model.py | 160 ++++ .../models/absence_period_model.py | 107 +++ .../models/absence_type_dto.py | 46 ++ .../models/absence_type_model.py | 46 ++ .../cinode_api_client/models/access_level.py | 21 + .../cinode_api_client/models/action_type.py | 11 + .../add_company_image_multipart_data.py | 93 +++ ...ompany_subcontractor_group_member_model.py | 38 + .../models/address_info_block_view_model.py | 86 ++ .../cinode_api_client/models/address_type.py | 11 + .../models/attachment_type.py | 9 + .../models/availability_filter_model.py | 59 ++ .../models/availability_model.py | 79 ++ .../models/calendar_day_model.py | 104 +++ .../candidate_attachment_multipart_data.py | 117 +++ .../classic_company_user_resume_model.py | 246 ++++++ .../models/commitment_block_item_model.py | 166 ++++ .../models/commitment_block_model.py | 135 ++++ .../models/company_address_model.py | 155 ++++ .../models/company_base_model.py | 90 +++ .../company_candidate_add_invite_model.py | 46 ++ .../models/company_candidate_add_model.py | 277 +++++++ .../company_candidate_attachment_model.py | 119 +++ .../models/company_candidate_base_model.py | 168 ++++ .../company_candidate_event_base_model.py | 141 ++++ .../company_candidate_event_meeting_model.py | 312 ++++++++ .../models/company_candidate_event_model.py | 237 ++++++ .../company_candidate_event_note_model.py | 280 +++++++ .../company_candidate_event_task_model.py | 323 ++++++++ .../company_candidate_extended_model.py | 419 ++++++++++ ...ny_candidate_file_attachment_list_model.py | 99 +++ ...company_candidate_file_attachment_model.py | 135 ++++ .../company_candidate_pipeline_model.py | 82 ++ .../company_candidate_pipeline_stage_model.py | 70 ++ .../models/company_candidate_query_sort.py | 13 + ...idate_query_sort_page_and_sort_by_model.py | 93 +++ .../company_candidate_skill_add_model.py | 62 ++ .../models/company_candidate_skill_model.py | 97 +++ .../models/company_candidate_state.py | 12 + ...pany_candidate_uri_attachment_add_model.py | 54 ++ .../company_candidate_uri_attachment_model.py | 127 +++ .../models/company_capabilities_model.py | 58 ++ .../models/company_customer_add_model.py | 181 +++++ ...company_customer_address_add_edit_model.py | 110 +++ .../models/company_customer_address_model.py | 163 ++++ .../company_customer_attachment_model.py | 119 +++ .../models/company_customer_base_model.py | 127 +++ ...company_customer_contact_add_edit_model.py | 87 ++ .../company_customer_contact_base_model.py | 114 +++ .../models/company_customer_contact_model.py | 189 +++++ .../company_customer_contact_query_sort.py | 13 + ...ntact_query_sort_page_and_sort_by_model.py | 93 +++ .../models/company_customer_delete_model.py | 38 + .../models/company_customer_edit_model.py | 156 ++++ .../models/company_customer_extended_model.py | 185 +++++ .../models/company_customer_manager_model.py | 171 ++++ ...ompany_customer_managers_add_edit_model.py | 43 + .../models/company_customer_model.py | 434 ++++++++++ .../models/company_customer_query_sort.py | 22 + ...tomer_query_sort_page_and_sort_by_model.py | 111 +++ .../models/company_enabled_module_model.py | 106 +++ .../models/company_image_model.py | 150 ++++ .../cinode_api_client/models/company_model.py | 223 ++++++ .../models/company_profile_filter_model.py | 71 ++ .../models/company_profile_sort.py | 11 + ...any_profile_sort_page_and_sort_by_model.py | 84 ++ .../models/company_profiles_model.py | 66 ++ .../company_recruitment_manager_model.py | 135 ++++ .../company_resume_template_base_model.py | 46 ++ .../company_resume_template_language_model.py | 70 ++ .../cinode_api_client/models/company_size.py | 16 + .../company_subcontractor_group_base_model.py | 90 +++ .../company_subcontractor_group_model.py | 133 ++++ .../models/company_tag_base_model.py | 62 ++ .../models/company_tag_model.py | 86 ++ .../models/company_tag_type_model.py | 46 ++ .../models/company_user_add_model.py | 198 +++++ .../models/company_user_base_model.py | 135 ++++ .../models/company_user_edit_model.py | 302 +++++++ .../models/company_user_event_base_model.py | 141 ++++ ...mpany_user_event_meeting_add_edit_model.py | 180 +++++ .../company_user_event_meeting_model.py | 312 ++++++++ .../models/company_user_event_model.py | 237 ++++++ .../company_user_event_note_add_edit_model.py | 156 ++++ .../models/company_user_event_note_model.py | 280 +++++++ .../company_user_event_task_add_edit_model.py | 199 +++++ .../models/company_user_event_task_model.py | 323 ++++++++ .../models/company_user_extended_model.py | 330 ++++++++ .../models/company_user_full_model.py | 685 ++++++++++++++++ .../models/company_user_image_model.py | 108 +++ .../company_user_info_block_view_model.py | 70 ++ .../models/company_user_model.py | 637 +++++++++++++++ .../company_user_permissions_edit_model.py | 53 ++ .../company_user_profile_add_edit_model.py | 38 + .../models/company_user_profile_base_model.py | 209 +++++ ..._user_profile_commitment_add_edit_model.py | 102 +++ .../company_user_profile_commitment_model.py | 163 ++++ ...er_profile_commitment_translation_model.py | 85 ++ ...y_user_profile_education_add_edit_model.py | 141 ++++ .../company_user_profile_education_model.py | 171 ++++ ...ser_profile_education_translation_model.py | 109 +++ ...ny_user_profile_employer_add_edit_model.py | 110 +++ .../company_user_profile_employer_model.py | 169 ++++ ...user_profile_employer_translation_model.py | 101 +++ ...y_user_profile_ext_skill_add_edit_model.py | 38 + .../company_user_profile_ext_skill_model.py | 123 +++ ...ser_profile_ext_skill_translation_model.py | 85 ++ .../models/company_user_profile_full_model.py | 442 +++++++++++ ...ny_user_profile_language_add_edit_model.py | 66 ++ ...pany_user_profile_language_branch_model.py | 78 ++ .../company_user_profile_language_model.py | 126 +++ ...ny_user_profile_presentation_edit_model.py | 54 ++ ...company_user_profile_presentation_model.py | 119 +++ ..._profile_presentation_translation_model.py | 93 +++ ...y_user_profile_reference_add_edit_model.py | 94 +++ .../company_user_profile_reference_model.py | 165 ++++ ...ser_profile_reference_translation_model.py | 101 +++ .../company_user_profile_skill_add_model.py | 54 ++ .../company_user_profile_skill_edit_model.py | 46 ++ ...ompany_user_profile_skill_history_model.py | 90 +++ .../company_user_profile_skill_model.py | 220 ++++++ ...ny_user_profile_skill_translation_model.py | 125 +++ ...ny_user_profile_training_add_edit_model.py | 126 +++ .../company_user_profile_training_model.py | 182 +++++ ...user_profile_training_translation_model.py | 109 +++ .../company_user_profile_translation_model.py | 77 ++ ..._profile_work_experience_add_edit_model.py | 150 ++++ ...pany_user_profile_work_experience_model.py | 206 +++++ ...profile_work_experience_skill_add_model.py | 45 ++ ...ofile_work_experience_translation_model.py | 101 +++ .../company_user_project_assignment_model.py | 81 ++ .../models/company_user_query_sort.py | 12 + ..._user_query_sort_page_and_sort_by_model.py | 91 +++ .../models/company_user_resume_base_model.py | 194 +++++ .../models/company_user_search_skill_model.py | 248 ++++++ .../models/company_user_skill_model.py | 162 ++++ .../models/company_user_status.py | 10 + ...mpany_user_subcontractor_add_edit_model.py | 194 +++++ ...any_user_subcontractor_attachment_model.py | 119 +++ .../company_user_subcontractor_base_model.py | 306 +++++++ ...ubcontractor_file_attachment_list_model.py | 101 +++ ...ser_subcontractor_file_attachment_model.py | 135 ++++ .../company_user_subcontractor_model.py | 460 +++++++++++ ...ny_user_subcontractor_role_member_model.py | 109 +++ .../company_user_subcontractor_roles_model.py | 81 ++ .../company_user_subcontractor_status.py | 9 + .../models/company_user_type.py | 12 + .../cinode_api_client/models/contract_type.py | 9 + ...nvert_company_user_to_aad_account_model.py | 38 + .../cinode_api_client/models/country_model.py | 54 ++ ...pany_user_profile_import_multipart_data.py | 93 +++ .../cinode_api_client/models/created_model.py | 73 ++ .../models/currency_model.py | 54 ++ .../models/customer_event_base_model.py | 141 ++++ .../customer_event_meeting_add_edit_model.py | 180 +++++ .../models/customer_event_meeting_model.py | 320 ++++++++ .../models/customer_event_model.py | 237 ++++++ .../customer_event_note_add_edit_model.py | 156 ++++ .../models/customer_event_note_model.py | 288 +++++++ .../customer_event_task_add_edit_model.py | 199 +++++ .../models/customer_event_task_model.py | 331 ++++++++ .../dynamic_company_user_resume_model.py | 246 ++++++ .../models/dynamic_template_view_model.py | 744 ++++++++++++++++++ ...mplate_view_model_primary_script_assets.py | 239 ++++++ ...emplate_view_model_primary_style_assets.py | 239 ++++++ .../models/education_block_item_model.py | 206 +++++ .../models/education_block_model.py | 127 +++ .../models/employer_block_item_model.py | 166 ++++ .../models/employer_block_model.py | 127 +++ .../cinode_api_client/models/error_model.py | 70 ++ .../models/event_comment_model.py | 87 ++ .../models/event_meeting_add_edit_model.py | 172 ++++ .../models/event_note_add_edit_model.py | 148 ++++ .../models/event_note_type.py | 10 + .../models/event_status_value.py | 12 + .../models/event_task_add_edit_model.py | 191 +++++ .../models/event_task_type.py | 10 + .../cinode_api_client/models/event_type.py | 11 + .../models/event_visibility.py | 9 + .../cinode_api_client/models/extent_type.py | 9 + .../models/extra_skill_block_model.py | 95 +++ .../models/extra_skill_item_block_model.py | 116 +++ .../cinode_api_client/models/filter_model.py | 51 ++ ...ighted_work_experience_block_item_model.py | 218 +++++ ...highlighted_work_experience_block_model.py | 159 ++++ .../models/i_company_address_view_model.py | 102 +++ .../i_company_candidate_patch_document.py | 111 +++ .../i_company_user_employee_patch_document.py | 358 +++++++++ .../models/i_contact_info_view_model.py | 93 +++ .../models/i_dynamic_block_view_model.py | 138 ++++ .../models/i_template_company.py | 94 +++ .../models/i_template_image.py | 159 ++++ .../models/i_template_logotype.py | 111 +++ .../i_template_shared_asset_view_model.py | 62 ++ .../i_template_style_asset_view_model.py | 78 ++ .../models/i_template_user_info.py | 154 ++++ .../models/image_block_model.py | 106 +++ .../cinode_api_client/models/image_size.py | 23 + .../models/import_profile_async_operation.py | 98 +++ .../cinode_api_client/models/keyword_model.py | 141 ++++ .../models/keyword_synonym_model.py | 102 +++ .../cinode_api_client/models/keyword_type.py | 27 + .../models/language_block_model.py | 95 +++ .../models/language_item_block_model.py | 156 ++++ .../models/language_level.py | 12 + .../cinode_api_client/models/link.py | 59 ++ .../models/location_block_model.py | 150 ++++ .../models/location_model.py | 142 ++++ .../models/long_running_status.py | 10 + .../models/mention_text_model.py | 38 + .../cinode_api_client/models/module_type.py | 37 + .../cinode_api_client/models/operation.py | 90 +++ .../models/operation_value.py | 44 ++ .../models/partner_base_model.py | 122 +++ .../models/partner_connection_base_model.py | 150 ++++ .../models/partner_connection_trust_type.py | 13 + .../models/partner_recipient_base_model.py | 54 ++ .../models/partners_filter_model.py | 46 ++ .../models/partners_overview_model.py | 86 ++ .../models/pdf_engine_type.py | 9 + .../models/pdf_orientation.py | 9 + .../models/presentation_block_model.py | 188 +++++ .../models/profile_language_model.py | 70 ++ .../models/project_add_edit_model.py | 264 +++++++ .../models/project_assignment_add_model.py | 188 +++++ .../project_assignment_allocation_status.py | 10 + .../project_assignment_announce_model.py | 187 +++++ ...ject_assignment_announcement_base_model.py | 236 ++++++ .../models/project_assignment_base_model.py | 213 +++++ .../models/project_assignment_edit_model.py | 195 +++++ .../models/project_assignment_extent_type.py | 9 + .../models/project_assignment_filter_model.py | 164 ++++ ...ect_assignment_member_allocation_status.py | 11 + ...ct_assignment_member_employee_add_model.py | 63 ++ ...t_assignment_member_employee_edit_model.py | 89 +++ .../models/project_assignment_member_model.py | 199 +++++ .../models/project_assignment_member_state.py | 12 + ...t_assignment_member_state_history_model.py | 65 ++ ...signment_member_subcontractor_add_model.py | 79 ++ ...ignment_member_subcontractor_edit_model.py | 105 +++ .../models/project_assignment_member_type.py | 11 + .../models/project_assignment_model.py | 410 ++++++++++ .../project_assignment_request_status.py | 10 + .../project_assignment_skill_add_model.py | 64 ++ .../project_assignment_skill_base_model.py | 126 +++ .../project_assignment_skill_edit_model.py | 54 ++ .../models/project_assignment_skill_model.py | 242 ++++++ .../models/project_assignment_status.py | 11 + .../project_assignment_with_status_model.py | 312 ++++++++ .../models/project_attachment_model.py | 119 +++ .../models/project_base_model.py | 114 +++ .../models/project_event_base_model.py | 141 ++++ .../project_event_meeting_add_edit_model.py | 180 +++++ .../models/project_event_meeting_model.py | 320 ++++++++ .../models/project_event_model.py | 237 ++++++ .../project_event_note_add_edit_model.py | 156 ++++ .../models/project_event_note_model.py | 288 +++++++ .../project_event_task_add_edit_model.py | 199 +++++ .../models/project_event_task_model.py | 331 ++++++++ .../cinode_api_client/models/project_model.py | 704 +++++++++++++++++ .../models/project_pipeline_model.py | 82 ++ .../models/project_pipeline_stage_model.py | 70 ++ .../models/project_priority.py | 10 + .../models/project_query_sort.py | 14 + ...oject_query_sort_page_and_sort_by_model.py | 95 +++ .../models/project_reference_model.py | 106 +++ .../cinode_api_client/models/project_state.py | 12 + .../models/project_state_history_model.py | 98 +++ .../models/project_state_reason_model.py | 54 ++ .../models/recruitment_source_model.py | 54 ++ .../models/reference_block_item_model.py | 180 +++++ .../models/reference_block_model.py | 111 +++ .../cinode_api_client/models/resume_model.py | 324 ++++++++ .../cinode_api_client/models/role_model.py | 100 +++ .../search_company_candidate_query_model.py | 153 ++++ .../search_company_candidate_result_model.py | 97 +++ ...ch_company_customer_contact_query_model.py | 107 +++ ...h_company_customer_contact_result_model.py | 99 +++ .../search_company_customer_query_model.py | 152 ++++ .../search_company_customer_result_model.py | 97 +++ .../models/search_company_user_query_model.py | 69 ++ .../search_company_user_result_model.py | 95 +++ .../models/search_project_query_model.py | 178 +++++ .../models/search_projects_result_model.py | 95 +++ .../models/search_skill_model.py | 54 ++ .../models/search_skill_query_model.py | 83 ++ .../models/search_skill_result_model.py | 78 ++ .../models/skill_block_item_model.py | 168 ++++ .../skill_by_category_block_item_model.py | 161 ++++ .../models/skill_by_category_block_model.py | 95 +++ .../models/skill_model_model.py | 127 +++ .../models/skill_result_model.py | 78 ++ .../models/skill_search_query_term_model.py | 64 ++ .../cinode_api_client/models/sort_order.py | 9 + .../cinode_api_client/models/status.py | 9 + .../models/string_comparison_operator.py | 11 + ...subcontractor_attachment_multipart_data.py | 117 +++ .../models/team_add_edit_model.py | 86 ++ .../models/team_base_model.py | 90 +++ .../models/team_manager_edit_model.py | 46 ++ .../models/team_manager_model.py | 89 +++ .../models/team_member_add_model.py | 46 ++ .../models/team_member_edit_model.py | 38 + .../models/team_member_model.py | 122 +++ .../models/team_member_move_model.py | 38 + .../cinode_api_client/models/team_model.py | 176 +++++ .../models/template_asset_type.py | 17 + .../models/text_block_model.py | 114 +++ .../models/top_skill_block_item_model.py | 124 +++ .../models/top_skill_block_model.py | 127 +++ .../models/training_block_model.py | 127 +++ .../models/training_item_block_model.py | 177 +++++ .../cinode_api_client/models/training_type.py | 9 + .../cinode_api_client/models/updated_model.py | 73 ++ .../cinode_api_client/models/user_gender.py | 10 + .../models/validation_model.py | 53 ++ .../models/validation_model_errors.py | 55 ++ .../models/webhook_add_model.py | 107 +++ .../models/webhook_configuration_add_model.py | 91 +++ .../models/webhook_configuration_model.py | 91 +++ .../models/webhook_credentials_add_model.py | 54 ++ .../models/webhook_credentials_model.py | 46 ++ .../models/webhook_entity_type.py | 17 + .../cinode_api_client/models/webhook_model.py | 107 +++ .../models/word_engine_type.py | 10 + .../work_experience_block_item_model.py | 243 ++++++ .../models/work_experience_block_model.py | 159 ++++ .../cinode_api_client/py.typed | 1 + .../cinode_api_client/types.py | 44 ++ src/cinode-py-client/pyproject.toml | 39 + src/cinode.d.ts | 151 +++- 755 files changed, 97840 insertions(+), 11 deletions(-) create mode 100644 src/cinode-py-client/.gitignore create mode 100644 src/cinode-py-client/README.md create mode 100644 src/cinode-py-client/cinode_api_client/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence/absence.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence/delete_absence.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence/new_absence.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence/update_absence.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence_type/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absence_type/absence_types.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absences/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/absences/absences.py create mode 100644 src/cinode-py-client/cinode_api_client/api/availability/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/availability/search_availability.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company/company.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_address_users/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_address_users/company_address_users.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate/add_company_candidate.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate/candidate.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate/delete_company_candidate.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate/invite_candidate.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate/patch_company_candidate.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event/company_candidate_event.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/company_candidate_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/delete_company_candidate_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/new_company_candidate_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/update_company_candidate_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/company_candidate_meeting_event_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/company_candidate_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/delete_company_candidate_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/new_company_candidate_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/update_company_candidate_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/company_candidate_note_event_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/company_candidate_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/delete_company_candidate_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/new_company_candidate_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/update_company_candidate_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/company_candidate_task_event_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_events/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_events/company_candidate_events.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/get_candidate_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/candidate_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/candidate_pipelines.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_skills/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_skills/delete_company_candidate_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_skills/new_company_candidate_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/candidate_uri_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/delete_candidate_uri_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/get_candidate_uri_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidates/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_candidates/candidates.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_capabilities/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_capabilities/company_capabilities.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_currencies/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_currencies/company_currencies.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer/delete_company_customer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer/get_company_customer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer/new_company_customer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer/patch_company_customer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer/update_company_customer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_address/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_address/customer_address.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_address/delete_company_customer_address.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_address/edit_company_customer_address.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_address/new_company_customer_address.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact/contact.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact/delete_company_customer_contact.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact/edit_company_customer_contact.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact/new_company_customer_contact.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/edit_customer_contact_tags.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contacts/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_contacts/contacts.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_event/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_event/company_customer_event.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events/company_customer_events.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/company_customer_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/delete_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/new_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/update_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/company_customer_event_meetings.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_note/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_note/company_customer_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_note/delete_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_note/new_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_note/update_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/company_customer_event_notes.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_task/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_task/company_customer_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_task/delete_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_task/new_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_task/update_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/company_customer_event_tasks.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/get_customer_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_managers/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_managers/add_company_customer_responsible.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_managers/company_customer_managers.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_managers/remove_customer_manager.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_tags/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customer_tags/edit_customer_tags.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customers/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customers/company_customers.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customers_extended/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_customers_extended/customers_extended.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_image/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_image/company_image.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_image/company_image_download.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_images/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_images/add_company_image.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_images/company_images.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_managers/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_managers/company_managers.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_profiles/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_profiles/company_profiles.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/get_project_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/recruitment_managers.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_resumes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_resumes/company_resumes.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/get_company_subcontractor_group.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/add_company_subcontractor_group_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/delete_company_subcontractor_group_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/get_company_subcontractor_groups.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_tag/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_tag/company_tag.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_tags/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_tags/company_tags.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team/new_team.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team/team.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team/update_team.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_managers/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_managers/add_team_manager.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_managers/remove_team_manager.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_managers/team_managers.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_member/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_member/add_team_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_member/get_team_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_member/move_team_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_member/remove_team_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_member/update_team_member.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_members/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_members/get_team_members.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_users/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_users/add_team_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_users/get_team_users.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_team_users/remove_team_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_teams/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_teams/company_teams.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user/add_company_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user/delete_company_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user/patch_company_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user/update_company_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user/user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_convert/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_convert/convert_user_to_aad_account.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event/company_user_employee_event.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/company_user_employee_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/delete_company_user_employee_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/new_company_user_employee_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/update_company_user_employee_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/company_user_employee_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/delete_company_user_employee_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/new_company_user_employee_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/update_company_user_employee_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/company_user_employee_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/delete_company_user_employee_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/new_company_user_employee_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/update_company_user_employee_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events/company_user_employee_events.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/company_user_employee_event_meeting_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/company_user_employee_event_note_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/company_user_employee_event_task_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_full/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_full/user_full.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_permissions/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_permissions/update_permissions.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile/company_user_profile.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile/new_company_user_profile.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/company_user_profile_commitment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/delete_company_user_profile_commitment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/new_company_user_profile_commitment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/update_company_user_profile_commitment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_education/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_education/company_user_profile_education.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_education/delete_company_user_profile_education.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_education/new_company_user_profile_education.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_education/update_company_user_profile_education.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/company_user_profile_employer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/delete_company_user_profile_employer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/new_company_user_profile_employer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/update_company_user_profile_employer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/company_user_profile_ext_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/delete_company_user_profile_ext_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/new_company_user_profile_ext_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/update_company_user_profile_ext_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_import/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_import/create_company_user_profile_import.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_import/get_company_user_profile_import.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_language/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_language/company_user_profile_language.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_language/delete_company_user_profile_language.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_language/new_company_user_profile_language.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_language/update_company_user_profile_language.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/profile_languages.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/company_user_profile_presentation.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/update_company_user_profile_presentation.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/company_user_profile_reference.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/delete_company_user_profile_reference.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/new_company_user_profile_reference.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/update_company_user_profile_reference.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/company_user_profile_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/delete_company_user_profile_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/new_company_user_profile_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/update_company_user_profile_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_training/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_training/company_user_profile_training.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_training/delete_company_user_profile_training.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_training/new_company_user_profile_training.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_training/update_company_user_profile_training.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/company_user_profile_work_experience.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/delete_company_user_profile_work_experience.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/new_company_user_profile_work_experience.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/update_company_user_profile_work_experience.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profiles/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_profiles/company_user_profiles.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_resume/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_resume/get_resume.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_resumes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_resumes/company_user_resumes.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_roles/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_roles/company_user_roles.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_skill/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_skill/skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_skills/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_skills/skills.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/add_company_user_subcontractor.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/company_subcontractor.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/delete_company_subcontractor.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/company_user_subcontractor_event.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/company_user_subcontractor_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/delete_company_user_subcontractor_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/new_company_user_subcontractor_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/update_company_user_subcontractor_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/company_user_subcontractor_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/delete_company_user_subcontractor_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/new_company_user_subcontractor_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/update_company_user_subcontractor_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/company_user_subcontractor_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/delete_company_user_subcontractor_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/new_company_user_subcontractor_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/update_company_user_subcontractor_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/company_user_subcontractor_events.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/company_user_subcontractor_event_meeting_list.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/company_user_subcontractor_events_notes.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/company_user_subcontractor_events_tasks.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/get_subcontractor_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/subcontractor_attachment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_role.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_roles.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/company_user_subcontractors.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_tags/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_tags/edit_company_user_tags.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_teams/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_user_teams/user_teams.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_users/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_users/company_users.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_users_extended/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_users_extended/company_users_extended.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_webhook/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_webhook/install_webhook_manifest.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_webhook/new_webhook.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_webhook/remove_webhook.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_webhooks/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/company_webhooks/company_webhooks.py create mode 100644 src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/dynamic_resume.py create mode 100644 src/cinode-py-client/cinode_api_client/api/keyword_search/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/keyword_search/search_keyword.py create mode 100644 src/cinode-py-client/cinode_api_client/api/mentions/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/mentions/translate_mentions.py create mode 100644 src/cinode-py-client/cinode_api_client/api/partners/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/partners/search_partners.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project/delete_company_project.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project/new_company_project.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project/project.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project/update_company_project.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/announce_project_assignment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/delete_project_assignment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/new_project_assignment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/old_project_assignment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/project_assignment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment/update_project_assignment.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_member/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_employee.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_subcontractor.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_member/delete_project_assignment_member_employee.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_employee.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_subcontractor.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_skills/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_skills/add_project_assignment_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_skills/delete_project_assignment_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignment_skills/update_project_assignment_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignments/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_assignments/search_roles.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_event/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_event/project_event.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events/project_events.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meeting/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meeting/delete_project_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meeting/new_project_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meeting/project_event_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meeting/update_project_meeting.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meetings/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_meetings/project_event_meetings.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_note/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_note/delete_project_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_note/new_project_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_note/project_event_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_note/update_project_note.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_notes/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_notes/project_event_notes.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_task/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_task/delete_project_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_task/new_project_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_task/project_event_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_task/update_project_task.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_tasks/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_events_tasks/project_event_tasks.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_pipelines/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_pipelines/project_pipelines.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_reference/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_reference/project_reference.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_references/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_references/project_references.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_tags/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/project_tags/edit_project_tags.py create mode 100644 src/cinode-py-client/cinode_api_client/api/projects/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/projects/projects.py create mode 100644 src/cinode-py-client/cinode_api_client/api/recruitment_sources/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/recruitment_sources/recruitment_sources.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_candidate/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_candidate/search_company_candidate.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/search_company_customer_contact.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_customers/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_customers/search_company_customer.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_user/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_company_user/search_company_user.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_project/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/search_project/search_project.py create mode 100644 src/cinode-py-client/cinode_api_client/api/skill_search/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/skill_search/search_skill.py create mode 100644 src/cinode-py-client/cinode_api_client/api/skill_search_term/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/api/skill_search_term/search_skill_term.py create mode 100644 src/cinode-py-client/cinode_api_client/client.py create mode 100644 src/cinode-py-client/cinode_api_client/errors.py create mode 100644 src/cinode-py-client/cinode_api_client/models/__init__.py create mode 100644 src/cinode-py-client/cinode_api_client/models/abscence_period_day_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/absence_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/absence_period_dto_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/absence_period_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/absence_type_dto.py create mode 100644 src/cinode-py-client/cinode_api_client/models/absence_type_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/access_level.py create mode 100644 src/cinode-py-client/cinode_api_client/models/action_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/add_company_image_multipart_data.py create mode 100644 src/cinode-py-client/cinode_api_client/models/add_company_subcontractor_group_member_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/address_info_block_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/address_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/attachment_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/availability_filter_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/availability_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/calendar_day_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/candidate_attachment_multipart_data.py create mode 100644 src/cinode-py-client/cinode_api_client/models/classic_company_user_resume_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/commitment_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/commitment_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_address_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_add_invite_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_event_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_event_meeting_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_event_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_event_note_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_event_task_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_extended_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_list_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_stage_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort_page_and_sort_by_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_skill_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_state.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_capabilities_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_address_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_address_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_contact_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_contact_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_contact_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort_page_and_sort_by_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_delete_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_extended_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_manager_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_managers_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_query_sort.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_customer_query_sort_page_and_sort_by_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_enabled_module_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_image_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_profile_filter_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_profile_sort.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_profile_sort_page_and_sort_by_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_profiles_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_recruitment_manager_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_resume_template_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_resume_template_language_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_size.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_tag_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_tag_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_tag_type_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_note_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_note_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_task_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_event_task_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_extended_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_full_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_image_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_info_block_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_permissions_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_education_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_education_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_education_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_full_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_language_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_language_branch_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_language_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_history_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_training_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_training_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_training_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_skill_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_translation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_project_assignment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_query_sort.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_query_sort_page_and_sort_by_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_resume_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_search_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_list_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_role_member_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_roles_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/company_user_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/contract_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/convert_company_user_to_aad_account_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/country_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/create_company_user_profile_import_multipart_data.py create mode 100644 src/cinode-py-client/cinode_api_client/models/created_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/currency_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_meeting_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_meeting_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_note_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_note_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_task_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/customer_event_task_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/dynamic_company_user_resume_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_script_assets.py create mode 100644 src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_style_assets.py create mode 100644 src/cinode-py-client/cinode_api_client/models/education_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/education_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/employer_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/employer_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/error_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_comment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_meeting_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_note_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_note_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_status_value.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_task_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_task_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/event_visibility.py create mode 100644 src/cinode-py-client/cinode_api_client/models/extent_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/extra_skill_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/extra_skill_item_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/filter_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_company_address_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_company_candidate_patch_document.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_company_user_employee_patch_document.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_contact_info_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_dynamic_block_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_template_company.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_template_image.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_template_logotype.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_template_shared_asset_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_template_style_asset_view_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/i_template_user_info.py create mode 100644 src/cinode-py-client/cinode_api_client/models/image_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/image_size.py create mode 100644 src/cinode-py-client/cinode_api_client/models/import_profile_async_operation.py create mode 100644 src/cinode-py-client/cinode_api_client/models/keyword_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/keyword_synonym_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/keyword_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/language_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/language_item_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/language_level.py create mode 100644 src/cinode-py-client/cinode_api_client/models/link.py create mode 100644 src/cinode-py-client/cinode_api_client/models/location_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/location_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/long_running_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/mention_text_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/module_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/operation.py create mode 100644 src/cinode-py-client/cinode_api_client/models/operation_value.py create mode 100644 src/cinode-py-client/cinode_api_client/models/partner_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/partner_connection_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/partner_connection_trust_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/partner_recipient_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/partners_filter_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/partners_overview_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/pdf_engine_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/pdf_orientation.py create mode 100644 src/cinode-py-client/cinode_api_client/models/presentation_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/profile_language_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_allocation_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_announce_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_announcement_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_extent_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_filter_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_allocation_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_state.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_state_history_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_member_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_request_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_skill_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_skill_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_skill_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_assignment_with_status_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_attachment_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_meeting_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_meeting_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_note_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_note_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_task_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_event_task_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_pipeline_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_pipeline_stage_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_priority.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_query_sort.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_query_sort_page_and_sort_by_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_reference_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_state.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_state_history_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/project_state_reason_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/recruitment_source_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/reference_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/reference_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/resume_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/role_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_candidate_query_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_candidate_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_query_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_customer_query_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_customer_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_user_query_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_company_user_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_project_query_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_projects_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_skill_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_skill_query_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/search_skill_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/skill_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/skill_by_category_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/skill_by_category_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/skill_model_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/skill_result_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/skill_search_query_term_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/sort_order.py create mode 100644 src/cinode-py-client/cinode_api_client/models/status.py create mode 100644 src/cinode-py-client/cinode_api_client/models/string_comparison_operator.py create mode 100644 src/cinode-py-client/cinode_api_client/models/subcontractor_attachment_multipart_data.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_add_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_base_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_manager_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_manager_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_member_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_member_edit_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_member_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_member_move_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/team_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/template_asset_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/text_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/top_skill_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/top_skill_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/training_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/training_item_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/training_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/updated_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/user_gender.py create mode 100644 src/cinode-py-client/cinode_api_client/models/validation_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/validation_model_errors.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_configuration_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_configuration_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_credentials_add_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_credentials_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_entity_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/webhook_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/word_engine_type.py create mode 100644 src/cinode-py-client/cinode_api_client/models/work_experience_block_item_model.py create mode 100644 src/cinode-py-client/cinode_api_client/models/work_experience_block_model.py create mode 100644 src/cinode-py-client/cinode_api_client/py.typed create mode 100644 src/cinode-py-client/cinode_api_client/types.py create mode 100644 src/cinode-py-client/pyproject.toml diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index b9f9066..a341bd3 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -4,7 +4,7 @@ name: Deploy static content to Pages on: # Runs on pushes targeting the default branch push: - branches: ["main"] + branches: ['main'] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -18,7 +18,7 @@ permissions: # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: - group: "pages" + group: 'pages' cancel-in-progress: false jobs: diff --git a/README.md b/README.md index 7d5005f..e745280 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -# Cinode OpenAPI TypeScript API +# Cinode OpenAPI TypeScript typings & Python API Client + +## API Typings and Clients + +### TypeScript - Types created with [drwpow/openapi-typescript](https://github.com/drwpow/openapi-typescript) - API Examples with [drwpow/openapi-fetch](https://github.com/drwpow/openapi-fetch) + +### Python + +- Created with [openapi-python-client](https://github.com/openapi-generators/openapi-python-client) diff --git a/generate.sh b/generate.sh index 80554b4..155c694 100755 --- a/generate.sh +++ b/generate.sh @@ -3,13 +3,23 @@ # Generate Cinode TypeScript type definitions SRC="https://api.cinode.com/swagger/v0.1/swagger.json" -DEST="$(pwd)/src/cinode.d.ts" +DEST="$(pwd)/src/" +DEST_TS="$DEST/cinode.d.ts" +DEST_PY="$DEST/cinode-py-client" + +python3 -m pip install --user --upgrade pipx +python3 -m pipx ensurepath +python3 -m pipx install openapi-python-client --include-deps + +rm -rf "$DEST_PY" +openapi-python-client generate --url "$SRC" +mv "cinode-api-client" "$DEST_PY" npx openapi-typescript \ "$SRC" \ --export-type \ --path-params-as-type \ - --output "$DEST" + --output "$DEST_TS" npm run prettier diff --git a/src/cinode-py-client/.gitignore b/src/cinode-py-client/.gitignore new file mode 100644 index 0000000..79a2c3d --- /dev/null +++ b/src/cinode-py-client/.gitignore @@ -0,0 +1,23 @@ +__pycache__/ +build/ +dist/ +*.egg-info/ +.pytest_cache/ + +# pyenv +.python-version + +# Environments +.env +.venv + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# JetBrains +.idea/ + +/coverage.xml +/.coverage diff --git a/src/cinode-py-client/README.md b/src/cinode-py-client/README.md new file mode 100644 index 0000000..48c17bb --- /dev/null +++ b/src/cinode-py-client/README.md @@ -0,0 +1,131 @@ +# cinode-api-client + +A client library for accessing Cinode API + +## Usage + +First, create a client: + +```python +from cinode_api_client import Client + +client = Client(base_url="https://api.example.com") +``` + +If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead: + +```python +from cinode_api_client import AuthenticatedClient + +client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken") +``` + +Now call your endpoint and use your models: + +```python +from cinode_api_client.models import MyDataModel +from cinode_api_client.api.my_tag import get_my_data_model +from cinode_api_client.types import Response + +with client as client: + my_data: MyDataModel = get_my_data_model.sync(client=client) + # or if you need more info (e.g. status_code) + response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) +``` + +Or do the same thing with an async version: + +```python +from cinode_api_client.models import MyDataModel +from cinode_api_client.api.my_tag import get_my_data_model +from cinode_api_client.types import Response + +async with client as client: + my_data: MyDataModel = await get_my_data_model.asyncio(client=client) + response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client) +``` + +By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl="/path/to/certificate_bundle.pem", +) +``` + +You can also disable certificate validation altogether, but beware that **this is a security risk**. + +```python +client = AuthenticatedClient( + base_url="https://internal_api.example.com", + token="SuperSecretToken", + verify_ssl=False +) +``` + +Things to know: + +1. Every path/method combo becomes a Python module with four functions: + + 1. `sync`: Blocking request that returns parsed data (if successful) or `None` + 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful. + 1. `asyncio`: Like `sync` but async instead of blocking + 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking + +1. All path/query params, and bodies become method arguments. +1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above) +1. Any endpoint which did not have a tag will be in `cinode_api_client.api.default` + +## Advanced customizations + +There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case): + +```python +from cinode_api_client import Client + +def log_request(request): + print(f"Request event hook: {request.method} {request.url} - Waiting for response") + +def log_response(response): + request = response.request + print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}") + +client = Client( + base_url="https://api.example.com", + httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}}, +) + +# Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client() +``` + +You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url): + +```python +import httpx +from cinode_api_client import Client + +client = Client( + base_url="https://api.example.com", +) +# Note that base_url needs to be re-set, as would any shared cookies, headers, etc. +client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030")) +``` + +## Building / publishing this package + +This project uses [Poetry](https://python-poetry.org/) to manage dependencies and packaging. Here are the basics: + +1. Update the metadata in pyproject.toml (e.g. authors, version) +1. If you're using a private repository, configure it with Poetry + 1. `poetry config repositories. ` + 1. `poetry config http-basic. ` +1. Publish the client with `poetry publish --build -r ` or, if for public PyPI, just `poetry publish --build` + +If you want to install this client into another project without publishing it (e.g. for development) then: + +1. If that project **is using Poetry**, you can simply do `poetry add ` from that project +1. If that project is not using Poetry: + 1. Build a wheel with `poetry build -f wheel` + 1. Install that wheel from the other project `pip install ` diff --git a/src/cinode-py-client/cinode_api_client/__init__.py b/src/cinode-py-client/cinode_api_client/__init__.py new file mode 100644 index 0000000..04b5c87 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/__init__.py @@ -0,0 +1,7 @@ +""" A client library for accessing Cinode API """ +from .client import AuthenticatedClient, Client + +__all__ = ( + "AuthenticatedClient", + "Client", +) diff --git a/src/cinode-py-client/cinode_api_client/api/__init__.py b/src/cinode-py-client/cinode_api_client/api/__init__.py new file mode 100644 index 0000000..dc035f4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/__init__.py @@ -0,0 +1 @@ +""" Contains methods for accessing the API """ diff --git a/src/cinode-py-client/cinode_api_client/api/absence/__init__.py b/src/cinode-py-client/cinode_api_client/api/absence/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/absence/absence.py b/src/cinode-py-client/cinode_api_client/api/absence/absence.py new file mode 100644 index 0000000..ae835a8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/absence/absence.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.absence_period_model import AbsencePeriodModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = AbsencePeriodModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Get absence period by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Get absence period by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Get absence period by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Get absence period by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/absence/delete_absence.py b/src/cinode-py-client/cinode_api_client/api/absence/delete_absence.py new file mode 100644 index 0000000..dd82d69 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/absence/delete_absence.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete absence + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete absence + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete absence + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete absence + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/absence/new_absence.py b/src/cinode-py-client/cinode_api_client/api/absence/new_absence.py new file mode 100644 index 0000000..ed6c500 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/absence/new_absence.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.absence_add_edit_model import AbsenceAddEditModel +from ...models.absence_period_model import AbsencePeriodModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: AbsenceAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = AbsencePeriodModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Create Absence Item for User + + Args: + company_id (int): + company_user_id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Create Absence Item for User + + Args: + company_id (int): + company_user_id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Create Absence Item for User + + Args: + company_id (int): + company_user_id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Create Absence Item for User + + Args: + company_id (int): + company_user_id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/absence/update_absence.py b/src/cinode-py-client/cinode_api_client/api/absence/update_absence.py new file mode 100644 index 0000000..ecf22e8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/absence/update_absence.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.absence_add_edit_model import AbsenceAddEditModel +from ...models.absence_period_model import AbsencePeriodModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: AbsenceAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = AbsencePeriodModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Update Absence Item for User + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Update Absence Item for User + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Update Absence Item for User + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AbsenceAddEditModel, +) -> Optional[Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel]]: + """Update Absence Item for User + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (AbsenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[AbsencePeriodModel, Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/absence_type/__init__.py b/src/cinode-py-client/cinode_api_client/api/absence_type/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/absence_type/absence_types.py b/src/cinode-py-client/cinode_api_client/api/absence_type/absence_types.py new file mode 100644 index 0000000..398acdd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/absence_type/absence_types.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.absence_type_model import AbsenceTypeModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/absence/types".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AbsenceTypeModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]: + """Get absence types for company + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]: + """Get absence types for company + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]: + """Get absence types for company + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["AbsenceTypeModel"], ValidationModel]]: + """Get absence types for company + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['AbsenceTypeModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/absences/__init__.py b/src/cinode-py-client/cinode_api_client/api/absences/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/absences/absences.py b/src/cinode-py-client/cinode_api_client/api/absences/absences.py new file mode 100644 index 0000000..f06d24f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/absences/absences.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.absence_period_dto_model import AbsencePeriodDtoModel +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/absences".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AbsencePeriodDtoModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]: + """Get absence period by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['AbsencePeriodDtoModel']]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]: + """Get absence period by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['AbsencePeriodDtoModel']] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]: + """Get absence period by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['AbsencePeriodDtoModel']]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["AbsencePeriodDtoModel"]]]: + """Get absence period by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['AbsencePeriodDtoModel']] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/availability/__init__.py b/src/cinode-py-client/cinode_api_client/api/availability/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/availability/search_availability.py b/src/cinode-py-client/cinode_api_client/api/availability/search_availability.py new file mode 100644 index 0000000..c322a69 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/availability/search_availability.py @@ -0,0 +1,193 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.availability_filter_model import AvailabilityFilterModel +from ...models.availability_model import AvailabilityModel +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: AvailabilityFilterModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/availability".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["AvailabilityModel"]]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = AvailabilityModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["AvailabilityModel"]]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AvailabilityFilterModel, +) -> Response[Union[Any, ErrorModel, List["AvailabilityModel"]]]: + """Get availability for company users. Omitting companyUserId gets availability for all company users + in company. + + Args: + company_id (int): + json_body (AvailabilityFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['AvailabilityModel']]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AvailabilityFilterModel, +) -> Optional[Union[Any, ErrorModel, List["AvailabilityModel"]]]: + """Get availability for company users. Omitting companyUserId gets availability for all company users + in company. + + Args: + company_id (int): + json_body (AvailabilityFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['AvailabilityModel']] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AvailabilityFilterModel, +) -> Response[Union[Any, ErrorModel, List["AvailabilityModel"]]]: + """Get availability for company users. Omitting companyUserId gets availability for all company users + in company. + + Args: + company_id (int): + json_body (AvailabilityFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['AvailabilityModel']]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AvailabilityFilterModel, +) -> Optional[Union[Any, ErrorModel, List["AvailabilityModel"]]]: + """Get availability for company users. Omitting companyUserId gets availability for all company users + in company. + + Args: + company_id (int): + json_body (AvailabilityFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['AvailabilityModel']] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company/__init__.py b/src/cinode-py-client/cinode_api_client/api/company/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company/company.py b/src/cinode-py-client/cinode_api_client/api/company/company.py new file mode 100644 index 0000000..1b5ee7f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company/company.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_model import CompanyModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]: + """Get company by id + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyModel, ErrorModel, ValidationModel]]: + """Get company by id + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]]: + """Get company by id + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyModel, ErrorModel, ValidationModel]]: + """Get company by id + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_address_users/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_address_users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_address_users/company_address_users.py b/src/cinode-py-client/cinode_api_client/api/company_address_users/company_address_users.py new file mode 100644 index 0000000..2eadb15 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_address_users/company_address_users.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_extended_model import CompanyUserExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/addresses/{id}/users".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list for an address + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list for an address + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list for an address + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list for an address + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate/add_company_candidate.py b/src/cinode-py-client/cinode_api_client/api/company_candidate/add_company_candidate.py new file mode 100644 index 0000000..b18fcd5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate/add_company_candidate.py @@ -0,0 +1,194 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_add_model import CompanyCandidateAddModel +from ...models.company_candidate_extended_model import CompanyCandidateExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: CompanyCandidateAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCandidateExtendedModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddModel, +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Create Candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + json_body (CompanyCandidateAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddModel, +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Create Candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + json_body (CompanyCandidateAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddModel, +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Create Candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + json_body (CompanyCandidateAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddModel, +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Create Candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + json_body (CompanyCandidateAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate/candidate.py b/src/cinode-py-client/cinode_api_client/api/company_candidate/candidate.py new file mode 100644 index 0000000..9031970 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate/candidate.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_extended_model import CompanyCandidateExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateExtendedModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Get Candidate by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Get Candidate by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Get Candidate by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Get Candidate by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate/delete_company_candidate.py b/src/cinode-py-client/cinode_api_client/api/company_candidate/delete_company_candidate.py new file mode 100644 index 0000000..3ed3d79 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate/delete_company_candidate.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/candidates/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete candidate from the system + This action is irreversible, use with caution + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete candidate from the system + This action is irreversible, use with caution + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete candidate from the system + This action is irreversible, use with caution + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete candidate from the system + This action is irreversible, use with caution + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate/invite_candidate.py b/src/cinode-py-client/cinode_api_client/api/company_candidate/invite_candidate.py new file mode 100644 index 0000000..a49e9e9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate/invite_candidate.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_add_invite_model import CompanyCandidateAddInviteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: CompanyCandidateAddInviteModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{id}/invite".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddInviteModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Invite the CompanyCandidate to create their own Cinode account + A email is sent with your message and details for how to login + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateAddInviteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddInviteModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Invite the CompanyCandidate to create their own Cinode account + A email is sent with your message and details for how to login + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateAddInviteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddInviteModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Invite the CompanyCandidate to create their own Cinode account + A email is sent with your message and details for how to login + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateAddInviteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateAddInviteModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Invite the CompanyCandidate to create their own Cinode account + A email is sent with your message and details for how to login + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateAddInviteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate/patch_company_candidate.py b/src/cinode-py-client/cinode_api_client/api/company_candidate/patch_company_candidate.py new file mode 100644 index 0000000..10a8e66 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate/patch_company_candidate.py @@ -0,0 +1,209 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_extended_model import CompanyCandidateExtendedModel +from ...models.error_model import ErrorModel +from ...models.operation import Operation +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: List["Operation"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for componentsschemas_json_patch_document_item_data in json_body: + componentsschemas_json_patch_document_item = componentsschemas_json_patch_document_item_data.to_dict() + + json_json_body.append(componentsschemas_json_patch_document_item) + + return { + "method": "patch", + "url": "/v0.1/companies/{companyId}/candidates/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateExtendedModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Patch company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Patch company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Patch company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Optional[Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel]]: + """Patch company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateExtendedModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event/company_candidate_event.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event/company_candidate_event.py new file mode 100644 index 0000000..23ec5a6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event/company_candidate_event.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_model import CompanyCandidateEventModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]: + """Get company candidates event by id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]: + """Get company candidates event by id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]: + """Get company candidates event by id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel]]: + """Get company candidates event by id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/company_candidate_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/company_candidate_event_meeting.py new file mode 100644 index 0000000..8f8260d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/company_candidate_event_meeting.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Get company candidates meeting event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Get company candidates meeting event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Get company candidates meeting event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Get company candidates meeting event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/delete_company_candidate_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/delete_company_candidate_event_meeting.py new file mode 100644 index 0000000..283ff65 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/delete_company_candidate_event_meeting.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate meeting event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate meeting event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate meeting event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate meeting event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/new_company_candidate_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/new_company_candidate_event_meeting.py new file mode 100644 index 0000000..e03669d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/new_company_candidate_event_meeting.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.event_meeting_add_edit_model import EventMeetingAddEditModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + *, + json_body: EventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings".format( + companyId=company_id, + candidateId=candidate_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCandidateEventMeetingModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Add new meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Add new meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Add new meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Add new meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/update_company_candidate_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/update_company_candidate_event_meeting.py new file mode 100644 index 0000000..ab9259c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meeting/update_company_candidate_event_meeting.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.event_meeting_add_edit_model import EventMeetingAddEditModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, + *, + json_body: EventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Update meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Update meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Update meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel]]: + """Update meeting event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/company_candidate_meeting_event_list.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/company_candidate_meeting_event_list.py new file mode 100644 index 0000000..2ed8ae5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_meetings/company_candidate_meeting_event_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/meetings".format( + companyId=company_id, + candidateId=candidate_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events meetings list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events meetings list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events meetings list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events meetings list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/company_candidate_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/company_candidate_event_note.py new file mode 100644 index 0000000..840acb8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/company_candidate_event_note.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_note_model import CompanyCandidateEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Get company candidates note event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Get company candidates note event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Get company candidates note event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Get company candidates note event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/delete_company_candidate_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/delete_company_candidate_event_note.py new file mode 100644 index 0000000..b312483 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/delete_company_candidate_event_note.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate note event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate note event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate note event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate note event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/new_company_candidate_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/new_company_candidate_event_note.py new file mode 100644 index 0000000..155a365 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/new_company_candidate_event_note.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_note_model import CompanyCandidateEventNoteModel +from ...models.error_model import ErrorModel +from ...models.event_note_add_edit_model import EventNoteAddEditModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + *, + json_body: EventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes".format( + companyId=company_id, + candidateId=candidate_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCandidateEventNoteModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Add new note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Add new note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Add new note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Add new note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/update_company_candidate_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/update_company_candidate_event_note.py new file mode 100644 index 0000000..42b06ac --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_note/update_company_candidate_event_note.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_note_model import CompanyCandidateEventNoteModel +from ...models.error_model import ErrorModel +from ...models.event_note_add_edit_model import EventNoteAddEditModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, + *, + json_body: EventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Update note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Update note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Update note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventNoteAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel]]: + """Update note event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/company_candidate_note_event_list.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/company_candidate_note_event_list.py new file mode 100644 index 0000000..bd2100d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_notes/company_candidate_note_event_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/notes".format( + companyId=company_id, + candidateId=candidate_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events notes list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events notes list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events notes list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events notes list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/company_candidate_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/company_candidate_event_task.py new file mode 100644 index 0000000..fbd1ba5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/company_candidate_event_task.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_task_model import CompanyCandidateEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Get company candidates task event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Get company candidates task event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Get company candidates task event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Get company candidates task event with specified id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/delete_company_candidate_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/delete_company_candidate_event_task.py new file mode 100644 index 0000000..01dfbb1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/delete_company_candidate_event_task.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate task event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate task event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate task event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete company candidate task event + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/new_company_candidate_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/new_company_candidate_event_task.py new file mode 100644 index 0000000..af7c29d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/new_company_candidate_event_task.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_task_model import CompanyCandidateEventTaskModel +from ...models.error_model import ErrorModel +from ...models.event_task_add_edit_model import EventTaskAddEditModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + *, + json_body: EventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks".format( + companyId=company_id, + candidateId=candidate_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCandidateEventTaskModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Add new task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Add new task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Add new task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Add new task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/update_company_candidate_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/update_company_candidate_event_task.py new file mode 100644 index 0000000..0b01322 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_task/update_company_candidate_event_task.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_task_model import CompanyCandidateEventTaskModel +from ...models.error_model import ErrorModel +from ...models.event_task_add_edit_model import EventTaskAddEditModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: str, + *, + json_body: EventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Update task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Update task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Update task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: EventTaskAddEditModel, +) -> Optional[Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel]]: + """Update task event for company candidate + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + id (str): + json_body (EventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/company_candidate_task_event_list.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/company_candidate_task_event_list.py new file mode 100644 index 0000000..0bdf80c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_event_tasks/company_candidate_task_event_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events/tasks".format( + companyId=company_id, + candidateId=candidate_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events tasks list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events tasks list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events tasks list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events tasks list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_events/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_events/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_events/company_candidate_events.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_events/company_candidate_events.py new file mode 100644 index 0000000..27a81a7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_events/company_candidate_events.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_event_base_model import CompanyCandidateEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/events".format( + companyId=company_id, + candidateId=candidate_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCandidateEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateEventBaseModel"], ValidationModel]]: + """Get company candidates events list + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + candidate_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/get_candidate_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/get_candidate_attachment.py new file mode 100644 index 0000000..75e6de8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachment/get_candidate_attachment.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + attachment_id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{id}/attachments/{attachmentId}".format( + companyId=company_id, + id=id, + attachmentId=attachment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, str]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(str, response.json()) + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get Candidate File Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get Candidate File Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return sync_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get Candidate File Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get Candidate File Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/candidate_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/candidate_attachment.py new file mode 100644 index 0000000..3c8cb2c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_file_attachments/candidate_attachment.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.candidate_attachment_multipart_data import CandidateAttachmentMultipartData +from ...models.company_candidate_file_attachment_list_model import CompanyCandidateFileAttachmentListModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + multipart_data: CandidateAttachmentMultipartData, +) -> Dict[str, Any]: + pass + + multipart_multipart_data = multipart_data.to_multipart() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{id}/attachments".format( + companyId=company_id, + id=id, + ), + "files": multipart_multipart_data, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCandidateFileAttachmentListModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CandidateAttachmentMultipartData, +) -> Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload Candidate File Attachment + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + multipart_data (CandidateAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + multipart_data=multipart_data, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CandidateAttachmentMultipartData, +) -> Optional[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload Candidate File Attachment + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + multipart_data (CandidateAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + multipart_data=multipart_data, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CandidateAttachmentMultipartData, +) -> Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload Candidate File Attachment + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + multipart_data (CandidateAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + multipart_data=multipart_data, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CandidateAttachmentMultipartData, +) -> Optional[Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload Candidate File Attachment + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + multipart_data (CandidateAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateFileAttachmentListModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + multipart_data=multipart_data, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/candidate_pipelines.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/candidate_pipelines.py new file mode 100644 index 0000000..5cc754c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_pipelines/candidate_pipelines.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_pipeline_model import CompanyCandidatePipelineModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/pipelines".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCandidatePipelineModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]: + """Get candidate pipelines + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]: + """Get candidate pipelines + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]: + """Get candidate pipelines + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidatePipelineModel"], ValidationModel]]: + """Get candidate pipelines + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidatePipelineModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/delete_company_candidate_skill.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/delete_company_candidate_skill.py new file mode 100644 index 0000000..1c695b4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/delete_company_candidate_skill.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/skills/{id}".format( + companyId=company_id, + candidateId=candidate_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Skill + + Sample request: + + DELETE /v0.1/companies/1/candidates/19870/skills/577 + + Args: + company_id (int): + candidate_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Skill + + Sample request: + + DELETE /v0.1/companies/1/candidates/19870/skills/577 + + Args: + company_id (int): + candidate_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Skill + + Sample request: + + DELETE /v0.1/companies/1/candidates/19870/skills/577 + + Args: + company_id (int): + candidate_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Skill + + Sample request: + + DELETE /v0.1/companies/1/candidates/19870/skills/577 + + Args: + company_id (int): + candidate_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/new_company_candidate_skill.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/new_company_candidate_skill.py new file mode 100644 index 0000000..fdd80ef --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_skills/new_company_candidate_skill.py @@ -0,0 +1,243 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_skill_add_model import CompanyCandidateSkillAddModel +from ...models.company_candidate_skill_model import CompanyCandidateSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + candidate_id: int, + *, + json_body: CompanyCandidateSkillAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{candidateId}/skills".format( + companyId=company_id, + candidateId=candidate_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateSkillModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateSkillAddModel, +) -> Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]: + r"""Add a Skill to company candidate + + Sample request: + + POST /v0.1/companies/1/candidates/19870/skills + { + \"name\": \"SQL\", + \"companyCandidateId\": 19870, + \"keywordSynonymId\": 577, + \"languageId\":1 + } + + Args: + company_id (int): + candidate_id (int): + json_body (CompanyCandidateSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateSkillAddModel, +) -> Optional[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]: + r"""Add a Skill to company candidate + + Sample request: + + POST /v0.1/companies/1/candidates/19870/skills + { + \"name\": \"SQL\", + \"companyCandidateId\": 19870, + \"keywordSynonymId\": 577, + \"languageId\":1 + } + + Args: + company_id (int): + candidate_id (int): + json_body (CompanyCandidateSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateSkillAddModel, +) -> Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]: + r"""Add a Skill to company candidate + + Sample request: + + POST /v0.1/companies/1/candidates/19870/skills + { + \"name\": \"SQL\", + \"companyCandidateId\": 19870, + \"keywordSynonymId\": 577, + \"languageId\":1 + } + + Args: + company_id (int): + candidate_id (int): + json_body (CompanyCandidateSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + candidate_id=candidate_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + candidate_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateSkillAddModel, +) -> Optional[Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel]]: + r"""Add a Skill to company candidate + + Sample request: + + POST /v0.1/companies/1/candidates/19870/skills + { + \"name\": \"SQL\", + \"companyCandidateId\": 19870, + \"keywordSynonymId\": 577, + \"languageId\":1 + } + + Args: + company_id (int): + candidate_id (int): + json_body (CompanyCandidateSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + candidate_id=candidate_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/candidate_uri_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/candidate_uri_attachment.py new file mode 100644 index 0000000..3eabe70 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/candidate_uri_attachment.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_uri_attachment_add_model import CompanyCandidateUriAttachmentAddModel +from ...models.company_candidate_uri_attachment_model import CompanyCandidateUriAttachmentModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: CompanyCandidateUriAttachmentAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/{id}/uriattachments".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCandidateUriAttachmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateUriAttachmentAddModel, +) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]: + """Add Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateUriAttachmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateUriAttachmentAddModel, +) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]: + """Add Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateUriAttachmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateUriAttachmentAddModel, +) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]: + """Add Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateUriAttachmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCandidateUriAttachmentAddModel, +) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel]]: + """Add Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + json_body (CompanyCandidateUriAttachmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/delete_candidate_uri_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/delete_candidate_uri_attachment.py new file mode 100644 index 0000000..25ec4ea --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachment/delete_candidate_uri_attachment.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + attachment_id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/candidates/{id}/uriattachments/{attachmentId}".format( + companyId=company_id, + id=id, + attachmentId=attachment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Candidate Uri (Link) + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/get_candidate_uri_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/get_candidate_uri_attachment.py new file mode 100644 index 0000000..206f3f9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidate_uri_attachments/get_candidate_uri_attachment.py @@ -0,0 +1,202 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_uri_attachment_model import CompanyCandidateUriAttachmentModel +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + attachment_id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/{id}/uriattachments/{attachmentId}".format( + companyId=company_id, + id=id, + attachmentId=attachment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCandidateUriAttachmentModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]: + """Get Candidate Uri Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]: + """Get Candidate Uri Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]: + """Get Candidate Uri Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel]]: + """Get Candidate Uri Attachment by Id + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCandidateUriAttachmentModel, ErrorModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidates/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_candidates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_candidates/candidates.py b/src/cinode-py-client/cinode_api_client/api/company_candidates/candidates.py new file mode 100644 index 0000000..66ec315 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_candidates/candidates.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_candidate_base_model import CompanyCandidateBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCandidateBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]: + """Get Candidates + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]: + """Get Candidates + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]: + """Get Candidates + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCandidateBaseModel"], ValidationModel]]: + """Get Candidates + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCandidateBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_capabilities/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_capabilities/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_capabilities/company_capabilities.py b/src/cinode-py-client/cinode_api_client/api/company_capabilities/company_capabilities.py new file mode 100644 index 0000000..4f80403 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_capabilities/company_capabilities.py @@ -0,0 +1,168 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_capabilities_model import CompanyCapabilitiesModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/capabilities".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCapabilitiesModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]: + """Get company capabilities + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]: + """Get company capabilities + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]: + """Get company capabilities + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel]]: + """Get company capabilities + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCapabilitiesModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_currencies/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_currencies/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_currencies/company_currencies.py b/src/cinode-py-client/cinode_api_client/api/company_currencies/company_currencies.py new file mode 100644 index 0000000..de5a8a3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_currencies/company_currencies.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.currency_model import CurrencyModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/currencies".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CurrencyModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]: + """Get company currencies + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]: + """Get company currencies + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]: + """Get company currencies + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CurrencyModel"], ValidationModel]]: + """Get company currencies + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CurrencyModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer/delete_company_customer.py b/src/cinode-py-client/cinode_api_client/api/company_customer/delete_company_customer.py new file mode 100644 index 0000000..222ed6d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer/delete_company_customer.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_delete_model import CompanyCustomerDeleteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: CompanyCustomerDeleteModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerDeleteModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerDeleteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerDeleteModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerDeleteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerDeleteModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerDeleteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerDeleteModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerDeleteModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer/get_company_customer.py b/src/cinode-py-client/cinode_api_client/api/company_customer/get_company_customer.py new file mode 100644 index 0000000..59a6d45 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer/get_company_customer.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_model import CompanyCustomerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Get company customer by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Get company customer by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Get company customer by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Get company customer by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer/new_company_customer.py b/src/cinode-py-client/cinode_api_client/api/company_customer/new_company_customer.py new file mode 100644 index 0000000..8917262 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer/new_company_customer.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_add_model import CompanyCustomerAddModel +from ...models.company_customer_model import CompanyCustomerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: CompanyCustomerAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCustomerModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddModel, +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Add company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (CompanyCustomerAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddModel, +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Add company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (CompanyCustomerAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddModel, +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Add company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (CompanyCustomerAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddModel, +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Add company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (CompanyCustomerAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer/patch_company_customer.py b/src/cinode-py-client/cinode_api_client/api/company_customer/patch_company_customer.py new file mode 100644 index 0000000..545c966 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer/patch_company_customer.py @@ -0,0 +1,209 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_model import CompanyCustomerModel +from ...models.error_model import ErrorModel +from ...models.operation import Operation +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: List["Operation"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for componentsschemas_json_patch_document_item_data in json_body: + componentsschemas_json_patch_document_item = componentsschemas_json_patch_document_item_data.to_dict() + + json_json_body.append(componentsschemas_json_patch_document_item) + + return { + "method": "patch", + "url": "/v0.1/companies/{companyId}/customers/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Patch company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Patch company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Patch company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Patch company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer/update_company_customer.py b/src/cinode-py-client/cinode_api_client/api/company_customer/update_company_customer.py new file mode 100644 index 0000000..908d4bb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer/update_company_customer.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_edit_model import CompanyCustomerEditModel +from ...models.company_customer_model import CompanyCustomerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: CompanyCustomerEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/customers/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerEditModel, +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Update company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerEditModel, +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Update company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerEditModel, +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Update company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerEditModel, +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + """Update company customer + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + json_body (CompanyCustomerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_address/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_address/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_address/customer_address.py b/src/cinode-py-client/cinode_api_client/api/company_customer_address/customer_address.py new file mode 100644 index 0000000..d9fb121 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_address/customer_address.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_address_model import CompanyCustomerAddressModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerAddressModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Get customer address by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Get customer address by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Get customer address by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Get customer address by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_address/delete_company_customer_address.py b/src/cinode-py-client/cinode_api_client/api/company_customer_address/delete_company_customer_address.py new file mode 100644 index 0000000..404dc41 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_address/delete_company_customer_address.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_address/edit_company_customer_address.py b/src/cinode-py-client/cinode_api_client/api/company_customer_address/edit_company_customer_address.py new file mode 100644 index 0000000..5aa3313 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_address/edit_company_customer_address.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_address_add_edit_model import CompanyCustomerAddressAddEditModel +from ...models.company_customer_address_model import CompanyCustomerAddressModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, + *, + json_body: CompanyCustomerAddressAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerAddressModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Update customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Update customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Update customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Update customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_address/new_company_customer_address.py b/src/cinode-py-client/cinode_api_client/api/company_customer_address/new_company_customer_address.py new file mode 100644 index 0000000..3b5358a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_address/new_company_customer_address.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_address_add_edit_model import CompanyCustomerAddressAddEditModel +from ...models.company_customer_address_model import CompanyCustomerAddressModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: CompanyCustomerAddressAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/addresses".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCustomerAddressModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Add customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Add customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Add customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerAddressAddEditModel, +) -> Optional[Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel]]: + """Add customer address + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerAddressAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerAddressModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact/contact.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/contact.py new file mode 100644 index 0000000..cc5a557 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/contact.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_contact_model import CompanyCustomerContactModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerContactModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Get customer contact by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Get customer contact by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Get customer contact by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Get customer contact by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact/delete_company_customer_contact.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/delete_company_customer_contact.py new file mode 100644 index 0000000..c36f566 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/delete_company_customer_contact.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact/edit_company_customer_contact.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/edit_company_customer_contact.py new file mode 100644 index 0000000..96e56ab --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/edit_company_customer_contact.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_contact_add_edit_model import CompanyCustomerContactAddEditModel +from ...models.company_customer_contact_model import CompanyCustomerContactModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, + *, + json_body: CompanyCustomerContactAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerContactModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Update customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Update customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Update customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Update customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact/new_company_customer_contact.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/new_company_customer_contact.py new file mode 100644 index 0000000..2388552 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_contact/new_company_customer_contact.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_contact_add_edit_model import CompanyCustomerContactAddEditModel +from ...models.company_customer_contact_model import CompanyCustomerContactModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: CompanyCustomerContactAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyCustomerContactModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Add customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Add customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Add customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerContactAddEditModel, +) -> Optional[Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel]]: + """Add customer contact + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerContactAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerContactModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/edit_customer_contact_tags.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/edit_customer_contact_tags.py new file mode 100644 index 0000000..f1b23f0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_contact_tags/edit_customer_contact_tags.py @@ -0,0 +1,301 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_tag_model import CompanyTagModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + contact_id: int, + *, + json_body: List["CompanyTagModel"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for json_body_item_data in json_body: + json_body_item = json_body_item_data.to_dict() + + json_json_body.append(json_body_item) + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts/{contactId}/tags".format( + companyId=company_id, + customerId=customer_id, + contactId=contact_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyTagModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + contact_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]: + r"""Edit Tags for CustomerContact + + Note: + + Posted tags will replace any existing tags for the contact. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/contacts/5360/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + contact_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + contact_id=contact_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + contact_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]: + r"""Edit Tags for CustomerContact + + Note: + + Posted tags will replace any existing tags for the contact. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/contacts/5360/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + contact_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + contact_id=contact_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + contact_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]: + r"""Edit Tags for CustomerContact + + Note: + + Posted tags will replace any existing tags for the contact. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/contacts/5360/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + contact_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + contact_id=contact_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + contact_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, ErrorModel, List["CompanyTagModel"], ValidationModel]]: + r"""Edit Tags for CustomerContact + + Note: + + Posted tags will replace any existing tags for the contact. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/contacts/5360/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + contact_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyTagModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + contact_id=contact_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contacts/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contacts/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_contacts/contacts.py b/src/cinode-py-client/cinode_api_client/api/company_customer_contacts/contacts.py new file mode 100644 index 0000000..bf8b20c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_contacts/contacts.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_contact_model import CompanyCustomerContactModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/contacts".format( + companyId=company_id, + customerId=customer_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCustomerContactModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]: + """Get customer contact list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]: + """Get customer contact list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]: + """Get customer contact list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerContactModel"], ValidationModel]]: + """Get customer contact list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerContactModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_event/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_event/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_event/company_customer_event.py b/src/cinode-py-client/cinode_api_client/api/company_customer_event/company_customer_event.py new file mode 100644 index 0000000..5ead424 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_event/company_customer_event.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_model import CustomerEventModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]: + """Get customer event by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]: + """Get customer event by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]: + """Get customer event by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventModel, ErrorModel, ValidationModel]]: + """Get customer event by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events/company_customer_events.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events/company_customer_events.py new file mode 100644 index 0000000..eafb657 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events/company_customer_events.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_base_model import CustomerEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events".format( + companyId=company_id, + customerId=customer_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CustomerEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer events list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer events list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer events list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer events list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/company_customer_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/company_customer_event_meeting.py new file mode 100644 index 0000000..4cb760a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/company_customer_event_meeting.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_meeting_model import CustomerEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Get customer event meeting by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Get customer event meeting by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Get customer event meeting by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Get customer event meeting by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/delete_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/delete_meeting.py new file mode 100644 index 0000000..9d5da9b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/delete_meeting.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/new_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/new_meeting.py new file mode 100644 index 0000000..540f764 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/new_meeting.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_meeting_add_edit_model import CustomerEventMeetingAddEditModel +from ...models.customer_event_meeting_model import CustomerEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: CustomerEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CustomerEventMeetingModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Add customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Add customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Add customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Add customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/update_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/update_meeting.py new file mode 100644 index 0000000..fd68e22 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meeting/update_meeting.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_meeting_add_edit_model import CustomerEventMeetingAddEditModel +from ...models.customer_event_meeting_model import CustomerEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, + *, + json_body: CustomerEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Update customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Update customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Update customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventMeetingAddEditModel, +) -> Optional[Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel]]: + """Update customer event meeting + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/company_customer_event_meetings.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/company_customer_event_meetings.py new file mode 100644 index 0000000..86b9c0d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_meetings/company_customer_event_meetings.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_base_model import CustomerEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/meetings".format( + companyId=company_id, + customerId=customer_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CustomerEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event meetings list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event meetings list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event meetings list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event meetings list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/company_customer_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/company_customer_event_note.py new file mode 100644 index 0000000..2833787 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/company_customer_event_note.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_note_model import CustomerEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/notes/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get customer event note by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get customer event note by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get customer event note by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get customer event note by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/delete_note.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/delete_note.py new file mode 100644 index 0000000..85a07b9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/delete_note.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/notes/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/new_note.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/new_note.py new file mode 100644 index 0000000..3a508c3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/new_note.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_note_add_edit_model import CustomerEventNoteAddEditModel +from ...models.customer_event_note_model import CustomerEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: CustomerEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/notes".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CustomerEventNoteModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Add customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Add customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Add customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Add customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/update_note.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/update_note.py new file mode 100644 index 0000000..c2700b9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_note/update_note.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_note_add_edit_model import CustomerEventNoteAddEditModel +from ...models.customer_event_note_model import CustomerEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, + *, + json_body: CustomerEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/notes/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Update customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Update customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Update customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventNoteAddEditModel, +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Update customer event note + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/company_customer_event_notes.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/company_customer_event_notes.py new file mode 100644 index 0000000..67141ff --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_notes/company_customer_event_notes.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_base_model import CustomerEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/notes".format( + companyId=company_id, + customerId=customer_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CustomerEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event notes list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event notes list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event notes list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event notes list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/company_customer_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/company_customer_event_task.py new file mode 100644 index 0000000..50e4faf --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/company_customer_event_task.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_task_model import CustomerEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/tasks/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Get customer event task by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Get customer event task by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Get customer event task by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Get customer event task by id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/delete_task.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/delete_task.py new file mode 100644 index 0000000..4cbc8a2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/delete_task.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/tasks/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/new_task.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/new_task.py new file mode 100644 index 0000000..14454b4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/new_task.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_task_add_edit_model import CustomerEventTaskAddEditModel +from ...models.customer_event_task_model import CustomerEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: CustomerEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/tasks".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CustomerEventTaskModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Add customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Add customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Add customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Add customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/update_task.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/update_task.py new file mode 100644 index 0000000..4111f22 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_task/update_task.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_task_add_edit_model import CustomerEventTaskAddEditModel +from ...models.customer_event_task_model import CustomerEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: str, + *, + json_body: CustomerEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/tasks/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Update customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Update customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Update customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CustomerEventTaskAddEditModel, +) -> Optional[Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel]]: + """Update customer event task + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + id (str): + json_body (CustomerEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/company_customer_event_tasks.py b/src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/company_customer_event_tasks.py new file mode 100644 index 0000000..69cbaec --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_events_tasks/company_customer_event_tasks.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_base_model import CustomerEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/events/tasks".format( + companyId=company_id, + customerId=customer_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CustomerEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event tasks list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event tasks list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event tasks list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CustomerEventBaseModel"], ValidationModel]]: + """Get customer event tasks list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CustomerEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/get_customer_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/get_customer_attachment.py new file mode 100644 index 0000000..5868ecd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_file_attachment/get_customer_attachment.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + attachment_id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{id}/attachments/{attachmentId}".format( + companyId=company_id, + id=id, + attachmentId=attachment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, str]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(str, response.json()) + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get customer file attachment by Id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get customer file attachment by Id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return sync_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get customer file attachment by Id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get customer file attachment by Id + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_managers/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_managers/add_company_customer_responsible.py b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/add_company_customer_responsible.py new file mode 100644 index 0000000..10a581d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/add_company_customer_responsible.py @@ -0,0 +1,244 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_manager_model import CompanyCustomerManagerModel +from ...models.company_customer_managers_add_edit_model import CompanyCustomerManagersAddEditModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: CompanyCustomerManagersAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/managers".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCustomerManagerModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerManagersAddEditModel, +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Add customer responsible + + Sample request: + + POST /v0.1/companies/1/customers/22228/managers + { + [ + 51096 + ] + } + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerManagersAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerManagersAddEditModel, +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Add customer responsible + + Sample request: + + POST /v0.1/companies/1/customers/22228/managers + { + [ + 51096 + ] + } + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerManagersAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerManagersAddEditModel, +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Add customer responsible + + Sample request: + + POST /v0.1/companies/1/customers/22228/managers + { + [ + 51096 + ] + } + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerManagersAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyCustomerManagersAddEditModel, +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Add customer responsible + + Sample request: + + POST /v0.1/companies/1/customers/22228/managers + { + [ + 51096 + ] + } + + Args: + company_id (int): + customer_id (int): + json_body (CompanyCustomerManagersAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_managers/company_customer_managers.py b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/company_customer_managers.py new file mode 100644 index 0000000..479bd20 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/company_customer_managers.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_manager_model import CompanyCustomerManagerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/managers".format( + companyId=company_id, + customerId=customer_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCustomerManagerModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Get customer managers + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Get customer managers + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Get customer managers + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerManagerModel"], ValidationModel]]: + """Get customer managers + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + customer_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerManagerModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_managers/remove_customer_manager.py b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/remove_customer_manager.py new file mode 100644 index 0000000..4ea2660 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_managers/remove_customer_manager.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/managers/{id}".format( + companyId=company_id, + customerId=customer_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove customer responsible + + Sample request: + + DELETE /v0.1/companies/1/customers/22228/managers/54632 + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove customer responsible + + Sample request: + + DELETE /v0.1/companies/1/customers/22228/managers/54632 + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove customer responsible + + Sample request: + + DELETE /v0.1/companies/1/customers/22228/managers/54632 + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove customer responsible + + Sample request: + + DELETE /v0.1/companies/1/customers/22228/managers/54632 + + Args: + company_id (int): + customer_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_tags/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customer_tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customer_tags/edit_customer_tags.py b/src/cinode-py-client/cinode_api_client/api/company_customer_tags/edit_customer_tags.py new file mode 100644 index 0000000..166c4e6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customer_tags/edit_customer_tags.py @@ -0,0 +1,283 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_model import CompanyCustomerModel +from ...models.company_tag_model import CompanyTagModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + customer_id: int, + *, + json_body: List["CompanyTagModel"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for json_body_item_data in json_body: + json_body_item = json_body_item_data.to_dict() + + json_json_body.append(json_body_item) + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/{customerId}/tags".format( + companyId=company_id, + customerId=customer_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyCustomerModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for Customer + + Note: + + Posted tags will replace any existing tags for the customer. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for Customer + + Note: + + Posted tags will replace any existing tags for the customer. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for Customer + + Note: + + Posted tags will replace any existing tags for the customer. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + customer_id=customer_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + customer_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for Customer + + Note: + + Posted tags will replace any existing tags for the customer. + A new tag will be created if the Id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/customers/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + customer_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyCustomerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + customer_id=customer_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customers/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customers/company_customers.py b/src/cinode-py-client/cinode_api_client/api/company_customers/company_customers.py new file mode 100644 index 0000000..2533901 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customers/company_customers.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_base_model import CompanyCustomerBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCustomerBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerBaseModel"], ValidationModel]]: + """Get company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerBaseModel"], ValidationModel]]: + """Get company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerBaseModel"], ValidationModel]]: + """Get company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerBaseModel"], ValidationModel]]: + """Get company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_customers_extended/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_customers_extended/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_customers_extended/customers_extended.py b/src/cinode-py-client/cinode_api_client/api/company_customers_extended/customers_extended.py new file mode 100644 index 0000000..22a5856 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_customers_extended/customers_extended.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_customer_extended_model import CompanyCustomerExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/customers/extended".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyCustomerExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerExtendedModel"], ValidationModel]]: + """Get extended company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerExtendedModel"], ValidationModel]]: + """Get extended company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyCustomerExtendedModel"], ValidationModel]]: + """Get extended company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyCustomerExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyCustomerExtendedModel"], ValidationModel]]: + """Get extended company customers list + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyCustomerExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_image/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_image/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_image/company_image.py b/src/cinode-py-client/cinode_api_client/api/company_image/company_image.py new file mode 100644 index 0000000..30227e0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_image/company_image.py @@ -0,0 +1,180 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_image_model import CompanyImageModel +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/images/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyImageModel, ErrorModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyImageModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyImageModel, ErrorModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyImageModel, ErrorModel]]: + """Get Company Image by Id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyImageModel, ErrorModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyImageModel, ErrorModel]]: + """Get Company Image by Id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyImageModel, ErrorModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyImageModel, ErrorModel]]: + """Get Company Image by Id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyImageModel, ErrorModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyImageModel, ErrorModel]]: + """Get Company Image by Id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyImageModel, ErrorModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_image/company_image_download.py b/src/cinode-py-client/cinode_api_client/api/company_image/company_image_download.py new file mode 100644 index 0000000..3c570a4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_image/company_image_download.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + image_file_name: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/images/{id}/{imageFileName}".format( + companyId=company_id, + id=id, + imageFileName=image_file_name, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, str]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(str, response.json()) + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + image_file_name: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Download Company Image + + Args: + company_id (int): + id (int): + image_file_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + image_file_name=image_file_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + image_file_name: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Download Company Image + + Args: + company_id (int): + id (int): + image_file_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return sync_detailed( + company_id=company_id, + id=id, + image_file_name=image_file_name, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + image_file_name: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Download Company Image + + Args: + company_id (int): + id (int): + image_file_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + image_file_name=image_file_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + image_file_name: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Download Company Image + + Args: + company_id (int): + id (int): + image_file_name (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + image_file_name=image_file_name, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_images/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_images/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_images/add_company_image.py b/src/cinode-py-client/cinode_api_client/api/company_images/add_company_image.py new file mode 100644 index 0000000..762d42f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_images/add_company_image.py @@ -0,0 +1,197 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.add_company_image_multipart_data import AddCompanyImageMultipartData +from ...models.company_image_model import CompanyImageModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + multipart_data: AddCompanyImageMultipartData, +) -> Dict[str, Any]: + pass + + multipart_multipart_data = multipart_data.to_multipart() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{id}/images".format( + companyId=company_id, + id=id, + ), + "files": multipart_multipart_data, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyImageModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: AddCompanyImageMultipartData, +) -> Response[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]]: + """Add Image to User + + Args: + company_id (int): + id (int): + multipart_data (AddCompanyImageMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + multipart_data=multipart_data, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: AddCompanyImageMultipartData, +) -> Optional[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]]: + """Add Image to User + + Args: + company_id (int): + id (int): + multipart_data (AddCompanyImageMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyImageModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + multipart_data=multipart_data, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: AddCompanyImageMultipartData, +) -> Response[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]]: + """Add Image to User + + Args: + company_id (int): + id (int): + multipart_data (AddCompanyImageMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + multipart_data=multipart_data, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: AddCompanyImageMultipartData, +) -> Optional[Union[Any, CompanyImageModel, ErrorModel, ValidationModel]]: + """Add Image to User + + Args: + company_id (int): + id (int): + multipart_data (AddCompanyImageMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyImageModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + multipart_data=multipart_data, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_images/company_images.py b/src/cinode-py-client/cinode_api_client/api/company_images/company_images.py new file mode 100644 index 0000000..64573b5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_images/company_images.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_image_model import CompanyImageModel +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{id}/images".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyImageModel"]]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyImageModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyImageModel"]]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyImageModel"]]]: + """Get Company Images Assigned to User + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyImageModel']]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyImageModel"]]]: + """Get Company Images Assigned to User + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyImageModel']] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyImageModel"]]]: + """Get Company Images Assigned to User + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyImageModel']]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyImageModel"]]]: + """Get Company Images Assigned to User + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyImageModel']] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_managers/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_managers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_managers/company_managers.py b/src/cinode-py-client/cinode_api_client/api/company_managers/company_managers.py new file mode 100644 index 0000000..fcfd9d9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_managers/company_managers.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_base_model import CompanyUserBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/managers".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserBaseModel"], ValidationModel]]: + """Get company managers + + Sample request: + + GET /v0.1/companies/1/managers + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserBaseModel"], ValidationModel]]: + """Get company managers + + Sample request: + + GET /v0.1/companies/1/managers + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserBaseModel"], ValidationModel]]: + """Get company managers + + Sample request: + + GET /v0.1/companies/1/managers + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserBaseModel"], ValidationModel]]: + """Get company managers + + Sample request: + + GET /v0.1/companies/1/managers + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_profiles/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_profiles/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_profiles/company_profiles.py b/src/cinode-py-client/cinode_api_client/api/company_profiles/company_profiles.py new file mode 100644 index 0000000..8af7294 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_profiles/company_profiles.py @@ -0,0 +1,242 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_profile_filter_model import CompanyProfileFilterModel +from ...models.company_profiles_model import CompanyProfilesModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: CompanyProfileFilterModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/profiles".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyProfilesModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyProfileFilterModel, +) -> Response[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]]: + r"""Get profiles list + + Sample request: + + POST /v0.1/companies/1/profiles + { + \"createdOffsetDays\": 90, + \"updatedOffsetDays\": 30, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15, + \"order\": 0, + \"sortBy\": 1 + } + } + + Args: + company_id (int): + json_body (CompanyProfileFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyProfileFilterModel, +) -> Optional[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]]: + r"""Get profiles list + + Sample request: + + POST /v0.1/companies/1/profiles + { + \"createdOffsetDays\": 90, + \"updatedOffsetDays\": 30, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15, + \"order\": 0, + \"sortBy\": 1 + } + } + + Args: + company_id (int): + json_body (CompanyProfileFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyProfileFilterModel, +) -> Response[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]]: + r"""Get profiles list + + Sample request: + + POST /v0.1/companies/1/profiles + { + \"createdOffsetDays\": 90, + \"updatedOffsetDays\": 30, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15, + \"order\": 0, + \"sortBy\": 1 + } + } + + Args: + company_id (int): + json_body (CompanyProfileFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyProfileFilterModel, +) -> Optional[Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel]]: + r"""Get profiles list + + Sample request: + + POST /v0.1/companies/1/profiles + { + \"createdOffsetDays\": 90, + \"updatedOffsetDays\": 30, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15, + \"order\": 0, + \"sortBy\": 1 + } + } + + Args: + company_id (int): + json_body (CompanyProfileFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyProfilesModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/get_project_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/get_project_attachment.py new file mode 100644 index 0000000..f5852f5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_project_file_attachment/get_project_attachment.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + attachment_id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{id}/attachments/{attachmentId}".format( + companyId=company_id, + id=id, + attachmentId=attachment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, str]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(str, response.json()) + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get Project file attachment by Id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get Project file attachment by Id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return sync_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get Project file attachment by Id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get Project file attachment by Id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/recruitment_managers.py b/src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/recruitment_managers.py new file mode 100644 index 0000000..21c0468 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_recruitment_managers/recruitment_managers.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_recruitment_manager_model import CompanyRecruitmentManagerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/recruitment/managers".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyRecruitmentManagerModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyRecruitmentManagerModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyRecruitmentManagerModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyRecruitmentManagerModel"], ValidationModel]]: + """Get recruitment managers + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyRecruitmentManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyRecruitmentManagerModel"], ValidationModel]]: + """Get recruitment managers + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyRecruitmentManagerModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyRecruitmentManagerModel"], ValidationModel]]: + """Get recruitment managers + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyRecruitmentManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyRecruitmentManagerModel"], ValidationModel]]: + """Get recruitment managers + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyRecruitmentManagerModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_resumes/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_resumes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_resumes/company_resumes.py b/src/cinode-py-client/cinode_api_client/api/company_resumes/company_resumes.py new file mode 100644 index 0000000..dafe536 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_resumes/company_resumes.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_resume_base_model import CompanyUserResumeBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/resumes".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserResumeBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/get_company_subcontractor_group.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/get_company_subcontractor_group.py new file mode 100644 index 0000000..e724177 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group/get_company_subcontractor_group.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_subcontractor_group_model import CompanySubcontractorGroupModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + subcontractor_group_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/groups/{subcontractorGroupId}".format( + companyId=company_id, + subcontractorGroupId=subcontractor_group_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanySubcontractorGroupModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]]: + """Get Subcontractor Group by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]]: + """Get Subcontractor Group by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]]: + """Get Subcontractor Group by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel]]: + """Get Subcontractor Group by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanySubcontractorGroupModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/add_company_subcontractor_group_member.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/add_company_subcontractor_group_member.py new file mode 100644 index 0000000..7e88d0e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/add_company_subcontractor_group_member.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.add_company_subcontractor_group_member_model import AddCompanySubcontractorGroupMemberModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + subcontractor_group_id: int, + *, + json_body: AddCompanySubcontractorGroupMemberModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/subcontractors/groups/{subcontractorGroupId}/members".format( + companyId=company_id, + subcontractorGroupId=subcontractor_group_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.NO_CONTENT: + response_204 = cast(Any, None) + return response_204 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AddCompanySubcontractorGroupMemberModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Add subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + json_body (AddCompanySubcontractorGroupMemberModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AddCompanySubcontractorGroupMemberModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Add subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + json_body (AddCompanySubcontractorGroupMemberModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AddCompanySubcontractorGroupMemberModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Add subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + json_body (AddCompanySubcontractorGroupMemberModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + subcontractor_group_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: AddCompanySubcontractorGroupMemberModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Add subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + json_body (AddCompanySubcontractorGroupMemberModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/delete_company_subcontractor_group_member.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/delete_company_subcontractor_group_member.py new file mode 100644 index 0000000..eb8121c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_group_members/delete_company_subcontractor_group_member.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + subcontractor_group_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/subcontractors/groups/{subcontractorGroupId}/members/{id}".format( + companyId=company_id, + subcontractorGroupId=subcontractor_group_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.NO_CONTENT: + response_204 = cast(Any, None) + return response_204 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + subcontractor_group_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + subcontractor_group_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + subcontractor_group_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + subcontractor_group_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor group member + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_group_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + subcontractor_group_id=subcontractor_group_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/get_company_subcontractor_groups.py b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/get_company_subcontractor_groups.py new file mode 100644 index 0000000..99a7315 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_subcontractor_groups/get_company_subcontractor_groups.py @@ -0,0 +1,181 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_subcontractor_group_model import CompanySubcontractorGroupModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/groups".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanySubcontractorGroupModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanySubcontractorGroupModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanySubcontractorGroupModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanySubcontractorGroupModel"], ValidationModel]]: + """Get Subcontractor Groups by Company Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanySubcontractorGroupModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanySubcontractorGroupModel"], ValidationModel]]: + """Get Subcontractor Groups by Company Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanySubcontractorGroupModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanySubcontractorGroupModel"], ValidationModel]]: + """Get Subcontractor Groups by Company Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanySubcontractorGroupModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanySubcontractorGroupModel"], ValidationModel]]: + """Get Subcontractor Groups by Company Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanySubcontractorGroupModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_tag/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_tag/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_tag/company_tag.py b/src/cinode-py-client/cinode_api_client/api/company_tag/company_tag.py new file mode 100644 index 0000000..4723dcb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_tag/company_tag.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_tag_model import CompanyTagModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/tags/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyTagModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.CREATED: + response_201 = cast(Any, None) + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]]: + """Get company tag by Id + + Sample request: + + GET /v0.1/companies/1/tags/1 + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]]: + """Get company tag by Id + + Sample request: + + GET /v0.1/companies/1/tags/1 + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyTagModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]]: + """Get company tag by Id + + Sample request: + + GET /v0.1/companies/1/tags/1 + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyTagModel, ErrorModel, ValidationModel]]: + """Get company tag by Id + + Sample request: + + GET /v0.1/companies/1/tags/1 + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyTagModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_tags/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_tags/company_tags.py b/src/cinode-py-client/cinode_api_client/api/company_tags/company_tags.py new file mode 100644 index 0000000..f599469 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_tags/company_tags.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_tag_base_model import CompanyTagBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/tags".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyTagBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyTagBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyTagBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyTagBaseModel"], ValidationModel]]: + """Get company tags + + Sample request: + + GET /v0.1/companies/1/tags + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyTagBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyTagBaseModel"], ValidationModel]]: + """Get company tags + + Sample request: + + GET /v0.1/companies/1/tags + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyTagBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyTagBaseModel"], ValidationModel]]: + """Get company tags + + Sample request: + + GET /v0.1/companies/1/tags + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyTagBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyTagBaseModel"], ValidationModel]]: + """Get company tags + + Sample request: + + GET /v0.1/companies/1/tags + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyTagBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_team/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_team/new_team.py b/src/cinode-py-client/cinode_api_client/api/company_team/new_team.py new file mode 100644 index 0000000..bc46a5a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team/new_team.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_add_edit_model import TeamAddEditModel +from ...models.team_model import TeamModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: TeamAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/teams".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = TeamModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Add team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Add team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Add team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Add team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team/team.py b/src/cinode-py-client/cinode_api_client/api/company_team/team.py new file mode 100644 index 0000000..69a9947 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team/team.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_model import TeamModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/teams/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = TeamModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Get team by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Get team by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Get team by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Get team by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team/update_team.py b/src/cinode-py-client/cinode_api_client/api/company_team/update_team.py new file mode 100644 index 0000000..0a4d8bf --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team/update_team.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_add_edit_model import TeamAddEditModel +from ...models.team_model import TeamModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: TeamAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/teams/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = TeamModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Update team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Update team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Response[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Update team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamAddEditModel, +) -> Optional[Union[Any, ErrorModel, TeamModel, ValidationModel]]: + """Update team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (TeamAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_managers/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_team_managers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_managers/add_team_manager.py b/src/cinode-py-client/cinode_api_client/api/company_team_managers/add_team_manager.py new file mode 100644 index 0000000..1d69c28 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_managers/add_team_manager.py @@ -0,0 +1,234 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_manager_edit_model import TeamManagerEditModel +from ...models.team_manager_model import TeamManagerModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: str, + *, + json_body: TeamManagerEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/managers".format( + companyId=company_id, + teamId=team_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["TeamManagerModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TeamManagerModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["TeamManagerModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamManagerEditModel, +) -> Response[Union[Any, ErrorModel, List["TeamManagerModel"], ValidationModel]]: + r"""Add team manager + + Sample request: + + POST /v0.1/companies/1/teams/1234/managers + { + \"teamId\" : 1234, + \"companyUserId\" : 54632 + } + + Args: + company_id (int): + team_id (str): + json_body (TeamManagerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamManagerEditModel, +) -> Optional[Union[Any, ErrorModel, List["TeamManagerModel"], ValidationModel]]: + r"""Add team manager + + Sample request: + + POST /v0.1/companies/1/teams/1234/managers + { + \"teamId\" : 1234, + \"companyUserId\" : 54632 + } + + Args: + company_id (int): + team_id (str): + json_body (TeamManagerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamManagerModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamManagerEditModel, +) -> Response[Union[Any, ErrorModel, List["TeamManagerModel"], ValidationModel]]: + r"""Add team manager + + Sample request: + + POST /v0.1/companies/1/teams/1234/managers + { + \"teamId\" : 1234, + \"companyUserId\" : 54632 + } + + Args: + company_id (int): + team_id (str): + json_body (TeamManagerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamManagerModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamManagerEditModel, +) -> Optional[Union[Any, ErrorModel, List["TeamManagerModel"], ValidationModel]]: + r"""Add team manager + + Sample request: + + POST /v0.1/companies/1/teams/1234/managers + { + \"teamId\" : 1234, + \"companyUserId\" : 54632 + } + + Args: + company_id (int): + team_id (str): + json_body (TeamManagerEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamManagerModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_managers/remove_team_manager.py b/src/cinode-py-client/cinode_api_client/api/company_team_managers/remove_team_manager.py new file mode 100644 index 0000000..be192bf --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_managers/remove_team_manager.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/managers/{id}".format( + companyId=company_id, + teamId=team_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove team manager + + Sample request: + + DELETE /v0.1/companies/1/teams/1234/managers/54632 + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove team manager + + Sample request: + + DELETE /v0.1/companies/1/teams/1234/managers/54632 + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove team manager + + Sample request: + + DELETE /v0.1/companies/1/teams/1234/managers/54632 + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove team manager + + Sample request: + + DELETE /v0.1/companies/1/teams/1234/managers/54632 + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_managers/team_managers.py b/src/cinode-py-client/cinode_api_client/api/company_team_managers/team_managers.py new file mode 100644 index 0000000..6a9fcfd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_managers/team_managers.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_extended_model import CompanyUserExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/managers".format( + companyId=company_id, + teamId=team_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team managers + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team managers + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team managers + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team managers + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_member/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_team_member/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_member/add_team_member.py b/src/cinode-py-client/cinode_api_client/api/company_team_member/add_team_member.py new file mode 100644 index 0000000..96294f0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_member/add_team_member.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_member_add_model import TeamMemberAddModel +from ...models.team_member_model import TeamMemberModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + *, + json_body: TeamMemberAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/members".format( + companyId=company_id, + teamId=team_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = TeamMemberModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamMemberModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamMemberModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_member/get_team_member.py b/src/cinode-py-client/cinode_api_client/api/company_team_member/get_team_member.py new file mode 100644 index 0000000..7f03eab --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_member/get_team_member.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_member_model import TeamMemberModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/members/{id}".format( + companyId=company_id, + teamId=team_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = TeamMemberModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Get team member + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Get team member + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamMemberModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Get team member + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Get team member + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamMemberModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_member/move_team_member.py b/src/cinode-py-client/cinode_api_client/api/company_team_member/move_team_member.py new file mode 100644 index 0000000..3a69fb7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_member/move_team_member.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_member_move_model import TeamMemberMoveModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + id: int, + *, + json_body: TeamMemberMoveModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/members/{id}/move".format( + companyId=company_id, + teamId=team_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.NO_CONTENT: + response_204 = cast(Any, None) + return response_204 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberMoveModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Move team member and associated bookings to another team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberMoveModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberMoveModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Move team member and associated bookings to another team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberMoveModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberMoveModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Move team member and associated bookings to another team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberMoveModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberMoveModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Move team member and associated bookings to another team + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberMoveModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_member/remove_team_member.py b/src/cinode-py-client/cinode_api_client/api/company_team_member/remove_team_member.py new file mode 100644 index 0000000..0a0d4aa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_member/remove_team_member.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/members/{id}".format( + companyId=company_id, + teamId=team_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_member/update_team_member.py b/src/cinode-py-client/cinode_api_client/api/company_team_member/update_team_member.py new file mode 100644 index 0000000..ad8e3e9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_member/update_team_member.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_member_edit_model import TeamMemberEditModel +from ...models.team_member_model import TeamMemberModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + id: int, + *, + json_body: TeamMemberEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/members/{id}".format( + companyId=company_id, + teamId=team_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = TeamMemberModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberEditModel, +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Update team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberEditModel, +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Update team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamMemberModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberEditModel, +) -> Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Update team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberEditModel, +) -> Optional[Union[Any, ErrorModel, TeamMemberModel, ValidationModel]]: + """Update team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + json_body (TeamMemberEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, TeamMemberModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_members/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_team_members/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_members/get_team_members.py b/src/cinode-py-client/cinode_api_client/api/company_team_members/get_team_members.py new file mode 100644 index 0000000..6d85f2a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_members/get_team_members.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_member_model import TeamMemberModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/members".format( + companyId=company_id, + teamId=team_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TeamMemberModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_users/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_team_users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_users/add_team_user.py b/src/cinode-py-client/cinode_api_client/api/company_team_users/add_team_user.py new file mode 100644 index 0000000..d32daee --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_users/add_team_user.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_member_add_model import TeamMemberAddModel +from ...models.team_member_model import TeamMemberModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + *, + json_body: TeamMemberAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/users".format( + companyId=company_id, + teamId=team_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TeamMemberModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Response[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Optional[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Response[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: TeamMemberAddModel, +) -> Optional[Union[Any, ErrorModel, List["TeamMemberModel"], ValidationModel]]: + """Add team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + json_body (TeamMemberAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamMemberModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_users/get_team_users.py b/src/cinode-py-client/cinode_api_client/api/company_team_users/get_team_users.py new file mode 100644 index 0000000..7b7433b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_users/get_team_users.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_extended_model import CompanyUserExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/users".format( + companyId=company_id, + teamId=team_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get team members + + Args: + company_id (int): + team_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_team_users/remove_team_user.py b/src/cinode-py-client/cinode_api_client/api/company_team_users/remove_team_user.py new file mode 100644 index 0000000..299e26f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_team_users/remove_team_user.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_extended_model import CompanyUserExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + team_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/teams/{teamId}/users/{id}".format( + companyId=company_id, + teamId=team_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + team_id=team_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + team_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Remove team member + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + team_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + team_id=team_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_teams/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_teams/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_teams/company_teams.py b/src/cinode-py-client/cinode_api_client/api/company_teams/company_teams.py new file mode 100644 index 0000000..7854faa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_teams/company_teams.py @@ -0,0 +1,173 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_base_model import TeamBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/teams".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TeamBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user/add_company_user.py b/src/cinode-py-client/cinode_api_client/api/company_user/add_company_user.py new file mode 100644 index 0000000..652c606 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user/add_company_user.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_add_model import CompanyUserAddModel +from ...models.company_user_full_model import CompanyUserFullModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: CompanyUserAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserFullModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserAddModel, +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Add company user employee + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (CompanyUserAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserAddModel, +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Add company user employee + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (CompanyUserAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserAddModel, +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Add company user employee + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (CompanyUserAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserAddModel, +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Add company user employee + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + json_body (CompanyUserAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user/delete_company_user.py b/src/cinode-py-client/cinode_api_client/api/company_user/delete_company_user.py new file mode 100644 index 0000000..8179bb5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user/delete_company_user.py @@ -0,0 +1,228 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + company_id: int, + id: int, + *, + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Dict[str, Any]: + pass + + params: Dict[str, Any] = {} + params["firstName"] = first_name + + params["lastName"] = last_name + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{id}".format( + companyId=company_id, + id=id, + ), + "params": params, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete user from the system + Firstly, the user has to be disconnected, which can be done through a PATCH or PUT + This action is irreversible, use with caution + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + first_name=first_name, + last_name=last_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete user from the system + Firstly, the user has to be disconnected, which can be done through a PATCH or PUT + This action is irreversible, use with caution + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + first_name=first_name, + last_name=last_name, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete user from the system + Firstly, the user has to be disconnected, which can be done through a PATCH or PUT + This action is irreversible, use with caution + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + first_name=first_name, + last_name=last_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete user from the system + Firstly, the user has to be disconnected, which can be done through a PATCH or PUT + This action is irreversible, use with caution + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + first_name=first_name, + last_name=last_name, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user/patch_company_user.py b/src/cinode-py-client/cinode_api_client/api/company_user/patch_company_user.py new file mode 100644 index 0000000..08852f5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user/patch_company_user.py @@ -0,0 +1,209 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_full_model import CompanyUserFullModel +from ...models.error_model import ErrorModel +from ...models.operation import Operation +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: List["Operation"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for componentsschemas_json_patch_document_item_data in json_body: + componentsschemas_json_patch_document_item = componentsschemas_json_patch_document_item_data.to_dict() + + json_json_body.append(componentsschemas_json_patch_document_item) + + return { + "method": "patch", + "url": "/v0.1/companies/{companyId}/users/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserFullModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Patch company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Patch company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Patch company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["Operation"], +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Patch company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (List['Operation']): Array of patch operations to perform + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user/update_company_user.py b/src/cinode-py-client/cinode_api_client/api/company_user/update_company_user.py new file mode 100644 index 0000000..e72ba2f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user/update_company_user.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_edit_model import CompanyUserEditModel +from ...models.company_user_full_model import CompanyUserFullModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: CompanyUserEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserFullModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEditModel, +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Update company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (CompanyUserEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEditModel, +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Update company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (CompanyUserEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEditModel, +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Update company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (CompanyUserEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEditModel, +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Update company user + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + json_body (CompanyUserEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user/user.py b/src/cinode-py-client/cinode_api_client/api/company_user/user.py new file mode 100644 index 0000000..352d40a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user/user.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_model import CompanyUserModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_convert/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_convert/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_convert/convert_user_to_aad_account.py b/src/cinode-py-client/cinode_api_client/api/company_user_convert/convert_user_to_aad_account.py new file mode 100644 index 0000000..931891f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_convert/convert_user_to_aad_account.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.convert_company_user_to_aad_account_model import ConvertCompanyUserToAadAccountModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: str, + company_user_id: int, + *, + json_body: ConvertCompanyUserToAadAccountModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/convert-aad".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: str, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ConvertCompanyUserToAadAccountModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Convert company user employee to an AAD account + + Requires access level: CompanyAdmin. + + Args: + company_id (str): + company_user_id (int): + json_body (ConvertCompanyUserToAadAccountModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: str, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ConvertCompanyUserToAadAccountModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Convert company user employee to an AAD account + + Requires access level: CompanyAdmin. + + Args: + company_id (str): + company_user_id (int): + json_body (ConvertCompanyUserToAadAccountModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: str, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ConvertCompanyUserToAadAccountModel, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Convert company user employee to an AAD account + + Requires access level: CompanyAdmin. + + Args: + company_id (str): + company_user_id (int): + json_body (ConvertCompanyUserToAadAccountModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: str, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ConvertCompanyUserToAadAccountModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Convert company user employee to an AAD account + + Requires access level: CompanyAdmin. + + Args: + company_id (str): + company_user_id (int): + json_body (ConvertCompanyUserToAadAccountModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event/company_user_employee_event.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event/company_user_employee_event.py new file mode 100644 index 0000000..59a10bc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event/company_user_employee_event.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_model import CompanyUserEventModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get employee event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get employee event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get employee event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get employee event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/company_user_employee_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/company_user_employee_event_meeting.py new file mode 100644 index 0000000..d55a70a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/company_user_employee_event_meeting.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_meeting_model import CompanyUserEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/meetings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/delete_company_user_employee_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/delete_company_user_employee_event_meeting.py new file mode 100644 index 0000000..6e5fb0f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/delete_company_user_employee_event_meeting.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/meetings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/new_company_user_employee_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/new_company_user_employee_event_meeting.py new file mode 100644 index 0000000..74eb58b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/new_company_user_employee_event_meeting.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_meeting_add_edit_model import CompanyUserEventMeetingAddEditModel +from ...models.company_user_event_meeting_model import CompanyUserEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/meetings".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserEventMeetingModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/update_company_user_employee_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/update_company_user_employee_event_meeting.py new file mode 100644 index 0000000..3f555e7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_meeting/update_company_user_employee_event_meeting.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_meeting_add_edit_model import CompanyUserEventMeetingAddEditModel +from ...models.company_user_event_meeting_model import CompanyUserEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, + *, + json_body: CompanyUserEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/meetings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates employee meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/company_user_employee_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/company_user_employee_event_note.py new file mode 100644 index 0000000..d97e150 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/company_user_employee_event_note.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_note_model import CompanyUserEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/notes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/delete_company_user_employee_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/delete_company_user_employee_event_note.py new file mode 100644 index 0000000..73fc133 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/delete_company_user_employee_event_note.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/notes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/new_company_user_employee_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/new_company_user_employee_event_note.py new file mode 100644 index 0000000..93ca77d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/new_company_user_employee_event_note.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_note_add_edit_model import CompanyUserEventNoteAddEditModel +from ...models.company_user_event_note_model import CompanyUserEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/notes".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserEventNoteModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/update_company_user_employee_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/update_company_user_employee_event_note.py new file mode 100644 index 0000000..ce3f56c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_note/update_company_user_employee_event_note.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_note_add_edit_model import CompanyUserEventNoteAddEditModel +from ...models.company_user_event_note_model import CompanyUserEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, + *, + json_body: CompanyUserEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/notes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates employee note event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/company_user_employee_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/company_user_employee_event_task.py new file mode 100644 index 0000000..54546a5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/company_user_employee_event_task.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_task_model import CompanyUserEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/tasks/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/delete_company_user_employee_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/delete_company_user_employee_event_task.py new file mode 100644 index 0000000..63dd05a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/delete_company_user_employee_event_task.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/tasks/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/new_company_user_employee_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/new_company_user_employee_event_task.py new file mode 100644 index 0000000..e205694 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/new_company_user_employee_event_task.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_task_add_edit_model import CompanyUserEventTaskAddEditModel +from ...models.company_user_event_task_model import CompanyUserEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/tasks".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserEventTaskModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new employee task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/update_company_user_employee_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/update_company_user_employee_event_task.py new file mode 100644 index 0000000..22d7735 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_event_task/update_company_user_employee_event_task.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_task_add_edit_model import CompanyUserEventTaskAddEditModel +from ...models.company_user_event_task_model import CompanyUserEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, + *, + json_body: CompanyUserEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/tasks/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates employee's task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates employee's task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates employee's task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates employee's task event + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events/company_user_employee_events.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events/company_user_employee_events.py new file mode 100644 index 0000000..12b3bad --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events/company_user_employee_events.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/company_user_employee_event_meeting_list.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/company_user_employee_event_meeting_list.py new file mode 100644 index 0000000..e468f7a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_meetings/company_user_employee_event_meeting_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/meetings".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee meetings events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee meetings events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee meetings events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee meetings events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/company_user_employee_event_note_list.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/company_user_employee_event_note_list.py new file mode 100644 index 0000000..36123c2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_notes/company_user_employee_event_note_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/notes".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee notes events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee notes events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee notes events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee notes events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/company_user_employee_event_task_list.py b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/company_user_employee_event_task_list.py new file mode 100644 index 0000000..2815681 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_employee_events_tasks/company_user_employee_event_task_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/employees/{companyUserId}/events/tasks".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee tasks events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee tasks events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee tasks events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get employee tasks events list + + Requires access level: CompanyManager. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_full/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_full/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_full/user_full.py b/src/cinode-py-client/cinode_api_client/api/company_user_full/user_full.py new file mode 100644 index 0000000..b36c41f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_full/user_full.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_full_model import CompanyUserFullModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users-full/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserFullModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Get company user, including financial fields, by id + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Get company user, including financial fields, by id + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Get company user, including financial fields, by id + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel]]: + """Get company user, including financial fields, by id + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserFullModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_permissions/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_permissions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_permissions/update_permissions.py b/src/cinode-py-client/cinode_api_client/api/company_user_permissions/update_permissions.py new file mode 100644 index 0000000..7aced84 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_permissions/update_permissions.py @@ -0,0 +1,210 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_permissions_edit_model import CompanyUserPermissionsEditModel +from ...models.error_model import ErrorModel +from ...models.role_model import RoleModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserPermissionsEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/permissions".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["RoleModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = RoleModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["RoleModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserPermissionsEditModel, +) -> Response[Union[Any, ErrorModel, List["RoleModel"], ValidationModel]]: + """Update Permissions for Company User + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserPermissionsEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['RoleModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserPermissionsEditModel, +) -> Optional[Union[Any, ErrorModel, List["RoleModel"], ValidationModel]]: + """Update Permissions for Company User + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserPermissionsEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['RoleModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserPermissionsEditModel, +) -> Response[Union[Any, ErrorModel, List["RoleModel"], ValidationModel]]: + """Update Permissions for Company User + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserPermissionsEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['RoleModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserPermissionsEditModel, +) -> Optional[Union[Any, ErrorModel, List["RoleModel"], ValidationModel]]: + """Update Permissions for Company User + + Requires access level: CompanyAdmin. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserPermissionsEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['RoleModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile/company_user_profile.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile/company_user_profile.py new file mode 100644 index 0000000..568fc19 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile/company_user_profile.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_full_model import CompanyUserProfileFullModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileFullModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]]: + """Get profile by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]]: + """Get profile by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]]: + """Get profile by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel]]: + """Get profile by company user id + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileFullModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile/new_company_user_profile.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile/new_company_user_profile.py new file mode 100644 index 0000000..6636a4e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile/new_company_user_profile.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_add_edit_model import CompanyUserProfileAddEditModel +from ...models.company_user_profile_base_model import CompanyUserProfileBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileBaseModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileAddEditModel, +) -> Response[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]]: + """Create Profile for user + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]]: + """Create Profile for user + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileAddEditModel, +) -> Response[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]]: + """Create Profile for user + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel]]: + """Create Profile for user + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileBaseModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/company_user_profile_commitment.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/company_user_profile_commitment.py new file mode 100644 index 0000000..c11a414 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/company_user_profile_commitment.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_commitment_model import CompanyUserProfileCommitmentModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/commitments/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileCommitmentModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Get profile commitment by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Get profile commitment by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Get profile commitment by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Get profile commitment by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/delete_company_user_profile_commitment.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/delete_company_user_profile_commitment.py new file mode 100644 index 0000000..0b7fd50 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/delete_company_user_profile_commitment.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/commitments/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/new_company_user_profile_commitment.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/new_company_user_profile_commitment.py new file mode 100644 index 0000000..a1b0907 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/new_company_user_profile_commitment.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_commitment_add_edit_model import CompanyUserProfileCommitmentAddEditModel +from ...models.company_user_profile_commitment_model import CompanyUserProfileCommitmentModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/commitments".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileCommitmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Create Profile Commitment + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Create Profile Commitment + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Create Profile Commitment + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Create Profile Commitment + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/update_company_user_profile_commitment.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/update_company_user_profile_commitment.py new file mode 100644 index 0000000..8e0e115 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_commitment/update_company_user_profile_commitment.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_commitment_add_edit_model import CompanyUserProfileCommitmentAddEditModel +from ...models.company_user_profile_commitment_model import CompanyUserProfileCommitmentModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/commitments/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileCommitmentModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Update Profile Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Update Profile Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Update Profile Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileCommitmentAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel]]: + """Update Profile Commitment + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileCommitmentAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileCommitmentModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/company_user_profile_education.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/company_user_profile_education.py new file mode 100644 index 0000000..3df81fc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/company_user_profile_education.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_education_model import CompanyUserProfileEducationModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/educations/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileEducationModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Get profile education by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Get profile education by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Get profile education by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Get profile education by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/delete_company_user_profile_education.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/delete_company_user_profile_education.py new file mode 100644 index 0000000..8ba2b45 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/delete_company_user_profile_education.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/educations/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/new_company_user_profile_education.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/new_company_user_profile_education.py new file mode 100644 index 0000000..a5f486f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/new_company_user_profile_education.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_education_add_edit_model import CompanyUserProfileEducationAddEditModel +from ...models.company_user_profile_education_model import CompanyUserProfileEducationModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileEducationAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/educations".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileEducationModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Create Profile Education + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Create Profile Education + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Create Profile Education + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Create Profile Education + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/update_company_user_profile_education.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/update_company_user_profile_education.py new file mode 100644 index 0000000..4b261fd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_education/update_company_user_profile_education.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_education_add_edit_model import CompanyUserProfileEducationAddEditModel +from ...models.company_user_profile_education_model import CompanyUserProfileEducationModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileEducationAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/educations/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileEducationModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Update Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Update Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Update Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEducationAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel]]: + """Update Profile Education + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEducationAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEducationModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/company_user_profile_employer.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/company_user_profile_employer.py new file mode 100644 index 0000000..169c912 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/company_user_profile_employer.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_employer_model import CompanyUserProfileEmployerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/employers/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileEmployerModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Get profile employer by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Get profile employer by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Get profile employer by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Get profile employer by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/delete_company_user_profile_employer.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/delete_company_user_profile_employer.py new file mode 100644 index 0000000..7e5c8e4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/delete_company_user_profile_employer.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/employers/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/new_company_user_profile_employer.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/new_company_user_profile_employer.py new file mode 100644 index 0000000..73ec3cd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/new_company_user_profile_employer.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_employer_add_edit_model import CompanyUserProfileEmployerAddEditModel +from ...models.company_user_profile_employer_model import CompanyUserProfileEmployerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/employers".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileEmployerModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Create Employer profile item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Create Employer profile item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Create Employer profile item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Create Employer profile item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/update_company_user_profile_employer.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/update_company_user_profile_employer.py new file mode 100644 index 0000000..242b502 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_employer/update_company_user_profile_employer.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_employer_add_edit_model import CompanyUserProfileEmployerAddEditModel +from ...models.company_user_profile_employer_model import CompanyUserProfileEmployerModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/employers/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileEmployerModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Update Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Update Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Update Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileEmployerAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel]]: + """Update Profile Employer + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileEmployerAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileEmployerModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/company_user_profile_ext_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/company_user_profile_ext_skill.py new file mode 100644 index 0000000..fcd63cc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/company_user_profile_ext_skill.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_ext_skill_model import CompanyUserProfileExtSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/extskills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileExtSkillModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Get profile external skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Get profile external skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Get profile external skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Get profile external skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/delete_company_user_profile_ext_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/delete_company_user_profile_ext_skill.py new file mode 100644 index 0000000..7d0a05a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/delete_company_user_profile_ext_skill.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/extskills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/new_company_user_profile_ext_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/new_company_user_profile_ext_skill.py new file mode 100644 index 0000000..719dadc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/new_company_user_profile_ext_skill.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_ext_skill_add_edit_model import CompanyUserProfileExtSkillAddEditModel +from ...models.company_user_profile_ext_skill_model import CompanyUserProfileExtSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/extskills".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileExtSkillModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Create Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Create Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Create Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Create Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/update_company_user_profile_ext_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/update_company_user_profile_ext_skill.py new file mode 100644 index 0000000..1411fd2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_ext_skill/update_company_user_profile_ext_skill.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_ext_skill_add_edit_model import CompanyUserProfileExtSkillAddEditModel +from ...models.company_user_profile_ext_skill_model import CompanyUserProfileExtSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/extskills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileExtSkillModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Update Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Update Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Update Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileExtSkillAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel]]: + """Update Extra Skill Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileExtSkillAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileExtSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/create_company_user_profile_import.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/create_company_user_profile_import.py new file mode 100644 index 0000000..968c73b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/create_company_user_profile_import.py @@ -0,0 +1,218 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.create_company_user_profile_import_multipart_data import CreateCompanyUserProfileImportMultipartData +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + multipart_data: CreateCompanyUserProfileImportMultipartData, +) -> Dict[str, Any]: + pass + + multipart_multipart_data = multipart_data.to_multipart() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/import".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "files": multipart_multipart_data, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.ACCEPTED: + response_202 = cast(Any, None) + return response_202 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CreateCompanyUserProfileImportMultipartData, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Create new profile import for a user. + + This will start an async operation. + - If the operation is started successfully, the response will be `202 Accepted` and the `Location` + header will contain the URL to get the status of the operation. + - If the operation is not started successfully, the response will be `400 Bad Request` + + Args: + company_id (int): + company_user_id (int): + multipart_data (CreateCompanyUserProfileImportMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + multipart_data=multipart_data, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CreateCompanyUserProfileImportMultipartData, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Create new profile import for a user. + + This will start an async operation. + - If the operation is started successfully, the response will be `202 Accepted` and the `Location` + header will contain the URL to get the status of the operation. + - If the operation is not started successfully, the response will be `400 Bad Request` + + Args: + company_id (int): + company_user_id (int): + multipart_data (CreateCompanyUserProfileImportMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + multipart_data=multipart_data, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CreateCompanyUserProfileImportMultipartData, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Create new profile import for a user. + + This will start an async operation. + - If the operation is started successfully, the response will be `202 Accepted` and the `Location` + header will contain the URL to get the status of the operation. + - If the operation is not started successfully, the response will be `400 Bad Request` + + Args: + company_id (int): + company_user_id (int): + multipart_data (CreateCompanyUserProfileImportMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + multipart_data=multipart_data, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: CreateCompanyUserProfileImportMultipartData, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Create new profile import for a user. + + This will start an async operation. + - If the operation is started successfully, the response will be `202 Accepted` and the `Location` + header will contain the URL to get the status of the operation. + - If the operation is not started successfully, the response will be `400 Bad Request` + + Args: + company_id (int): + company_user_id (int): + multipart_data (CreateCompanyUserProfileImportMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + multipart_data=multipart_data, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/get_company_user_profile_import.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/get_company_user_profile_import.py new file mode 100644 index 0000000..341d521 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_import/get_company_user_profile_import.py @@ -0,0 +1,227 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.import_profile_async_operation import ImportProfileAsyncOperation +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + operation_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/import/{operationId}".format( + companyId=company_id, + companyUserId=company_user_id, + operationId=operation_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]]: + if response.status_code == HTTPStatus.ACCEPTED: + response_202 = cast(Any, None) + return response_202 + if response.status_code == HTTPStatus.OK: + response_200 = ImportProfileAsyncOperation.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + operation_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]]: + """Get current status of the async profile import operation. + + This will return the status of an async operation. + - If the operation is still in progress, the response will be `202 Accepted` + - If the operation is completed successfully, the response will be `200 OK` and the `status` + property will be `Completed` + - If the operation is completed with errors, the response will be `200 OK` and the `status` property + will be `Failed` + + Args: + company_id (int): + company_user_id (int): + operation_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + operation_id=operation_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + operation_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]]: + """Get current status of the async profile import operation. + + This will return the status of an async operation. + - If the operation is still in progress, the response will be `202 Accepted` + - If the operation is completed successfully, the response will be `200 OK` and the `status` + property will be `Completed` + - If the operation is completed with errors, the response will be `200 OK` and the `status` property + will be `Failed` + + Args: + company_id (int): + company_user_id (int): + operation_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + operation_id=operation_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + operation_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]]: + """Get current status of the async profile import operation. + + This will return the status of an async operation. + - If the operation is still in progress, the response will be `202 Accepted` + - If the operation is completed successfully, the response will be `200 OK` and the `status` + property will be `Completed` + - If the operation is completed with errors, the response will be `200 OK` and the `status` property + will be `Failed` + + Args: + company_id (int): + company_user_id (int): + operation_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + operation_id=operation_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + operation_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel]]: + """Get current status of the async profile import operation. + + This will return the status of an async operation. + - If the operation is still in progress, the response will be `202 Accepted` + - If the operation is completed successfully, the response will be `200 OK` and the `status` + property will be `Completed` + - If the operation is completed with errors, the response will be `200 OK` and the `status` property + will be `Failed` + + Args: + company_id (int): + company_user_id (int): + operation_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ImportProfileAsyncOperation, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + operation_id=operation_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/company_user_profile_language.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/company_user_profile_language.py new file mode 100644 index 0000000..8f2197f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/company_user_profile_language.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_language_model import CompanyUserProfileLanguageModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/languages/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileLanguageModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Get profile language by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Get profile language by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Get profile language by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Get profile language by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/delete_company_user_profile_language.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/delete_company_user_profile_language.py new file mode 100644 index 0000000..6424ecc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/delete_company_user_profile_language.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/languages/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/new_company_user_profile_language.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/new_company_user_profile_language.py new file mode 100644 index 0000000..c92d3b1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/new_company_user_profile_language.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_language_add_edit_model import CompanyUserProfileLanguageAddEditModel +from ...models.company_user_profile_language_model import CompanyUserProfileLanguageModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/languages".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileLanguageModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Create Language Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Create Language Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Create Language Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Create Language Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/update_company_user_profile_language.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/update_company_user_profile_language.py new file mode 100644 index 0000000..6f6fb98 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_language/update_company_user_profile_language.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_language_add_edit_model import CompanyUserProfileLanguageAddEditModel +from ...models.company_user_profile_language_model import CompanyUserProfileLanguageModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/languages/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileLanguageModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Update Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Update Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Update Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileLanguageAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel]]: + """Update Language Profile Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileLanguageAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileLanguageModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/profile_languages.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/profile_languages.py new file mode 100644 index 0000000..89f46e0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_languages/profile_languages.py @@ -0,0 +1,145 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.profile_language_model import ProfileLanguageModel +from ...types import Response + + +def _get_kwargs() -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/languages", + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProfileLanguageModel"]]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProfileLanguageModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProfileLanguageModel"]]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProfileLanguageModel"]]]: + """Get Available Profile Languages + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProfileLanguageModel']]] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProfileLanguageModel"]]]: + """Get Available Profile Languages + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProfileLanguageModel']] + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProfileLanguageModel"]]]: + """Get Available Profile Languages + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProfileLanguageModel']]] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProfileLanguageModel"]]]: + """Get Available Profile Languages + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProfileLanguageModel']] + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/company_user_profile_presentation.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/company_user_profile_presentation.py new file mode 100644 index 0000000..bef9bbf --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/company_user_profile_presentation.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_presentation_model import CompanyUserProfilePresentationModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/presentation".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfilePresentationModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Get profile presentation + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Get profile presentation + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Get profile presentation + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Get profile presentation + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/update_company_user_profile_presentation.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/update_company_user_profile_presentation.py new file mode 100644 index 0000000..51d3732 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_presentation/update_company_user_profile_presentation.py @@ -0,0 +1,203 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_presentation_edit_model import CompanyUserProfilePresentationEditModel +from ...models.company_user_profile_presentation_model import CompanyUserProfilePresentationModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfilePresentationEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/presentation".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfilePresentationModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfilePresentationEditModel, +) -> Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Edit Profile Presentation + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfilePresentationEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfilePresentationEditModel, +) -> Optional[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Edit Profile Presentation + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfilePresentationEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfilePresentationEditModel, +) -> Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Edit Profile Presentation + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfilePresentationEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfilePresentationEditModel, +) -> Optional[Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel]]: + """Edit Profile Presentation + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfilePresentationEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfilePresentationModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/company_user_profile_reference.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/company_user_profile_reference.py new file mode 100644 index 0000000..69fa741 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/company_user_profile_reference.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_reference_model import CompanyUserProfileReferenceModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/references/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileReferenceModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Get profile reference by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Get profile reference by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Get profile reference by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Get profile reference by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/delete_company_user_profile_reference.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/delete_company_user_profile_reference.py new file mode 100644 index 0000000..a297f03 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/delete_company_user_profile_reference.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/references/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/new_company_user_profile_reference.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/new_company_user_profile_reference.py new file mode 100644 index 0000000..883c546 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/new_company_user_profile_reference.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_reference_add_edit_model import CompanyUserProfileReferenceAddEditModel +from ...models.company_user_profile_reference_model import CompanyUserProfileReferenceModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/references".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileReferenceModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Create Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Create Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Create Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Create Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/update_company_user_profile_reference.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/update_company_user_profile_reference.py new file mode 100644 index 0000000..40154bc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_reference/update_company_user_profile_reference.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_reference_add_edit_model import CompanyUserProfileReferenceAddEditModel +from ...models.company_user_profile_reference_model import CompanyUserProfileReferenceModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/references/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileReferenceModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Update Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Update Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Update Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileReferenceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel]]: + """Update Profile Reference Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileReferenceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileReferenceModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/company_user_profile_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/company_user_profile_skill.py new file mode 100644 index 0000000..7692409 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/company_user_profile_skill.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_skill_model import CompanyUserProfileSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/skills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileSkillModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Get profile skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Get profile skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Get profile skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Get profile skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/delete_company_user_profile_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/delete_company_user_profile_skill.py new file mode 100644 index 0000000..e325e64 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/delete_company_user_profile_skill.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/skills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/new_company_user_profile_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/new_company_user_profile_skill.py new file mode 100644 index 0000000..df8f7a5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/new_company_user_profile_skill.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_skill_add_model import CompanyUserProfileSkillAddModel +from ...models.company_user_profile_skill_model import CompanyUserProfileSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileSkillAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/skills".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileSkillModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillAddModel, +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Add Skill to profile + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillAddModel, +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Add Skill to profile + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillAddModel, +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Add Skill to profile + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillAddModel, +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Add Skill to profile + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/update_company_user_profile_skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/update_company_user_profile_skill.py new file mode 100644 index 0000000..55764cd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_skill/update_company_user_profile_skill.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_skill_edit_model import CompanyUserProfileSkillEditModel +from ...models.company_user_profile_skill_model import CompanyUserProfileSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileSkillEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/skills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileSkillModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillEditModel, +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Update Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillEditModel, +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Update Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillEditModel, +) -> Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Update Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileSkillEditModel, +) -> Optional[Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel]]: + """Update Profile Skill + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/company_user_profile_training.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/company_user_profile_training.py new file mode 100644 index 0000000..8fc946e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/company_user_profile_training.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_training_model import CompanyUserProfileTrainingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/trainings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileTrainingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Get profile training by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Get profile training by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Get profile training by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Get profile training by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/delete_company_user_profile_training.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/delete_company_user_profile_training.py new file mode 100644 index 0000000..819547c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/delete_company_user_profile_training.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/trainings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/new_company_user_profile_training.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/new_company_user_profile_training.py new file mode 100644 index 0000000..f577365 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/new_company_user_profile_training.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_training_add_edit_model import CompanyUserProfileTrainingAddEditModel +from ...models.company_user_profile_training_model import CompanyUserProfileTrainingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/trainings".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileTrainingModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Create Profile Training Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Create Profile Training Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Create Profile Training Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Create Profile Training Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/update_company_user_profile_training.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/update_company_user_profile_training.py new file mode 100644 index 0000000..4645b5a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_training/update_company_user_profile_training.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_training_add_edit_model import CompanyUserProfileTrainingAddEditModel +from ...models.company_user_profile_training_model import CompanyUserProfileTrainingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/trainings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileTrainingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Update Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Update Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Update Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileTrainingAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel]]: + """Update Profile Training Item + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileTrainingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileTrainingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/company_user_profile_work_experience.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/company_user_profile_work_experience.py new file mode 100644 index 0000000..7ee46a9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/company_user_profile_work_experience.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_work_experience_model import CompanyUserProfileWorkExperienceModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/workexperiences/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileWorkExperienceModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Get profile work experience by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Get profile work experience by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Get profile work experience by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Get profile work experience by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/delete_company_user_profile_work_experience.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/delete_company_user_profile_work_experience.py new file mode 100644 index 0000000..92b79f2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/delete_company_user_profile_work_experience.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/workexperiences/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Work Experience Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Work Experience Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Work Experience Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete Profile Work Experience Item + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/new_company_user_profile_work_experience.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/new_company_user_profile_work_experience.py new file mode 100644 index 0000000..5218913 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/new_company_user_profile_work_experience.py @@ -0,0 +1,206 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_work_experience_add_edit_model import CompanyUserProfileWorkExperienceAddEditModel +from ...models.company_user_profile_work_experience_model import CompanyUserProfileWorkExperienceModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/workexperiences".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserProfileWorkExperienceModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Create WorkExperience Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Create WorkExperience Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Create WorkExperience Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Create WorkExperience Profile Item + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/update_company_user_profile_work_experience.py b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/update_company_user_profile_work_experience.py new file mode 100644 index 0000000..691fdcb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profile_work_experience/update_company_user_profile_work_experience.py @@ -0,0 +1,217 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_work_experience_add_edit_model import CompanyUserProfileWorkExperienceAddEditModel +from ...models.company_user_profile_work_experience_model import CompanyUserProfileWorkExperienceModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, + *, + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profile/workexperiences/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProfileWorkExperienceModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Update Profile Work Experience + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Update Profile Work Experience + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Update Profile Work Experience + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserProfileWorkExperienceAddEditModel, +) -> Optional[Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel]]: + """Update Profile Work Experience + + Args: + company_id (int): + company_user_id (int): + id (int): + json_body (CompanyUserProfileWorkExperienceAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProfileWorkExperienceModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profiles/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_profiles/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_profiles/company_user_profiles.py b/src/cinode-py-client/cinode_api_client/api/company_user_profiles/company_user_profiles.py new file mode 100644 index 0000000..659d3cc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_profiles/company_user_profiles.py @@ -0,0 +1,187 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_profile_base_model import CompanyUserProfileBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/profiles".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserProfileBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserProfileBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserProfileBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserProfileBaseModel"], ValidationModel]]: + """Get profiles list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserProfileBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserProfileBaseModel"], ValidationModel]]: + """Get profiles list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserProfileBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserProfileBaseModel"], ValidationModel]]: + """Get profiles list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserProfileBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserProfileBaseModel"], ValidationModel]]: + """Get profiles list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserProfileBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_resume/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_resume/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_resume/get_resume.py b/src/cinode-py-client/cinode_api_client/api/company_user_resume/get_resume.py new file mode 100644 index 0000000..b048f12 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_resume/get_resume.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.classic_company_user_resume_model import ClassicCompanyUserResumeModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/resumes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ClassicCompanyUserResumeModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ClassicCompanyUserResumeModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_resumes/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_resumes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_resumes/company_user_resumes.py b/src/cinode-py-client/cinode_api_client/api/company_user_resumes/company_user_resumes.py new file mode 100644 index 0000000..fd077e9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_resumes/company_user_resumes.py @@ -0,0 +1,195 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_resume_base_model import CompanyUserResumeBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/resumes".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserResumeBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get company user resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get company user resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get company user resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserResumeBaseModel"], ValidationModel]]: + """Get company user resumes list + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserResumeBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_roles/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_roles/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_roles/company_user_roles.py b/src/cinode-py-client/cinode_api_client/api/company_user_roles/company_user_roles.py new file mode 100644 index 0000000..7b878c4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_roles/company_user_roles.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_project_assignment_model import CompanyUserProjectAssignmentModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{id}/roles".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserProjectAssignmentModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]]: + """Get Roles for CompanyUser by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]]: + """Get Roles for CompanyUser by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]]: + """Get Roles for CompanyUser by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel]]: + """Get Roles for CompanyUser by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserProjectAssignmentModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_skill/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_skill/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_skill/skill.py b/src/cinode-py-client/cinode_api_client/api/company_user_skill/skill.py new file mode 100644 index 0000000..56f8c56 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_skill/skill.py @@ -0,0 +1,196 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_skill_model import CompanyUserSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/skills/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserSkillModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]]: + """Get skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]]: + """Get skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]]: + """Get skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel]]: + """Get skill by id + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSkillModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_skills/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_skills/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_skills/skills.py b/src/cinode-py-client/cinode_api_client/api/company_user_skills/skills.py new file mode 100644 index 0000000..c6f0222 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_skills/skills.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_skill_model import CompanyUserSkillModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/skills".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserSkillModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserSkillModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserSkillModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserSkillModel"], ValidationModel]]: + """Get skills list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserSkillModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserSkillModel"], ValidationModel]]: + """Get skills list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserSkillModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserSkillModel"], ValidationModel]]: + """Get skills list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserSkillModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserSkillModel"], ValidationModel]]: + """Get skills list + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserSkillModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/add_company_user_subcontractor.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/add_company_user_subcontractor.py new file mode 100644 index 0000000..2ffeb8f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/add_company_user_subcontractor.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_subcontractor_add_edit_model import CompanyUserSubcontractorAddEditModel +from ...models.company_user_subcontractor_model import CompanyUserSubcontractorModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: CompanyUserSubcontractorAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/subcontractors".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserSubcontractorModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserSubcontractorAddEditModel, +) -> Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Add subcontractor + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (CompanyUserSubcontractorAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserSubcontractorAddEditModel, +) -> Optional[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Add subcontractor + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (CompanyUserSubcontractorAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserSubcontractorAddEditModel, +) -> Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Add subcontractor + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (CompanyUserSubcontractorAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserSubcontractorAddEditModel, +) -> Optional[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Add subcontractor + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (CompanyUserSubcontractorAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/company_subcontractor.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/company_subcontractor.py new file mode 100644 index 0000000..bde1016 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/company_subcontractor.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_subcontractor_model import CompanyUserSubcontractorModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserSubcontractorModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel]]: + """Get company user by id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/delete_company_subcontractor.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/delete_company_subcontractor.py new file mode 100644 index 0000000..922ff75 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor/delete_company_subcontractor.py @@ -0,0 +1,224 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + company_id: int, + id: int, + *, + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Dict[str, Any]: + pass + + params: Dict[str, Any] = {} + params["firstName"] = first_name + + params["lastName"] = last_name + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/subcontractors/{id}".format( + companyId=company_id, + id=id, + ), + "params": params, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor from the system + This action is irreversible, use with caution + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + first_name=first_name, + last_name=last_name, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor from the system + This action is irreversible, use with caution + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + first_name=first_name, + last_name=last_name, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor from the system + This action is irreversible, use with caution + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + first_name=first_name, + last_name=last_name, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + first_name: Union[Unset, None, str] = UNSET, + last_name: Union[Unset, None, str] = UNSET, +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete subcontractor from the system + This action is irreversible, use with caution + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + first_name=first_name, + last_name=last_name, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/company_user_subcontractor_event.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/company_user_subcontractor_event.py new file mode 100644 index 0000000..b426bfd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event/company_user_subcontractor_event.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_model import CompanyUserEventModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/company_user_subcontractor_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/company_user_subcontractor_event_meeting.py new file mode 100644 index 0000000..14aa895 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/company_user_subcontractor_event_meeting.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_meeting_model import CompanyUserEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/meetings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Get subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/delete_company_user_subcontractor_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/delete_company_user_subcontractor_event_meeting.py new file mode 100644 index 0000000..7c1f486 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/delete_company_user_subcontractor_event_meeting.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/meetings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/new_company_user_subcontractor_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/new_company_user_subcontractor_event_meeting.py new file mode 100644 index 0000000..edcfe39 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/new_company_user_subcontractor_event_meeting.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_meeting_add_edit_model import CompanyUserEventMeetingAddEditModel +from ...models.company_user_event_meeting_model import CompanyUserEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/meetings".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserEventMeetingModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/update_company_user_subcontractor_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/update_company_user_subcontractor_event_meeting.py new file mode 100644 index 0000000..4a7b90b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_meeting/update_company_user_subcontractor_event_meeting.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_meeting_add_edit_model import CompanyUserEventMeetingAddEditModel +from ...models.company_user_event_meeting_model import CompanyUserEventMeetingModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, + *, + json_body: CompanyUserEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/meetings/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventMeetingAddEditModel, +) -> Optional[Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel]]: + """Updates subcontractor meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventMeetingModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/company_user_subcontractor_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/company_user_subcontractor_event_note.py new file mode 100644 index 0000000..f475d47 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/company_user_subcontractor_event_note.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_note_model import CompanyUserEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/notes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/delete_company_user_subcontractor_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/delete_company_user_subcontractor_event_note.py new file mode 100644 index 0000000..5d7dada --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/delete_company_user_subcontractor_event_note.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/notes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/new_company_user_subcontractor_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/new_company_user_subcontractor_event_note.py new file mode 100644 index 0000000..8eb2708 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/new_company_user_subcontractor_event_note.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_note_add_edit_model import CompanyUserEventNoteAddEditModel +from ...models.company_user_event_note_model import CompanyUserEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/notes".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserEventNoteModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new subcontractors note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new subcontractors note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new subcontractors note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Creates new subcontractors note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/update_company_user_subcontractor_event_note.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/update_company_user_subcontractor_event_note.py new file mode 100644 index 0000000..8b68317 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_note/update_company_user_subcontractor_event_note.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_note_add_edit_model import CompanyUserEventNoteAddEditModel +from ...models.company_user_event_note_model import CompanyUserEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, + *, + json_body: CompanyUserEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/notes/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates subcontractor note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates subcontractor note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates subcontractor note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventNoteAddEditModel, +) -> Optional[Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel]]: + """Updates subcontractor note event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/company_user_subcontractor_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/company_user_subcontractor_event_task.py new file mode 100644 index 0000000..55b43e5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/company_user_subcontractor_event_task.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_task_model import CompanyUserEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/tasks/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/delete_company_user_subcontractor_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/delete_company_user_subcontractor_event_task.py new file mode 100644 index 0000000..ad11f7f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/delete_company_user_subcontractor_event_task.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/tasks/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Deletes meeting event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/new_company_user_subcontractor_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/new_company_user_subcontractor_event_task.py new file mode 100644 index 0000000..a5d1544 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/new_company_user_subcontractor_event_task.py @@ -0,0 +1,208 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_task_add_edit_model import CompanyUserEventTaskAddEditModel +from ...models.company_user_event_task_model import CompanyUserEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: CompanyUserEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/tasks".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserEventTaskModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Creates new subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/update_company_user_subcontractor_event_task.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/update_company_user_subcontractor_event_task.py new file mode 100644 index 0000000..2c2a75d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_event_task/update_company_user_subcontractor_event_task.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_task_add_edit_model import CompanyUserEventTaskAddEditModel +from ...models.company_user_event_task_model import CompanyUserEventTaskModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: str, + *, + json_body: CompanyUserEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/tasks/{id}".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: CompanyUserEventTaskAddEditModel, +) -> Optional[Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel]]: + """Updates subcontractor task event + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + id (str): + json_body (CompanyUserEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserEventTaskModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/company_user_subcontractor_events.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/company_user_subcontractor_events.py new file mode 100644 index 0000000..dd57370 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events/company_user_subcontractor_events.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + subcontractor_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{subcontractorId}/events".format( + companyId=company_id, + subcontractorId=subcontractor_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_id=subcontractor_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + subcontractor_id=subcontractor_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_id=subcontractor_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + subcontractor_id=subcontractor_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/company_user_subcontractor_event_meeting_list.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/company_user_subcontractor_event_meeting_list.py new file mode 100644 index 0000000..a9c48ef --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_meetings/company_user_subcontractor_event_meeting_list.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/meetings".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors meetings events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors meetings events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors meetings events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors meetings events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/company_user_subcontractor_events_notes.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/company_user_subcontractor_events_notes.py new file mode 100644 index 0000000..e57cf5b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_notes/company_user_subcontractor_events_notes.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/notes".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors notes events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/company_user_subcontractor_events_tasks.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/company_user_subcontractor_events_tasks.py new file mode 100644 index 0000000..8b20f64 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_events_tasks/company_user_subcontractor_events_tasks.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_event_base_model import CompanyUserEventBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{companyUserId}/events/tasks".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserEventBaseModel"], ValidationModel]]: + """Get subcontractors tasks events list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/get_subcontractor_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/get_subcontractor_attachment.py new file mode 100644 index 0000000..6691d22 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachment/get_subcontractor_attachment.py @@ -0,0 +1,200 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + attachment_id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{id}/attachments/{attachmentId}".format( + companyId=company_id, + id=id, + attachmentId=attachment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, str]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(str, response.json()) + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get subcontractor File Attachment by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get subcontractor File Attachment by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return sync_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, str]]: + """Get subcontractor File Attachment by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + attachment_id=attachment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + attachment_id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, str]]: + """Get subcontractor File Attachment by Id + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + attachment_id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, str] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + attachment_id=attachment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/subcontractor_attachment.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/subcontractor_attachment.py new file mode 100644 index 0000000..caf7c0e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_file_attachments/subcontractor_attachment.py @@ -0,0 +1,207 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_subcontractor_file_attachment_list_model import ( + CompanyUserSubcontractorFileAttachmentListModel, +) +from ...models.error_model import ErrorModel +from ...models.subcontractor_attachment_multipart_data import SubcontractorAttachmentMultipartData +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + multipart_data: SubcontractorAttachmentMultipartData, +) -> Dict[str, Any]: + pass + + multipart_multipart_data = multipart_data.to_multipart() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/subcontractors/{id}/attachments".format( + companyId=company_id, + id=id, + ), + "files": multipart_multipart_data, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = CompanyUserSubcontractorFileAttachmentListModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: SubcontractorAttachmentMultipartData, +) -> Response[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload subcontractor file attachment + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + multipart_data (SubcontractorAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + multipart_data=multipart_data, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: SubcontractorAttachmentMultipartData, +) -> Optional[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload subcontractor file attachment + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + multipart_data (SubcontractorAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + multipart_data=multipart_data, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: SubcontractorAttachmentMultipartData, +) -> Response[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload subcontractor file attachment + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + multipart_data (SubcontractorAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + multipart_data=multipart_data, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + multipart_data: SubcontractorAttachmentMultipartData, +) -> Optional[Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel]]: + """Upload subcontractor file attachment + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + id (int): + multipart_data (SubcontractorAttachmentMultipartData): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorFileAttachmentListModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + multipart_data=multipart_data, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_role.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_role.py new file mode 100644 index 0000000..3455669 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_role.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_subcontractor_role_member_model import CompanyUserSubcontractorRoleMemberModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + subcontractor_id: int, + project_assignment_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{subcontractorId}/roles/{projectAssignmentId}".format( + companyId=company_id, + subcontractorId=subcontractor_id, + projectAssignmentId=project_assignment_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserSubcontractorRoleMemberModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + subcontractor_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]]: + """Get a specific role, assigned and or prospected, for subcontractor by role id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + project_assignment_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_id=subcontractor_id, + project_assignment_id=project_assignment_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + subcontractor_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]]: + """Get a specific role, assigned and or prospected, for subcontractor by role id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + project_assignment_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + subcontractor_id=subcontractor_id, + project_assignment_id=project_assignment_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + subcontractor_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]]: + """Get a specific role, assigned and or prospected, for subcontractor by role id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + project_assignment_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_id=subcontractor_id, + project_assignment_id=project_assignment_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + subcontractor_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel]]: + """Get a specific role, assigned and or prospected, for subcontractor by role id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + project_assignment_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorRoleMemberModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + subcontractor_id=subcontractor_id, + project_assignment_id=project_assignment_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_roles.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_roles.py new file mode 100644 index 0000000..b476eb2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractor_roles/get_subcontractor_roles.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_subcontractor_roles_model import CompanyUserSubcontractorRolesModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + subcontractor_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors/{subcontractorId}/roles".format( + companyId=company_id, + subcontractorId=subcontractor_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserSubcontractorRolesModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]]: + """Get assigned and prospect roles for subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_id=subcontractor_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]]: + """Get assigned and prospect roles for subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + subcontractor_id=subcontractor_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]]: + """Get assigned and prospect roles for subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + subcontractor_id=subcontractor_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + subcontractor_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel]]: + """Get assigned and prospect roles for subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + subcontractor_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserSubcontractorRolesModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + subcontractor_id=subcontractor_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/company_user_subcontractors.py b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/company_user_subcontractors.py new file mode 100644 index 0000000..7478c34 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_subcontractors/company_user_subcontractors.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_subcontractor_base_model import CompanyUserSubcontractorBaseModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/subcontractors".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserSubcontractorBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserSubcontractorBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserSubcontractorBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserSubcontractorBaseModel"], ValidationModel]]: + """Get subcontractors list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserSubcontractorBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserSubcontractorBaseModel"], ValidationModel]]: + """Get subcontractors list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserSubcontractorBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserSubcontractorBaseModel"], ValidationModel]]: + """Get subcontractors list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserSubcontractorBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserSubcontractorBaseModel"], ValidationModel]]: + """Get subcontractors list + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserSubcontractorBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_tags/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_tags/edit_company_user_tags.py b/src/cinode-py-client/cinode_api_client/api/company_user_tags/edit_company_user_tags.py new file mode 100644 index 0000000..dd46bc8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_tags/edit_company_user_tags.py @@ -0,0 +1,279 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_tag_model import CompanyTagModel +from ...models.company_user_model import CompanyUserModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + *, + json_body: List["CompanyTagModel"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for json_body_item_data in json_body: + json_body_item = json_body_item_data.to_dict() + + json_json_body.append(json_body_item) + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/tags".format( + companyId=company_id, + companyUserId=company_user_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CompanyUserModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for User + + Note: + + Posted tags will replace any existing tags for the user. + A new tag will be created if the id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/users/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-new\", + }, + ] + + Args: + company_id (int): + company_user_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for User + + Note: + + Posted tags will replace any existing tags for the user. + A new tag will be created if the id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/users/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-new\", + }, + ] + + Args: + company_id (int): + company_user_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for User + + Note: + + Posted tags will replace any existing tags for the user. + A new tag will be created if the id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/users/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-new\", + }, + ] + + Args: + company_id (int): + company_user_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, CompanyUserModel, ErrorModel, ValidationModel]]: + r"""Edit Tags for User + + Note: + + Posted tags will replace any existing tags for the user. + A new tag will be created if the id for a tag is not provided. + + Sample request: + + POST /v0.1/companies/1/users/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-new\", + }, + ] + + Args: + company_id (int): + company_user_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CompanyUserModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_teams/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_user_teams/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_user_teams/user_teams.py b/src/cinode-py-client/cinode_api_client/api/company_user_teams/user_teams.py new file mode 100644 index 0000000..58595a3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_user_teams/user_teams.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.team_base_model import TeamBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/teams".format( + companyId=company_id, + companyUserId=company_user_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = TeamBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams for team member + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams for team member + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams for team member + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["TeamBaseModel"], ValidationModel]]: + """Get teams for team member + + Args: + company_id (int): + company_user_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['TeamBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_users/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_users/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_users/company_users.py b/src/cinode-py-client/cinode_api_client/api/company_users/company_users.py new file mode 100644 index 0000000..ac5b699 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_users/company_users.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_extended_model import CompanyUserExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_users_extended/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_users_extended/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_users_extended/company_users_extended.py b/src/cinode-py-client/cinode_api_client/api/company_users_extended/company_users_extended.py new file mode 100644 index 0000000..a162f2a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_users_extended/company_users_extended.py @@ -0,0 +1,170 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_user_extended_model import CompanyUserExtendedModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/extended".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = CompanyUserExtendedModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get extended company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get extended company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get extended company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["CompanyUserExtendedModel"], ValidationModel]]: + """Get extended company users list + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['CompanyUserExtendedModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_webhook/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_webhook/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_webhook/install_webhook_manifest.py b/src/cinode-py-client/cinode_api_client/api/company_webhook/install_webhook_manifest.py new file mode 100644 index 0000000..8c974a1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_webhook/install_webhook_manifest.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...models.webhook_add_model import WebhookAddModel +from ...models.webhook_model import WebhookModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: List["WebhookAddModel"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for json_body_item_data in json_body: + json_body_item = json_body_item_data.to_dict() + + json_json_body.append(json_body_item) + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/webhooks/manifest".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = [] + _response_201 = response.json() + for response_201_item_data in _response_201: + response_201_item = WebhookModel.from_dict(response_201_item_data) + + response_201.append(response_201_item) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["WebhookAddModel"], +) -> Response[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Requires access level: CompanyAdmin. Requires module: Webhooks. + + Args: + company_id (int): + json_body (List['WebhookAddModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['WebhookModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["WebhookAddModel"], +) -> Optional[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Requires access level: CompanyAdmin. Requires module: Webhooks. + + Args: + company_id (int): + json_body (List['WebhookAddModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['WebhookModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["WebhookAddModel"], +) -> Response[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Requires access level: CompanyAdmin. Requires module: Webhooks. + + Args: + company_id (int): + json_body (List['WebhookAddModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['WebhookModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["WebhookAddModel"], +) -> Optional[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Requires access level: CompanyAdmin. Requires module: Webhooks. + + Args: + company_id (int): + json_body (List['WebhookAddModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['WebhookModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_webhook/new_webhook.py b/src/cinode-py-client/cinode_api_client/api/company_webhook/new_webhook.py new file mode 100644 index 0000000..09240cc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_webhook/new_webhook.py @@ -0,0 +1,273 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...models.webhook_add_model import WebhookAddModel +from ...models.webhook_model import WebhookModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: WebhookAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/webhooks".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel, WebhookModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = WebhookModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel, WebhookModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: WebhookAddModel, +) -> Response[Union[Any, ErrorModel, ValidationModel, WebhookModel]]: + r"""Add Webhook + + Sample request: + + POST /v0.1/companies/1/webhooks + { + \"isActive\": false, + \"endpointUrl\": \"https://webhook.site/7a619ffb-e67c-41fc-8113-083d6013f76c\", + \"configurations\": [ + { + \"entityType\": 1, + \"actionType\": 1 + } + ], + \"credentials\": [ + { + \"isBasicAuthentication\": true, + \"headerName\": \"user\", + \"headerValue\": \"somevalue\" + } + ] + } + + Args: + company_id (int): + json_body (WebhookAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel, WebhookModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: WebhookAddModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel, WebhookModel]]: + r"""Add Webhook + + Sample request: + + POST /v0.1/companies/1/webhooks + { + \"isActive\": false, + \"endpointUrl\": \"https://webhook.site/7a619ffb-e67c-41fc-8113-083d6013f76c\", + \"configurations\": [ + { + \"entityType\": 1, + \"actionType\": 1 + } + ], + \"credentials\": [ + { + \"isBasicAuthentication\": true, + \"headerName\": \"user\", + \"headerValue\": \"somevalue\" + } + ] + } + + Args: + company_id (int): + json_body (WebhookAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel, WebhookModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: WebhookAddModel, +) -> Response[Union[Any, ErrorModel, ValidationModel, WebhookModel]]: + r"""Add Webhook + + Sample request: + + POST /v0.1/companies/1/webhooks + { + \"isActive\": false, + \"endpointUrl\": \"https://webhook.site/7a619ffb-e67c-41fc-8113-083d6013f76c\", + \"configurations\": [ + { + \"entityType\": 1, + \"actionType\": 1 + } + ], + \"credentials\": [ + { + \"isBasicAuthentication\": true, + \"headerName\": \"user\", + \"headerValue\": \"somevalue\" + } + ] + } + + Args: + company_id (int): + json_body (WebhookAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel, WebhookModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: WebhookAddModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel, WebhookModel]]: + r"""Add Webhook + + Sample request: + + POST /v0.1/companies/1/webhooks + { + \"isActive\": false, + \"endpointUrl\": \"https://webhook.site/7a619ffb-e67c-41fc-8113-083d6013f76c\", + \"configurations\": [ + { + \"entityType\": 1, + \"actionType\": 1 + } + ], + \"credentials\": [ + { + \"isBasicAuthentication\": true, + \"headerName\": \"user\", + \"headerValue\": \"somevalue\" + } + ] + } + + Args: + company_id (int): + json_body (WebhookAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel, WebhookModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_webhook/remove_webhook.py b/src/cinode-py-client/cinode_api_client/api/company_webhook/remove_webhook.py new file mode 100644 index 0000000..14daf4b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_webhook/remove_webhook.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/webhooks/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove webhook + + Sample request: + + DELETE /v0.1/companies/1/webhooks/42a3a220-766c-eb11-8e13-000c29b4e92f + + Args: + company_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove webhook + + Sample request: + + DELETE /v0.1/companies/1/webhooks/42a3a220-766c-eb11-8e13-000c29b4e92f + + Args: + company_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Remove webhook + + Sample request: + + DELETE /v0.1/companies/1/webhooks/42a3a220-766c-eb11-8e13-000c29b4e92f + + Args: + company_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Remove webhook + + Sample request: + + DELETE /v0.1/companies/1/webhooks/42a3a220-766c-eb11-8e13-000c29b4e92f + + Args: + company_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/company_webhooks/__init__.py b/src/cinode-py-client/cinode_api_client/api/company_webhooks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/company_webhooks/company_webhooks.py b/src/cinode-py-client/cinode_api_client/api/company_webhooks/company_webhooks.py new file mode 100644 index 0000000..2735690 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/company_webhooks/company_webhooks.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...models.webhook_model import WebhookModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/webhooks".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = WebhookModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Get company webhooks + + Sample request: + + GET /v0.1/companies/1/webhooks + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['WebhookModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Get company webhooks + + Sample request: + + GET /v0.1/companies/1/webhooks + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['WebhookModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Get company webhooks + + Sample request: + + GET /v0.1/companies/1/webhooks + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['WebhookModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["WebhookModel"], ValidationModel]]: + """Get company webhooks + + Sample request: + + GET /v0.1/companies/1/webhooks + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['WebhookModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/__init__.py b/src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/dynamic_resume.py b/src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/dynamic_resume.py new file mode 100644 index 0000000..3582c1b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/dynamic_company_user_resume/dynamic_resume.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.dynamic_company_user_resume_model import DynamicCompanyUserResumeModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + company_user_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/users/{companyUserId}/resumes/{id}/dynamic".format( + companyId=company_id, + companyUserId=company_user_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = DynamicCompanyUserResumeModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + company_user_id=company_user_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + company_user_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel]]: + """Get resume by id + + Requires module: CompanyUserResume. + + Args: + company_id (int): + company_user_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, DynamicCompanyUserResumeModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + company_user_id=company_user_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/keyword_search/__init__.py b/src/cinode-py-client/cinode_api_client/api/keyword_search/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/keyword_search/search_keyword.py b/src/cinode-py-client/cinode_api_client/api/keyword_search/search_keyword.py new file mode 100644 index 0000000..27be33b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/keyword_search/search_keyword.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.keyword_model import KeywordModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + term: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/keywords/search/{term}".format( + companyId=company_id, + term=term, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["KeywordModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = KeywordModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["KeywordModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + term: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["KeywordModel"], ValidationModel]]: + """Search keywords by term + + Args: + company_id (int): + term (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['KeywordModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + term=term, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + term: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["KeywordModel"], ValidationModel]]: + """Search keywords by term + + Args: + company_id (int): + term (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['KeywordModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + term=term, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + term: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["KeywordModel"], ValidationModel]]: + """Search keywords by term + + Args: + company_id (int): + term (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['KeywordModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + term=term, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + term: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["KeywordModel"], ValidationModel]]: + """Search keywords by term + + Args: + company_id (int): + term (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['KeywordModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + term=term, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/mentions/__init__.py b/src/cinode-py-client/cinode_api_client/api/mentions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/mentions/translate_mentions.py b/src/cinode-py-client/cinode_api_client/api/mentions/translate_mentions.py new file mode 100644 index 0000000..90371ae --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/mentions/translate_mentions.py @@ -0,0 +1,189 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.mention_text_model import MentionTextModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: MentionTextModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/mentions/to-natural-text".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel, str]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(str, response.json()) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel, str]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: MentionTextModel, +) -> Response[Union[Any, ErrorModel, ValidationModel, str]]: + """Translates any mention-ids in a text to their human readable form. + Translations are access restricted, if you don't have enough access + to get the name of an id, it won't be translated. + + Args: + company_id (int): + json_body (MentionTextModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: MentionTextModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel, str]]: + """Translates any mention-ids in a text to their human readable form. + Translations are access restricted, if you don't have enough access + to get the name of an id, it won't be translated. + + Args: + company_id (int): + json_body (MentionTextModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel, str] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: MentionTextModel, +) -> Response[Union[Any, ErrorModel, ValidationModel, str]]: + """Translates any mention-ids in a text to their human readable form. + Translations are access restricted, if you don't have enough access + to get the name of an id, it won't be translated. + + Args: + company_id (int): + json_body (MentionTextModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel, str]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: MentionTextModel, +) -> Optional[Union[Any, ErrorModel, ValidationModel, str]]: + """Translates any mention-ids in a text to their human readable form. + Translations are access restricted, if you don't have enough access + to get the name of an id, it won't be translated. + + Args: + company_id (int): + json_body (MentionTextModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel, str] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/partners/__init__.py b/src/cinode-py-client/cinode_api_client/api/partners/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/partners/search_partners.py b/src/cinode-py-client/cinode_api_client/api/partners/search_partners.py new file mode 100644 index 0000000..320a21b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/partners/search_partners.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.partners_filter_model import PartnersFilterModel +from ...models.partners_overview_model import PartnersOverviewModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: PartnersFilterModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/partners".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, PartnersOverviewModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = PartnersOverviewModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = cast(Any, None) + return response_400 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, PartnersOverviewModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: PartnersFilterModel, +) -> Response[Union[Any, ErrorModel, PartnersOverviewModel]]: + """Get Partners by filter + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (PartnersFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, PartnersOverviewModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: PartnersFilterModel, +) -> Optional[Union[Any, ErrorModel, PartnersOverviewModel]]: + """Get Partners by filter + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (PartnersFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, PartnersOverviewModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: PartnersFilterModel, +) -> Response[Union[Any, ErrorModel, PartnersOverviewModel]]: + """Get Partners by filter + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (PartnersFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, PartnersOverviewModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: PartnersFilterModel, +) -> Optional[Union[Any, ErrorModel, PartnersOverviewModel]]: + """Get Partners by filter + + Requires access level: PartnerManager. Requires module: Partners. + + Args: + company_id (int): + json_body (PartnersFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, PartnersOverviewModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project/__init__.py b/src/cinode-py-client/cinode_api_client/api/project/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project/delete_company_project.py b/src/cinode-py-client/cinode_api_client/api/project/delete_company_project.py new file mode 100644 index 0000000..61b17f7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project/delete_company_project.py @@ -0,0 +1,185 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project/new_company_project.py b/src/cinode-py-client/cinode_api_client/api/project/new_company_project.py new file mode 100644 index 0000000..08b5ea3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project/new_company_project.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_add_edit_model import ProjectAddEditModel +from ...models.project_model import ProjectModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: ProjectAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Add project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Add project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Add project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Add project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project/project.py b/src/cinode-py-client/cinode_api_client/api/project/project.py new file mode 100644 index 0000000..b221ebd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project/project.py @@ -0,0 +1,190 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_model import ProjectModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{id}".format( + companyId=company_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Get project by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Get project by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Get project by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Get project by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project/update_company_project.py b/src/cinode-py-client/cinode_api_client/api/project/update_company_project.py new file mode 100644 index 0000000..e9a3c08 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project/update_company_project.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_add_edit_model import ProjectAddEditModel +from ...models.project_model import ProjectModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + id: int, + *, + json_body: ProjectAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{id}".format( + companyId=company_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Update project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Update project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Update project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + """Update project + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + id (int): + json_body (ProjectAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/announce_project_assignment.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/announce_project_assignment.py new file mode 100644 index 0000000..8bda1a4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment/announce_project_assignment.py @@ -0,0 +1,238 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_announce_model import ProjectAssignmentAnnounceModel +from ...models.project_assignment_announcement_base_model import ProjectAssignmentAnnouncementBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: str, + project_id: int, + project_assignment_id: int, + *, + json_body: ProjectAssignmentAnnounceModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{projectAssignmentId}/announce".format( + companyId=company_id, + projectId=project_id, + projectAssignmentId=project_assignment_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectAssignmentAnnouncementBaseModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if response.status_code == HTTPStatus.CREATED: + response_201 = cast(Any, None) + return response_201 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: str, + project_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAnnounceModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]]: + r"""Announce a role (ProjectAssignment) to the Partner Network and optionally also to Cinode + Market(https://cinode.market/requests). + If you are testing, set the \"PublishForReal\" to \"false\", otherwise you will publish this + announcement for real. When you're testing (\"PublishForReal = false) RequestId will be 0 in the + response. + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (str): + project_id (int): + project_assignment_id (int): + json_body (ProjectAssignmentAnnounceModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + project_assignment_id=project_assignment_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: str, + project_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAnnounceModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]]: + r"""Announce a role (ProjectAssignment) to the Partner Network and optionally also to Cinode + Market(https://cinode.market/requests). + If you are testing, set the \"PublishForReal\" to \"false\", otherwise you will publish this + announcement for real. When you're testing (\"PublishForReal = false) RequestId will be 0 in the + response. + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (str): + project_id (int): + project_assignment_id (int): + json_body (ProjectAssignmentAnnounceModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + project_assignment_id=project_assignment_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: str, + project_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAnnounceModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]]: + r"""Announce a role (ProjectAssignment) to the Partner Network and optionally also to Cinode + Market(https://cinode.market/requests). + If you are testing, set the \"PublishForReal\" to \"false\", otherwise you will publish this + announcement for real. When you're testing (\"PublishForReal = false) RequestId will be 0 in the + response. + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (str): + project_id (int): + project_assignment_id (int): + json_body (ProjectAssignmentAnnounceModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + project_assignment_id=project_assignment_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: str, + project_id: int, + project_assignment_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAnnounceModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel]]: + r"""Announce a role (ProjectAssignment) to the Partner Network and optionally also to Cinode + Market(https://cinode.market/requests). + If you are testing, set the \"PublishForReal\" to \"false\", otherwise you will publish this + announcement for real. When you're testing (\"PublishForReal = false) RequestId will be 0 in the + response. + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (str): + project_id (int): + project_assignment_id (int): + json_body (ProjectAssignmentAnnounceModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentAnnouncementBaseModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + project_assignment_id=project_assignment_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/delete_project_assignment.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/delete_project_assignment.py new file mode 100644 index 0000000..609eb3b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment/delete_project_assignment.py @@ -0,0 +1,201 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/new_project_assignment.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/new_project_assignment.py new file mode 100644 index 0000000..46ba7e1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment/new_project_assignment.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_add_model import ProjectAssignmentAddModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + *, + json_body: ProjectAssignmentAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles".format( + companyId=company_id, + projectId=project_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectAssignmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectAssignmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectAssignmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectAssignmentAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/old_project_assignment.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/old_project_assignment.py new file mode 100644 index 0000000..a6a4506 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment/old_project_assignment.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/projectassignments/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectAssignmentModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get projectassignment by id (Obsolete) + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get projectassignment by id (Obsolete) + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get projectassignment by id (Obsolete) + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get projectassignment by id (Obsolete) + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/project_assignment.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/project_assignment.py new file mode 100644 index 0000000..877902b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment/project_assignment.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectAssignmentModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get Role by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get Role by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get Role by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Get Role by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment/update_project_assignment.py b/src/cinode-py-client/cinode_api_client/api/project_assignment/update_project_assignment.py new file mode 100644 index 0000000..b3ae8c0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment/update_project_assignment.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_edit_model import ProjectAssignmentEditModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: int, + *, + json_body: ProjectAssignmentEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + json_body (ProjectAssignmentEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + json_body (ProjectAssignmentEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + json_body (ProjectAssignmentEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + json_body (ProjectAssignmentEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_member/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_employee.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_employee.py new file mode 100644 index 0000000..e068e5f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_employee.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_member_employee_add_model import ProjectAssignmentMemberEmployeeAddModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + *, + json_body: ProjectAssignmentMemberEmployeeAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/members/employee".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberEmployeeAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberEmployeeAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberEmployeeAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberEmployeeAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_subcontractor.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_subcontractor.py new file mode 100644 index 0000000..921c26a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/add_project_assignment_member_subcontractor.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_member_subcontractor_add_model import ProjectAssignmentMemberSubcontractorAddModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + *, + json_body: ProjectAssignmentMemberSubcontractorAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/members/subcontractor".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberSubcontractorAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberSubcontractorAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberSubcontractorAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Add Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentMemberSubcontractorAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_member/delete_project_assignment_member_employee.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/delete_project_assignment_member_employee.py new file mode 100644 index 0000000..dc038f7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/delete_project_assignment_member_employee.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/members/{id}".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role Member + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role Member + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role Member + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Delete Role Member + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_employee.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_employee.py new file mode 100644 index 0000000..c0f0f57 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_employee.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_member_employee_edit_model import ProjectAssignmentMemberEmployeeEditModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + json_body: ProjectAssignmentMemberEmployeeEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/members/employee/{id}".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberEmployeeEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberEmployeeEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberEmployeeEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberEmployeeEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Employee + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberEmployeeEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_subcontractor.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_subcontractor.py new file mode 100644 index 0000000..56d92f7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_member/update_project_assignment_member_subcontractor.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_member_subcontractor_edit_model import ProjectAssignmentMemberSubcontractorEditModel +from ...models.project_assignment_model import ProjectAssignmentModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + json_body: ProjectAssignmentMemberSubcontractorEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/members/subcontractor/{id}".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberSubcontractorEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberSubcontractorEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberSubcontractorEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentMemberSubcontractorEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel]]: + """Edit Role Member Subcontractor + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentMemberSubcontractorEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/add_project_assignment_skill.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/add_project_assignment_skill.py new file mode 100644 index 0000000..c1e3057 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/add_project_assignment_skill.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_skill_add_model import ProjectAssignmentSkillAddModel +from ...models.project_assignment_skill_model import ProjectAssignmentSkillModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + *, + json_body: ProjectAssignmentSkillAddModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/skills".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentSkillModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Add Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Add Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillAddModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Add Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillAddModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Add Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + json_body (ProjectAssignmentSkillAddModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/delete_project_assignment_skill.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/delete_project_assignment_skill.py new file mode 100644 index 0000000..8b0b5dc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/delete_project_assignment_skill.py @@ -0,0 +1,215 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_skill_model import ProjectAssignmentSkillModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/skills/{id}".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentSkillModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Delete Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Delete Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Delete Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Delete Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/update_project_assignment_skill.py b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/update_project_assignment_skill.py new file mode 100644 index 0000000..4ae9d1b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignment_skills/update_project_assignment_skill.py @@ -0,0 +1,233 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_skill_edit_model import ProjectAssignmentSkillEditModel +from ...models.project_assignment_skill_model import ProjectAssignmentSkillModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + json_body: ProjectAssignmentSkillEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/roles/{roleId}/skills/{id}".format( + companyId=company_id, + projectId=project_id, + roleId=role_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectAssignmentSkillModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Update Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Update Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillEditModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Update Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + role_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentSkillEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel]]: + """Update Role Skill + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + role_id (int): + id (int): + json_body (ProjectAssignmentSkillEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentSkillModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + role_id=role_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignments/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_assignments/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_assignments/search_roles.py b/src/cinode-py-client/cinode_api_client/api/project_assignments/search_roles.py new file mode 100644 index 0000000..898da6d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_assignments/search_roles.py @@ -0,0 +1,198 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_assignment_filter_model import ProjectAssignmentFilterModel +from ...models.project_assignment_with_status_model import ProjectAssignmentWithStatusModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: ProjectAssignmentFilterModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/roles".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectAssignmentWithStatusModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentFilterModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]]: + """Get Roles by Filter + Rate limited, restricted to once per minute, max 1000 requests per day + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAssignmentFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentFilterModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]]: + """Get Roles by Filter + Rate limited, restricted to once per minute, max 1000 requests per day + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAssignmentFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentFilterModel, +) -> Response[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]]: + """Get Roles by Filter + Rate limited, restricted to once per minute, max 1000 requests per day + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAssignmentFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectAssignmentFilterModel, +) -> Optional[Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel]]: + """Get Roles by Filter + Rate limited, restricted to once per minute, max 1000 requests per day + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + json_body (ProjectAssignmentFilterModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectAssignmentWithStatusModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_event/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_event/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_event/project_event.py b/src/cinode-py-client/cinode_api_client/api/project_event/project_event.py new file mode 100644 index 0000000..23e52d9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_event/project_event.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_model import ProjectEventModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectEventModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]]: + """Get project event by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]]: + """Get project event by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]]: + """Get project event by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectEventModel, ValidationModel]]: + """Get project event by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events/project_events.py b/src/cinode-py-client/cinode_api_client/api/project_events/project_events.py new file mode 100644 index 0000000..7f9511b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events/project_events.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_base_model import ProjectEventBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events".format( + companyId=company_id, + projectId=project_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meeting/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meeting/delete_project_meeting.py b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/delete_project_meeting.py new file mode 100644 index 0000000..01989b6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/delete_project_meeting.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/meetings/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meeting/new_project_meeting.py b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/new_project_meeting.py new file mode 100644 index 0000000..e28bf73 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/new_project_meeting.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_meeting_add_edit_model import ProjectEventMeetingAddEditModel +from ...models.project_event_meeting_model import ProjectEventMeetingModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + *, + json_body: ProjectEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/meetings".format( + companyId=company_id, + projectId=project_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectEventMeetingModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Add project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Add project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Add project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Add project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meeting/project_event_meeting.py b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/project_event_meeting.py new file mode 100644 index 0000000..7c9af19 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/project_event_meeting.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_meeting_model import ProjectEventMeetingModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/meetings/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Get project event meeting by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Get project event meeting by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Get project event meeting by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Get project event meeting by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meeting/update_project_meeting.py b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/update_project_meeting.py new file mode 100644 index 0000000..79835ba --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_meeting/update_project_meeting.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_meeting_add_edit_model import ProjectEventMeetingAddEditModel +from ...models.project_event_meeting_model import ProjectEventMeetingModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, + *, + json_body: ProjectEventMeetingAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/meetings/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectEventMeetingModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Update project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Update project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Update project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventMeetingAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel]]: + """Update project event meeting + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventMeetingAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventMeetingModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meetings/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events_meetings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_meetings/project_event_meetings.py b/src/cinode-py-client/cinode_api_client/api/project_events_meetings/project_event_meetings.py new file mode 100644 index 0000000..0fde92b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_meetings/project_event_meetings.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_base_model import ProjectEventBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/meetings".format( + companyId=company_id, + projectId=project_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events meetings list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events meetings list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events meetings list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project events meetings list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_note/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events_note/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_note/delete_project_note.py b/src/cinode-py-client/cinode_api_client/api/project_events_note/delete_project_note.py new file mode 100644 index 0000000..126827b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_note/delete_project_note.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/notes/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_note/new_project_note.py b/src/cinode-py-client/cinode_api_client/api/project_events_note/new_project_note.py new file mode 100644 index 0000000..f5f03b0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_note/new_project_note.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_note_add_edit_model import ProjectEventNoteAddEditModel +from ...models.project_event_note_model import ProjectEventNoteModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + *, + json_body: ProjectEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/notes".format( + companyId=company_id, + projectId=project_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectEventNoteModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Add project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Add project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Add project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Add project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_note/project_event_note.py b/src/cinode-py-client/cinode_api_client/api/project_events_note/project_event_note.py new file mode 100644 index 0000000..5965090 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_note/project_event_note.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.customer_event_note_model import CustomerEventNoteModel +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/notes/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = CustomerEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get project event note by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get project event note by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get project event note by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel]]: + """Get project event note by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, CustomerEventNoteModel, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_note/update_project_note.py b/src/cinode-py-client/cinode_api_client/api/project_events_note/update_project_note.py new file mode 100644 index 0000000..373aa00 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_note/update_project_note.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_note_add_edit_model import ProjectEventNoteAddEditModel +from ...models.project_event_note_model import ProjectEventNoteModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, + *, + json_body: ProjectEventNoteAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/notes/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectEventNoteModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Update project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Update project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Update project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventNoteAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel]]: + """Update project event note + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventNoteAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventNoteModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_notes/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events_notes/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_notes/project_event_notes.py b/src/cinode-py-client/cinode_api_client/api/project_events_notes/project_event_notes.py new file mode 100644 index 0000000..48dd05f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_notes/project_event_notes.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_base_model import ProjectEventBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/notes".format( + companyId=company_id, + projectId=project_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event notes list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event notes list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event notes list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event notes list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_task/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events_task/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_task/delete_project_task.py b/src/cinode-py-client/cinode_api_client/api/project_events_task/delete_project_task.py new file mode 100644 index 0000000..acb17be --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_task/delete_project_task.py @@ -0,0 +1,199 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "delete", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/tasks/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = cast(Any, None) + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ValidationModel]]: + """Delete project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_task/new_project_task.py b/src/cinode-py-client/cinode_api_client/api/project_events_task/new_project_task.py new file mode 100644 index 0000000..030b38a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_task/new_project_task.py @@ -0,0 +1,205 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_task_add_edit_model import ProjectEventTaskAddEditModel +from ...models.project_event_task_model import ProjectEventTaskModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + *, + json_body: ProjectEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/tasks".format( + companyId=company_id, + projectId=project_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + if response.status_code == HTTPStatus.CREATED: + response_201 = ProjectEventTaskModel.from_dict(response.json()) + + return response_201 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Add project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Add project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Add project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Add project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_task/project_event_task.py b/src/cinode-py-client/cinode_api_client/api/project_events_task/project_event_task.py new file mode 100644 index 0000000..79eb483 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_task/project_event_task.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_task_model import ProjectEventTaskModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/tasks/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Get project event task by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Get project event task by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Get project event task by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Get project event task by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_task/update_project_task.py b/src/cinode-py-client/cinode_api_client/api/project_events_task/update_project_task.py new file mode 100644 index 0000000..a01e3ed --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_task/update_project_task.py @@ -0,0 +1,219 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_task_add_edit_model import ProjectEventTaskAddEditModel +from ...models.project_event_task_model import ProjectEventTaskModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: str, + *, + json_body: ProjectEventTaskAddEditModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "put", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/tasks/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectEventTaskModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Update project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Update project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Update project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: str, + *, + client: Union[AuthenticatedClient, Client], + json_body: ProjectEventTaskAddEditModel, +) -> Optional[Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel]]: + """Update project event task + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (str): + json_body (ProjectEventTaskAddEditModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectEventTaskModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_tasks/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_events_tasks/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_events_tasks/project_event_tasks.py b/src/cinode-py-client/cinode_api_client/api/project_events_tasks/project_event_tasks.py new file mode 100644 index 0000000..b9d3b08 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_events_tasks/project_event_tasks.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_event_base_model import ProjectEventBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/events/tasks".format( + companyId=company_id, + projectId=project_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectEventBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event tasks list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event tasks list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event tasks list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectEventBaseModel"], ValidationModel]]: + """Get project event tasks list + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectEventBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_pipelines/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_pipelines/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_pipelines/project_pipelines.py b/src/cinode-py-client/cinode_api_client/api/project_pipelines/project_pipelines.py new file mode 100644 index 0000000..2d9f36f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_pipelines/project_pipelines.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_pipeline_model import ProjectPipelineModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/pipelines".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectPipelineModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectPipelineModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectPipelineModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectPipelineModel"], ValidationModel]]: + """Get project pipelines + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectPipelineModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectPipelineModel"], ValidationModel]]: + """Get project pipelines + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectPipelineModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectPipelineModel"], ValidationModel]]: + """Get project pipelines + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectPipelineModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectPipelineModel"], ValidationModel]]: + """Get project pipelines + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectPipelineModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_reference/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_reference/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_reference/project_reference.py b/src/cinode-py-client/cinode_api_client/api/project_reference/project_reference.py new file mode 100644 index 0000000..5bb8ce8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_reference/project_reference.py @@ -0,0 +1,204 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_reference_model import ProjectReferenceModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/references/{id}".format( + companyId=company_id, + projectId=project_id, + id=id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectReferenceModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectReferenceModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + id=id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_references/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_references/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_references/project_references.py b/src/cinode-py-client/cinode_api_client/api/project_references/project_references.py new file mode 100644 index 0000000..d480517 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_references/project_references.py @@ -0,0 +1,192 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_reference_model import ProjectReferenceModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/references".format( + companyId=company_id, + projectId=project_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectReferenceModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectReferenceModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectReferenceModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectReferenceModel"], ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectReferenceModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectReferenceModel"], ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectReferenceModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectReferenceModel"], ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectReferenceModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectReferenceModel"], ValidationModel]]: + """Get project reference by id + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + project_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectReferenceModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/project_tags/__init__.py b/src/cinode-py-client/cinode_api_client/api/project_tags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/project_tags/edit_project_tags.py b/src/cinode-py-client/cinode_api_client/api/project_tags/edit_project_tags.py new file mode 100644 index 0000000..359fae0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/project_tags/edit_project_tags.py @@ -0,0 +1,283 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.company_tag_model import CompanyTagModel +from ...models.error_model import ErrorModel +from ...models.project_model import ProjectModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + project_id: int, + *, + json_body: List["CompanyTagModel"], +) -> Dict[str, Any]: + pass + + json_json_body = [] + for json_body_item_data in json_body: + json_body_item = json_body_item_data.to_dict() + + json_json_body.append(json_body_item) + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/{projectId}/tags".format( + companyId=company_id, + projectId=project_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = ProjectModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.FORBIDDEN: + response_403 = cast(Any, None) + return response_403 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + r"""Edit Tags for Project + + Note: + + Posted tags will replace any existing tags for the project. + A new tag will be created, if the id for a tag not provided. + + Sample request: + + POST /v0.1/companies/1/projects/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + project_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + r"""Edit Tags for Project + + Note: + + Posted tags will replace any existing tags for the project. + A new tag will be created, if the id for a tag not provided. + + Sample request: + + POST /v0.1/companies/1/projects/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + project_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + r"""Edit Tags for Project + + Note: + + Posted tags will replace any existing tags for the project. + A new tag will be created, if the id for a tag not provided. + + Sample request: + + POST /v0.1/companies/1/projects/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + project_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, ProjectModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + project_id=project_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + project_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: List["CompanyTagModel"], +) -> Optional[Union[Any, ErrorModel, ProjectModel, ValidationModel]]: + r"""Edit Tags for Project + + Note: + + Posted tags will replace any existing tags for the project. + A new tag will be created, if the id for a tag not provided. + + Sample request: + + POST /v0.1/companies/1/projects/19870/tags + [ + { + \"name\": \"tag-name\", + \"id\": 2 + }, + { + \"name\": \"tag-test\", + \"id\": 1 + }, + ] + + Args: + company_id (int): + project_id (int): + json_body (List['CompanyTagModel']): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, ProjectModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + project_id=project_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/projects/__init__.py b/src/cinode-py-client/cinode_api_client/api/projects/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/projects/projects.py b/src/cinode-py-client/cinode_api_client/api/projects/projects.py new file mode 100644 index 0000000..af3916d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/projects/projects.py @@ -0,0 +1,182 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.project_base_model import ProjectBaseModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/projects".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["ProjectBaseModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = ProjectBaseModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["ProjectBaseModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectBaseModel"], ValidationModel]]: + """Get projects list - please note this endpoint currently only returns projects with the status WON. + Please use the SearchProjects endpoint for more options of filtering desired Projects + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectBaseModel"], ValidationModel]]: + """Get projects list - please note this endpoint currently only returns projects with the status WON. + Please use the SearchProjects endpoint for more options of filtering desired Projects + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectBaseModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["ProjectBaseModel"], ValidationModel]]: + """Get projects list - please note this endpoint currently only returns projects with the status WON. + Please use the SearchProjects endpoint for more options of filtering desired Projects + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['ProjectBaseModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["ProjectBaseModel"], ValidationModel]]: + """Get projects list - please note this endpoint currently only returns projects with the status WON. + Please use the SearchProjects endpoint for more options of filtering desired Projects + + Requires access level: CompanyManager. Requires module: Assignments. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['ProjectBaseModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/recruitment_sources/__init__.py b/src/cinode-py-client/cinode_api_client/api/recruitment_sources/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/recruitment_sources/recruitment_sources.py b/src/cinode-py-client/cinode_api_client/api/recruitment_sources/recruitment_sources.py new file mode 100644 index 0000000..abf5cd2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/recruitment_sources/recruitment_sources.py @@ -0,0 +1,178 @@ +from http import HTTPStatus +from typing import Any, Dict, List, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.recruitment_source_model import RecruitmentSourceModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, +) -> Dict[str, Any]: + pass + + return { + "method": "get", + "url": "/v0.1/companies/{companyId}/candidates/recruitment-sources".format( + companyId=company_id, + ), + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, List["RecruitmentSourceModel"], ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = [] + _response_200 = response.json() + for response_200_item_data in _response_200: + response_200_item = RecruitmentSourceModel.from_dict(response_200_item_data) + + response_200.append(response_200_item) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, List["RecruitmentSourceModel"], ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["RecruitmentSourceModel"], ValidationModel]]: + """Get recruitment sources + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['RecruitmentSourceModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["RecruitmentSourceModel"], ValidationModel]]: + """Get recruitment sources + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['RecruitmentSourceModel'], ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Response[Union[Any, ErrorModel, List["RecruitmentSourceModel"], ValidationModel]]: + """Get recruitment sources + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, List['RecruitmentSourceModel'], ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], +) -> Optional[Union[Any, ErrorModel, List["RecruitmentSourceModel"], ValidationModel]]: + """Get recruitment sources + + Requires access level: CompanyRecruiter. Requires module: Recruitment. + + Args: + company_id (int): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, List['RecruitmentSourceModel'], ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_candidate/__init__.py b/src/cinode-py-client/cinode_api_client/api/search_company_candidate/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_candidate/search_company_candidate.py b/src/cinode-py-client/cinode_api_client/api/search_company_candidate/search_company_candidate.py new file mode 100644 index 0000000..9e44043 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/search_company_candidate/search_company_candidate.py @@ -0,0 +1,259 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_company_candidate_query_model import SearchCompanyCandidateQueryModel +from ...models.search_company_candidate_result_model import SearchCompanyCandidateResultModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SearchCompanyCandidateQueryModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/candidates/search".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchCompanyCandidateResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCandidateQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]]: + r"""Get company candidates list from search criteria + + Sample request: + + POST /v0.1/companies/1/candidates/search + { + \"term\": \"candidate property value\", + \"rating\": 3 + \"status\": 0, + \"sources\": [], + \"noRecruiter\": false, + \"recruiters\": [], + \"states\": [0], + \"pipeline\": null, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15 + }, + \"pipelines\": [] + } + + Args: + company_id (int): + json_body (SearchCompanyCandidateQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCandidateQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]]: + r"""Get company candidates list from search criteria + + Sample request: + + POST /v0.1/companies/1/candidates/search + { + \"term\": \"candidate property value\", + \"rating\": 3 + \"status\": 0, + \"sources\": [], + \"noRecruiter\": false, + \"recruiters\": [], + \"states\": [0], + \"pipeline\": null, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15 + }, + \"pipelines\": [] + } + + Args: + company_id (int): + json_body (SearchCompanyCandidateQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCandidateQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]]: + r"""Get company candidates list from search criteria + + Sample request: + + POST /v0.1/companies/1/candidates/search + { + \"term\": \"candidate property value\", + \"rating\": 3 + \"status\": 0, + \"sources\": [], + \"noRecruiter\": false, + \"recruiters\": [], + \"states\": [0], + \"pipeline\": null, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15 + }, + \"pipelines\": [] + } + + Args: + company_id (int): + json_body (SearchCompanyCandidateQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCandidateQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel]]: + r"""Get company candidates list from search criteria + + Sample request: + + POST /v0.1/companies/1/candidates/search + { + \"term\": \"candidate property value\", + \"rating\": 3 + \"status\": 0, + \"sources\": [], + \"noRecruiter\": false, + \"recruiters\": [], + \"states\": [0], + \"pipeline\": null, + \"pageAndSortBy\": { + \"page\": 1, + \"itemsPerPage\": 15 + }, + \"pipelines\": [] + } + + Args: + company_id (int): + json_body (SearchCompanyCandidateQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyCandidateResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/__init__.py b/src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/search_company_customer_contact.py b/src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/search_company_customer_contact.py new file mode 100644 index 0000000..cebf5b0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/search_company_customer_contact/search_company_customer_contact.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_company_customer_contact_query_model import SearchCompanyCustomerContactQueryModel +from ...models.search_company_customer_contact_result_model import SearchCompanyCustomerContactResultModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SearchCompanyCustomerContactQueryModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/contacts/search".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchCompanyCustomerContactResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerContactQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]]: + """Get company customer contacts list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerContactQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerContactQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]]: + """Get company customer contacts list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerContactQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerContactQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]]: + """Get company customer contacts list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerContactQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerContactQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel]]: + """Get company customer contacts list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerContactQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyCustomerContactResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_customers/__init__.py b/src/cinode-py-client/cinode_api_client/api/search_company_customers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_customers/search_company_customer.py b/src/cinode-py-client/cinode_api_client/api/search_company_customers/search_company_customer.py new file mode 100644 index 0000000..dda8cd9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/search_company_customers/search_company_customer.py @@ -0,0 +1,191 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_company_customer_query_model import SearchCompanyCustomerQueryModel +from ...models.search_company_customer_result_model import SearchCompanyCustomerResultModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SearchCompanyCustomerQueryModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/customers/search".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchCompanyCustomerResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]]: + """Get company customers list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]]: + """Get company customers list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]]: + """Get company customers list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyCustomerQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel]]: + """Get company customers list from search criteria + + Requires access level: CompanyManager. Requires module: Customers. + + Args: + company_id (int): + json_body (SearchCompanyCustomerQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyCustomerResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_user/__init__.py b/src/cinode-py-client/cinode_api_client/api/search_company_user/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/search_company_user/search_company_user.py b/src/cinode-py-client/cinode_api_client/api/search_company_user/search_company_user.py new file mode 100644 index 0000000..70038d8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/search_company_user/search_company_user.py @@ -0,0 +1,183 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_company_user_query_model import SearchCompanyUserQueryModel +from ...models.search_company_user_result_model import SearchCompanyUserResultModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SearchCompanyUserQueryModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/users/search".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchCompanyUserResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyUserQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]]: + """Get company users list from search criteria + + Args: + company_id (int): + json_body (SearchCompanyUserQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyUserQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]]: + """Get company users list from search criteria + + Args: + company_id (int): + json_body (SearchCompanyUserQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyUserQueryModel, +) -> Response[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]]: + """Get company users list from search criteria + + Args: + company_id (int): + json_body (SearchCompanyUserQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchCompanyUserQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel]]: + """Get company users list from search criteria + + Args: + company_id (int): + json_body (SearchCompanyUserQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchCompanyUserResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/search_project/__init__.py b/src/cinode-py-client/cinode_api_client/api/search_project/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/search_project/search_project.py b/src/cinode-py-client/cinode_api_client/api/search_project/search_project.py new file mode 100644 index 0000000..94257ba --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/search_project/search_project.py @@ -0,0 +1,263 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_project_query_model import SearchProjectQueryModel +from ...models.search_projects_result_model import SearchProjectsResultModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SearchProjectQueryModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/projects/search".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchProjectsResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchProjectQueryModel, +) -> Response[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]]: + r"""Get projects list from search criteria + + Sample request + { + \"pipelines\": [4], + \"projectStates\": [0], + \"PageAndSortBy\": { + \"SortBy\": \"0\", + \"SortOrder\": \"1\", + \"Page\": \"1\", + \"ItemsPerPage\": \"15\", + } + } + SortBy Parameter can be: + CreatedDateTime=0 // Default + Title=1 + Identifier=2 + CustomerIdentifier=3 + SeoId=4 + UpdatedDateTime=6 + LastTouchDateTime=7 + + Args: + company_id (int): + json_body (SearchProjectQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchProjectQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]]: + r"""Get projects list from search criteria + + Sample request + { + \"pipelines\": [4], + \"projectStates\": [0], + \"PageAndSortBy\": { + \"SortBy\": \"0\", + \"SortOrder\": \"1\", + \"Page\": \"1\", + \"ItemsPerPage\": \"15\", + } + } + SortBy Parameter can be: + CreatedDateTime=0 // Default + Title=1 + Identifier=2 + CustomerIdentifier=3 + SeoId=4 + UpdatedDateTime=6 + LastTouchDateTime=7 + + Args: + company_id (int): + json_body (SearchProjectQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchProjectQueryModel, +) -> Response[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]]: + r"""Get projects list from search criteria + + Sample request + { + \"pipelines\": [4], + \"projectStates\": [0], + \"PageAndSortBy\": { + \"SortBy\": \"0\", + \"SortOrder\": \"1\", + \"Page\": \"1\", + \"ItemsPerPage\": \"15\", + } + } + SortBy Parameter can be: + CreatedDateTime=0 // Default + Title=1 + Identifier=2 + CustomerIdentifier=3 + SeoId=4 + UpdatedDateTime=6 + LastTouchDateTime=7 + + Args: + company_id (int): + json_body (SearchProjectQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchProjectQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel]]: + r"""Get projects list from search criteria + + Sample request + { + \"pipelines\": [4], + \"projectStates\": [0], + \"PageAndSortBy\": { + \"SortBy\": \"0\", + \"SortOrder\": \"1\", + \"Page\": \"1\", + \"ItemsPerPage\": \"15\", + } + } + SortBy Parameter can be: + CreatedDateTime=0 // Default + Title=1 + Identifier=2 + CustomerIdentifier=3 + SeoId=4 + UpdatedDateTime=6 + LastTouchDateTime=7 + + Args: + company_id (int): + json_body (SearchProjectQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchProjectsResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/skill_search/__init__.py b/src/cinode-py-client/cinode_api_client/api/skill_search/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/skill_search/search_skill.py b/src/cinode-py-client/cinode_api_client/api/skill_search/search_skill.py new file mode 100644 index 0000000..31cd1b5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/skill_search/search_skill.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_skill_query_model import SearchSkillQueryModel +from ...models.search_skill_result_model import SearchSkillResultModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SearchSkillQueryModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/skills/search".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchSkillResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchSkillQueryModel, +) -> Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users by skill keyword id + + Args: + company_id (int): + json_body (SearchSkillQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchSkillQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users by skill keyword id + + Args: + company_id (int): + json_body (SearchSkillQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchSkillQueryModel, +) -> Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users by skill keyword id + + Args: + company_id (int): + json_body (SearchSkillQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SearchSkillQueryModel, +) -> Optional[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users by skill keyword id + + Args: + company_id (int): + json_body (SearchSkillQueryModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/api/skill_search_term/__init__.py b/src/cinode-py-client/cinode_api_client/api/skill_search_term/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/cinode-py-client/cinode_api_client/api/skill_search_term/search_skill_term.py b/src/cinode-py-client/cinode_api_client/api/skill_search_term/search_skill_term.py new file mode 100644 index 0000000..5b2f8a3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/api/skill_search_term/search_skill_term.py @@ -0,0 +1,186 @@ +from http import HTTPStatus +from typing import Any, Dict, Optional, Union, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.error_model import ErrorModel +from ...models.search_skill_result_model import SearchSkillResultModel +from ...models.skill_search_query_term_model import SkillSearchQueryTermModel +from ...models.validation_model import ValidationModel +from ...types import Response + + +def _get_kwargs( + company_id: int, + *, + json_body: SkillSearchQueryTermModel, +) -> Dict[str, Any]: + pass + + json_json_body = json_body.to_dict() + + return { + "method": "post", + "url": "/v0.1/companies/{companyId}/skills/search/term".format( + companyId=company_id, + ), + "json": json_json_body, + } + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + if response.status_code == HTTPStatus.OK: + response_200 = SearchSkillResultModel.from_dict(response.json()) + + return response_200 + if response.status_code == HTTPStatus.BAD_REQUEST: + response_400 = ValidationModel.from_dict(response.json()) + + return response_400 + if response.status_code == HTTPStatus.UNAUTHORIZED: + response_401 = cast(Any, None) + return response_401 + if response.status_code == HTTPStatus.NOT_FOUND: + response_404 = cast(Any, None) + return response_404 + if response.status_code == HTTPStatus.INTERNAL_SERVER_ERROR: + response_500 = ErrorModel.from_dict(response.json()) + + return response_500 + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SkillSearchQueryTermModel, +) -> Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users with skills by term (string value) + + Args: + company_id (int): + json_body (SkillSearchQueryTermModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SkillSearchQueryTermModel, +) -> Optional[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users with skills by term (string value) + + Args: + company_id (int): + json_body (SkillSearchQueryTermModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel] + """ + + return sync_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ).parsed + + +async def asyncio_detailed( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SkillSearchQueryTermModel, +) -> Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users with skills by term (string value) + + Args: + company_id (int): + json_body (SkillSearchQueryTermModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]] + """ + + kwargs = _get_kwargs( + company_id=company_id, + json_body=json_body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + company_id: int, + *, + client: Union[AuthenticatedClient, Client], + json_body: SkillSearchQueryTermModel, +) -> Optional[Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel]]: + """Search users with skills by term (string value) + + Args: + company_id (int): + json_body (SkillSearchQueryTermModel): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Union[Any, ErrorModel, SearchSkillResultModel, ValidationModel] + """ + + return ( + await asyncio_detailed( + company_id=company_id, + client=client, + json_body=json_body, + ) + ).parsed diff --git a/src/cinode-py-client/cinode_api_client/client.py b/src/cinode-py-client/cinode_api_client/client.py new file mode 100644 index 0000000..74b476c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/client.py @@ -0,0 +1,268 @@ +import ssl +from typing import Any, Dict, Optional, Union + +import httpx +from attrs import define, evolve, field + + +@define +class Client: + """A class for keeping track of data related to the API + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str + _cookies: Dict[str, str] = field(factory=dict, kw_only=True) + _headers: Dict[str, str] = field(factory=dict, kw_only=True) + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True) + _follow_redirects: bool = field(default=False, kw_only=True) + _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True) + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + + def with_headers(self, headers: Dict[str, str]) -> "Client": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: Dict[str, str]) -> "Client": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "Client": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "Client": + """Manually the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "Client": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "Client": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) + + +@define +class AuthenticatedClient: + """A Client which has been authenticated for use on secured endpoints + + The following are accepted as keyword arguments and will be used to construct httpx Clients internally: + + ``base_url``: The base URL for the API, all requests are made to a relative path to this URL + + ``cookies``: A dictionary of cookies to be sent with every request + + ``headers``: A dictionary of headers to be sent with every request + + ``timeout``: The maximum amount of a time a request can take. API functions will raise + httpx.TimeoutException if this is exceeded. + + ``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production, + but can be set to False for testing purposes. + + ``follow_redirects``: Whether or not to follow redirects. Default value is False. + + ``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor. + + + Attributes: + raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a + status code that was not documented in the source OpenAPI document. Can also be provided as a keyword + argument to the constructor. + token: The token to use for authentication + prefix: The prefix to use for the Authorization header + auth_header_name: The name of the Authorization header + """ + + raise_on_unexpected_status: bool = field(default=False, kw_only=True) + _base_url: str + _cookies: Dict[str, str] = field(factory=dict, kw_only=True) + _headers: Dict[str, str] = field(factory=dict, kw_only=True) + _timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True) + _verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True) + _follow_redirects: bool = field(default=False, kw_only=True) + _httpx_args: Dict[str, Any] = field(factory=dict, kw_only=True) + _client: Optional[httpx.Client] = field(default=None, init=False) + _async_client: Optional[httpx.AsyncClient] = field(default=None, init=False) + + token: str + prefix: str = "Bearer" + auth_header_name: str = "Authorization" + + def with_headers(self, headers: Dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional headers""" + if self._client is not None: + self._client.headers.update(headers) + if self._async_client is not None: + self._async_client.headers.update(headers) + return evolve(self, headers={**self._headers, **headers}) + + def with_cookies(self, cookies: Dict[str, str]) -> "AuthenticatedClient": + """Get a new client matching this one with additional cookies""" + if self._client is not None: + self._client.cookies.update(cookies) + if self._async_client is not None: + self._async_client.cookies.update(cookies) + return evolve(self, cookies={**self._cookies, **cookies}) + + def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient": + """Get a new client matching this one with a new timeout (in seconds)""" + if self._client is not None: + self._client.timeout = timeout + if self._async_client is not None: + self._async_client.timeout = timeout + return evolve(self, timeout=timeout) + + def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient": + """Manually the underlying httpx.Client + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._client = client + return self + + def get_httpx_client(self) -> httpx.Client: + """Get the underlying httpx.Client, constructing a new one if not previously set""" + if self._client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._client = httpx.Client( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._client + + def __enter__(self) -> "AuthenticatedClient": + """Enter a context manager for self.client—you cannot enter twice (see httpx docs)""" + self.get_httpx_client().__enter__() + return self + + def __exit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for internal httpx.Client (see httpx docs)""" + self.get_httpx_client().__exit__(*args, **kwargs) + + def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient": + """Manually the underlying httpx.AsyncClient + + **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. + """ + self._async_client = async_client + return self + + def get_async_httpx_client(self) -> httpx.AsyncClient: + """Get the underlying httpx.AsyncClient, constructing a new one if not previously set""" + if self._async_client is None: + self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token + self._async_client = httpx.AsyncClient( + base_url=self._base_url, + cookies=self._cookies, + headers=self._headers, + timeout=self._timeout, + verify=self._verify_ssl, + follow_redirects=self._follow_redirects, + **self._httpx_args, + ) + return self._async_client + + async def __aenter__(self) -> "AuthenticatedClient": + """Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)""" + await self.get_async_httpx_client().__aenter__() + return self + + async def __aexit__(self, *args: Any, **kwargs: Any) -> None: + """Exit a context manager for underlying httpx.AsyncClient (see httpx docs)""" + await self.get_async_httpx_client().__aexit__(*args, **kwargs) diff --git a/src/cinode-py-client/cinode_api_client/errors.py b/src/cinode-py-client/cinode_api_client/errors.py new file mode 100644 index 0000000..426f8a2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/errors.py @@ -0,0 +1,14 @@ +""" Contains shared errors types that can be raised from API functions """ + + +class UnexpectedStatus(Exception): + """Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True""" + + def __init__(self, status_code: int, content: bytes): + self.status_code = status_code + self.content = content + + super().__init__(f"Unexpected status code: {status_code}") + + +__all__ = ["UnexpectedStatus"] diff --git a/src/cinode-py-client/cinode_api_client/models/__init__.py b/src/cinode-py-client/cinode_api_client/models/__init__.py new file mode 100644 index 0000000..e8e79dd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/__init__.py @@ -0,0 +1,665 @@ +""" Contains all the data models used in inputs/outputs """ + +from .abscence_period_day_model import AbscencePeriodDayModel +from .absence_add_edit_model import AbsenceAddEditModel +from .absence_period_dto_model import AbsencePeriodDtoModel +from .absence_period_model import AbsencePeriodModel +from .absence_type_dto import AbsenceTypeDto +from .absence_type_model import AbsenceTypeModel +from .access_level import AccessLevel +from .action_type import ActionType +from .add_company_image_multipart_data import AddCompanyImageMultipartData +from .add_company_subcontractor_group_member_model import AddCompanySubcontractorGroupMemberModel +from .address_info_block_view_model import AddressInfoBlockViewModel +from .address_type import AddressType +from .attachment_type import AttachmentType +from .availability_filter_model import AvailabilityFilterModel +from .availability_model import AvailabilityModel +from .calendar_day_model import CalendarDayModel +from .candidate_attachment_multipart_data import CandidateAttachmentMultipartData +from .classic_company_user_resume_model import ClassicCompanyUserResumeModel +from .commitment_block_item_model import CommitmentBlockItemModel +from .commitment_block_model import CommitmentBlockModel +from .company_address_model import CompanyAddressModel +from .company_base_model import CompanyBaseModel +from .company_candidate_add_invite_model import CompanyCandidateAddInviteModel +from .company_candidate_add_model import CompanyCandidateAddModel +from .company_candidate_attachment_model import CompanyCandidateAttachmentModel +from .company_candidate_base_model import CompanyCandidateBaseModel +from .company_candidate_event_base_model import CompanyCandidateEventBaseModel +from .company_candidate_event_meeting_model import CompanyCandidateEventMeetingModel +from .company_candidate_event_model import CompanyCandidateEventModel +from .company_candidate_event_note_model import CompanyCandidateEventNoteModel +from .company_candidate_event_task_model import CompanyCandidateEventTaskModel +from .company_candidate_extended_model import CompanyCandidateExtendedModel +from .company_candidate_file_attachment_list_model import CompanyCandidateFileAttachmentListModel +from .company_candidate_file_attachment_model import CompanyCandidateFileAttachmentModel +from .company_candidate_pipeline_model import CompanyCandidatePipelineModel +from .company_candidate_pipeline_stage_model import CompanyCandidatePipelineStageModel +from .company_candidate_query_sort import CompanyCandidateQuerySort +from .company_candidate_query_sort_page_and_sort_by_model import CompanyCandidateQuerySortPageAndSortByModel +from .company_candidate_skill_add_model import CompanyCandidateSkillAddModel +from .company_candidate_skill_model import CompanyCandidateSkillModel +from .company_candidate_state import CompanyCandidateState +from .company_candidate_uri_attachment_add_model import CompanyCandidateUriAttachmentAddModel +from .company_candidate_uri_attachment_model import CompanyCandidateUriAttachmentModel +from .company_capabilities_model import CompanyCapabilitiesModel +from .company_customer_add_model import CompanyCustomerAddModel +from .company_customer_address_add_edit_model import CompanyCustomerAddressAddEditModel +from .company_customer_address_model import CompanyCustomerAddressModel +from .company_customer_attachment_model import CompanyCustomerAttachmentModel +from .company_customer_base_model import CompanyCustomerBaseModel +from .company_customer_contact_add_edit_model import CompanyCustomerContactAddEditModel +from .company_customer_contact_base_model import CompanyCustomerContactBaseModel +from .company_customer_contact_model import CompanyCustomerContactModel +from .company_customer_contact_query_sort import CompanyCustomerContactQuerySort +from .company_customer_contact_query_sort_page_and_sort_by_model import ( + CompanyCustomerContactQuerySortPageAndSortByModel, +) +from .company_customer_delete_model import CompanyCustomerDeleteModel +from .company_customer_edit_model import CompanyCustomerEditModel +from .company_customer_extended_model import CompanyCustomerExtendedModel +from .company_customer_manager_model import CompanyCustomerManagerModel +from .company_customer_managers_add_edit_model import CompanyCustomerManagersAddEditModel +from .company_customer_model import CompanyCustomerModel +from .company_customer_query_sort import CompanyCustomerQuerySort +from .company_customer_query_sort_page_and_sort_by_model import CompanyCustomerQuerySortPageAndSortByModel +from .company_enabled_module_model import CompanyEnabledModuleModel +from .company_image_model import CompanyImageModel +from .company_model import CompanyModel +from .company_profile_filter_model import CompanyProfileFilterModel +from .company_profile_sort import CompanyProfileSort +from .company_profile_sort_page_and_sort_by_model import CompanyProfileSortPageAndSortByModel +from .company_profiles_model import CompanyProfilesModel +from .company_recruitment_manager_model import CompanyRecruitmentManagerModel +from .company_resume_template_base_model import CompanyResumeTemplateBaseModel +from .company_resume_template_language_model import CompanyResumeTemplateLanguageModel +from .company_size import CompanySize +from .company_subcontractor_group_base_model import CompanySubcontractorGroupBaseModel +from .company_subcontractor_group_model import CompanySubcontractorGroupModel +from .company_tag_base_model import CompanyTagBaseModel +from .company_tag_model import CompanyTagModel +from .company_tag_type_model import CompanyTagTypeModel +from .company_user_add_model import CompanyUserAddModel +from .company_user_base_model import CompanyUserBaseModel +from .company_user_edit_model import CompanyUserEditModel +from .company_user_event_base_model import CompanyUserEventBaseModel +from .company_user_event_meeting_add_edit_model import CompanyUserEventMeetingAddEditModel +from .company_user_event_meeting_model import CompanyUserEventMeetingModel +from .company_user_event_model import CompanyUserEventModel +from .company_user_event_note_add_edit_model import CompanyUserEventNoteAddEditModel +from .company_user_event_note_model import CompanyUserEventNoteModel +from .company_user_event_task_add_edit_model import CompanyUserEventTaskAddEditModel +from .company_user_event_task_model import CompanyUserEventTaskModel +from .company_user_extended_model import CompanyUserExtendedModel +from .company_user_full_model import CompanyUserFullModel +from .company_user_image_model import CompanyUserImageModel +from .company_user_info_block_view_model import CompanyUserInfoBlockViewModel +from .company_user_model import CompanyUserModel +from .company_user_permissions_edit_model import CompanyUserPermissionsEditModel +from .company_user_profile_add_edit_model import CompanyUserProfileAddEditModel +from .company_user_profile_base_model import CompanyUserProfileBaseModel +from .company_user_profile_commitment_add_edit_model import CompanyUserProfileCommitmentAddEditModel +from .company_user_profile_commitment_model import CompanyUserProfileCommitmentModel +from .company_user_profile_commitment_translation_model import CompanyUserProfileCommitmentTranslationModel +from .company_user_profile_education_add_edit_model import CompanyUserProfileEducationAddEditModel +from .company_user_profile_education_model import CompanyUserProfileEducationModel +from .company_user_profile_education_translation_model import CompanyUserProfileEducationTranslationModel +from .company_user_profile_employer_add_edit_model import CompanyUserProfileEmployerAddEditModel +from .company_user_profile_employer_model import CompanyUserProfileEmployerModel +from .company_user_profile_employer_translation_model import CompanyUserProfileEmployerTranslationModel +from .company_user_profile_ext_skill_add_edit_model import CompanyUserProfileExtSkillAddEditModel +from .company_user_profile_ext_skill_model import CompanyUserProfileExtSkillModel +from .company_user_profile_ext_skill_translation_model import CompanyUserProfileExtSkillTranslationModel +from .company_user_profile_full_model import CompanyUserProfileFullModel +from .company_user_profile_language_add_edit_model import CompanyUserProfileLanguageAddEditModel +from .company_user_profile_language_branch_model import CompanyUserProfileLanguageBranchModel +from .company_user_profile_language_model import CompanyUserProfileLanguageModel +from .company_user_profile_presentation_edit_model import CompanyUserProfilePresentationEditModel +from .company_user_profile_presentation_model import CompanyUserProfilePresentationModel +from .company_user_profile_presentation_translation_model import CompanyUserProfilePresentationTranslationModel +from .company_user_profile_reference_add_edit_model import CompanyUserProfileReferenceAddEditModel +from .company_user_profile_reference_model import CompanyUserProfileReferenceModel +from .company_user_profile_reference_translation_model import CompanyUserProfileReferenceTranslationModel +from .company_user_profile_skill_add_model import CompanyUserProfileSkillAddModel +from .company_user_profile_skill_edit_model import CompanyUserProfileSkillEditModel +from .company_user_profile_skill_history_model import CompanyUserProfileSkillHistoryModel +from .company_user_profile_skill_model import CompanyUserProfileSkillModel +from .company_user_profile_skill_translation_model import CompanyUserProfileSkillTranslationModel +from .company_user_profile_training_add_edit_model import CompanyUserProfileTrainingAddEditModel +from .company_user_profile_training_model import CompanyUserProfileTrainingModel +from .company_user_profile_training_translation_model import CompanyUserProfileTrainingTranslationModel +from .company_user_profile_translation_model import CompanyUserProfileTranslationModel +from .company_user_profile_work_experience_add_edit_model import CompanyUserProfileWorkExperienceAddEditModel +from .company_user_profile_work_experience_model import CompanyUserProfileWorkExperienceModel +from .company_user_profile_work_experience_skill_add_model import CompanyUserProfileWorkExperienceSkillAddModel +from .company_user_profile_work_experience_translation_model import CompanyUserProfileWorkExperienceTranslationModel +from .company_user_project_assignment_model import CompanyUserProjectAssignmentModel +from .company_user_query_sort import CompanyUserQuerySort +from .company_user_query_sort_page_and_sort_by_model import CompanyUserQuerySortPageAndSortByModel +from .company_user_resume_base_model import CompanyUserResumeBaseModel +from .company_user_search_skill_model import CompanyUserSearchSkillModel +from .company_user_skill_model import CompanyUserSkillModel +from .company_user_status import CompanyUserStatus +from .company_user_subcontractor_add_edit_model import CompanyUserSubcontractorAddEditModel +from .company_user_subcontractor_attachment_model import CompanyUserSubcontractorAttachmentModel +from .company_user_subcontractor_base_model import CompanyUserSubcontractorBaseModel +from .company_user_subcontractor_file_attachment_list_model import CompanyUserSubcontractorFileAttachmentListModel +from .company_user_subcontractor_file_attachment_model import CompanyUserSubcontractorFileAttachmentModel +from .company_user_subcontractor_model import CompanyUserSubcontractorModel +from .company_user_subcontractor_role_member_model import CompanyUserSubcontractorRoleMemberModel +from .company_user_subcontractor_roles_model import CompanyUserSubcontractorRolesModel +from .company_user_subcontractor_status import CompanyUserSubcontractorStatus +from .company_user_type import CompanyUserType +from .contract_type import ContractType +from .convert_company_user_to_aad_account_model import ConvertCompanyUserToAadAccountModel +from .country_model import CountryModel +from .create_company_user_profile_import_multipart_data import CreateCompanyUserProfileImportMultipartData +from .created_model import CreatedModel +from .currency_model import CurrencyModel +from .customer_event_base_model import CustomerEventBaseModel +from .customer_event_meeting_add_edit_model import CustomerEventMeetingAddEditModel +from .customer_event_meeting_model import CustomerEventMeetingModel +from .customer_event_model import CustomerEventModel +from .customer_event_note_add_edit_model import CustomerEventNoteAddEditModel +from .customer_event_note_model import CustomerEventNoteModel +from .customer_event_task_add_edit_model import CustomerEventTaskAddEditModel +from .customer_event_task_model import CustomerEventTaskModel +from .dynamic_company_user_resume_model import DynamicCompanyUserResumeModel +from .dynamic_template_view_model import DynamicTemplateViewModel +from .dynamic_template_view_model_primary_script_assets import DynamicTemplateViewModelPrimaryScriptAssets +from .dynamic_template_view_model_primary_style_assets import DynamicTemplateViewModelPrimaryStyleAssets +from .education_block_item_model import EducationBlockItemModel +from .education_block_model import EducationBlockModel +from .employer_block_item_model import EmployerBlockItemModel +from .employer_block_model import EmployerBlockModel +from .error_model import ErrorModel +from .event_comment_model import EventCommentModel +from .event_meeting_add_edit_model import EventMeetingAddEditModel +from .event_note_add_edit_model import EventNoteAddEditModel +from .event_note_type import EventNoteType +from .event_status_value import EventStatusValue +from .event_task_add_edit_model import EventTaskAddEditModel +from .event_task_type import EventTaskType +from .event_type import EventType +from .event_visibility import EventVisibility +from .extent_type import ExtentType +from .extra_skill_block_model import ExtraSkillBlockModel +from .extra_skill_item_block_model import ExtraSkillItemBlockModel +from .filter_model import FilterModel +from .highlighted_work_experience_block_item_model import HighlightedWorkExperienceBlockItemModel +from .highlighted_work_experience_block_model import HighlightedWorkExperienceBlockModel +from .i_company_address_view_model import ICompanyAddressViewModel +from .i_company_candidate_patch_document import ICompanyCandidatePatchDocument +from .i_company_user_employee_patch_document import ICompanyUserEmployeePatchDocument +from .i_contact_info_view_model import IContactInfoViewModel +from .i_dynamic_block_view_model import IDynamicBlockViewModel +from .i_template_company import ITemplateCompany +from .i_template_image import ITemplateImage +from .i_template_logotype import ITemplateLogotype +from .i_template_shared_asset_view_model import ITemplateSharedAssetViewModel +from .i_template_style_asset_view_model import ITemplateStyleAssetViewModel +from .i_template_user_info import ITemplateUserInfo +from .image_block_model import ImageBlockModel +from .image_size import ImageSize +from .import_profile_async_operation import ImportProfileAsyncOperation +from .keyword_model import KeywordModel +from .keyword_synonym_model import KeywordSynonymModel +from .keyword_type import KeywordType +from .language_block_model import LanguageBlockModel +from .language_item_block_model import LanguageItemBlockModel +from .language_level import LanguageLevel +from .link import Link +from .location_block_model import LocationBlockModel +from .location_model import LocationModel +from .long_running_status import LongRunningStatus +from .mention_text_model import MentionTextModel +from .module_type import ModuleType +from .operation import Operation +from .operation_value import OperationValue +from .partner_base_model import PartnerBaseModel +from .partner_connection_base_model import PartnerConnectionBaseModel +from .partner_connection_trust_type import PartnerConnectionTrustType +from .partner_recipient_base_model import PartnerRecipientBaseModel +from .partners_filter_model import PartnersFilterModel +from .partners_overview_model import PartnersOverviewModel +from .pdf_engine_type import PdfEngineType +from .pdf_orientation import PdfOrientation +from .presentation_block_model import PresentationBlockModel +from .profile_language_model import ProfileLanguageModel +from .project_add_edit_model import ProjectAddEditModel +from .project_assignment_add_model import ProjectAssignmentAddModel +from .project_assignment_allocation_status import ProjectAssignmentAllocationStatus +from .project_assignment_announce_model import ProjectAssignmentAnnounceModel +from .project_assignment_announcement_base_model import ProjectAssignmentAnnouncementBaseModel +from .project_assignment_base_model import ProjectAssignmentBaseModel +from .project_assignment_edit_model import ProjectAssignmentEditModel +from .project_assignment_extent_type import ProjectAssignmentExtentType +from .project_assignment_filter_model import ProjectAssignmentFilterModel +from .project_assignment_member_allocation_status import ProjectAssignmentMemberAllocationStatus +from .project_assignment_member_employee_add_model import ProjectAssignmentMemberEmployeeAddModel +from .project_assignment_member_employee_edit_model import ProjectAssignmentMemberEmployeeEditModel +from .project_assignment_member_model import ProjectAssignmentMemberModel +from .project_assignment_member_state import ProjectAssignmentMemberState +from .project_assignment_member_state_history_model import ProjectAssignmentMemberStateHistoryModel +from .project_assignment_member_subcontractor_add_model import ProjectAssignmentMemberSubcontractorAddModel +from .project_assignment_member_subcontractor_edit_model import ProjectAssignmentMemberSubcontractorEditModel +from .project_assignment_member_type import ProjectAssignmentMemberType +from .project_assignment_model import ProjectAssignmentModel +from .project_assignment_request_status import ProjectAssignmentRequestStatus +from .project_assignment_skill_add_model import ProjectAssignmentSkillAddModel +from .project_assignment_skill_base_model import ProjectAssignmentSkillBaseModel +from .project_assignment_skill_edit_model import ProjectAssignmentSkillEditModel +from .project_assignment_skill_model import ProjectAssignmentSkillModel +from .project_assignment_status import ProjectAssignmentStatus +from .project_assignment_with_status_model import ProjectAssignmentWithStatusModel +from .project_attachment_model import ProjectAttachmentModel +from .project_base_model import ProjectBaseModel +from .project_event_base_model import ProjectEventBaseModel +from .project_event_meeting_add_edit_model import ProjectEventMeetingAddEditModel +from .project_event_meeting_model import ProjectEventMeetingModel +from .project_event_model import ProjectEventModel +from .project_event_note_add_edit_model import ProjectEventNoteAddEditModel +from .project_event_note_model import ProjectEventNoteModel +from .project_event_task_add_edit_model import ProjectEventTaskAddEditModel +from .project_event_task_model import ProjectEventTaskModel +from .project_model import ProjectModel +from .project_pipeline_model import ProjectPipelineModel +from .project_pipeline_stage_model import ProjectPipelineStageModel +from .project_priority import ProjectPriority +from .project_query_sort import ProjectQuerySort +from .project_query_sort_page_and_sort_by_model import ProjectQuerySortPageAndSortByModel +from .project_reference_model import ProjectReferenceModel +from .project_state import ProjectState +from .project_state_history_model import ProjectStateHistoryModel +from .project_state_reason_model import ProjectStateReasonModel +from .recruitment_source_model import RecruitmentSourceModel +from .reference_block_item_model import ReferenceBlockItemModel +from .reference_block_model import ReferenceBlockModel +from .resume_model import ResumeModel +from .role_model import RoleModel +from .search_company_candidate_query_model import SearchCompanyCandidateQueryModel +from .search_company_candidate_result_model import SearchCompanyCandidateResultModel +from .search_company_customer_contact_query_model import SearchCompanyCustomerContactQueryModel +from .search_company_customer_contact_result_model import SearchCompanyCustomerContactResultModel +from .search_company_customer_query_model import SearchCompanyCustomerQueryModel +from .search_company_customer_result_model import SearchCompanyCustomerResultModel +from .search_company_user_query_model import SearchCompanyUserQueryModel +from .search_company_user_result_model import SearchCompanyUserResultModel +from .search_project_query_model import SearchProjectQueryModel +from .search_projects_result_model import SearchProjectsResultModel +from .search_skill_model import SearchSkillModel +from .search_skill_query_model import SearchSkillQueryModel +from .search_skill_result_model import SearchSkillResultModel +from .skill_block_item_model import SkillBlockItemModel +from .skill_by_category_block_item_model import SkillByCategoryBlockItemModel +from .skill_by_category_block_model import SkillByCategoryBlockModel +from .skill_model_model import SkillModelModel +from .skill_result_model import SkillResultModel +from .skill_search_query_term_model import SkillSearchQueryTermModel +from .sort_order import SortOrder +from .status import Status +from .string_comparison_operator import StringComparisonOperator +from .subcontractor_attachment_multipart_data import SubcontractorAttachmentMultipartData +from .team_add_edit_model import TeamAddEditModel +from .team_base_model import TeamBaseModel +from .team_manager_edit_model import TeamManagerEditModel +from .team_manager_model import TeamManagerModel +from .team_member_add_model import TeamMemberAddModel +from .team_member_edit_model import TeamMemberEditModel +from .team_member_model import TeamMemberModel +from .team_member_move_model import TeamMemberMoveModel +from .team_model import TeamModel +from .template_asset_type import TemplateAssetType +from .text_block_model import TextBlockModel +from .top_skill_block_item_model import TopSkillBlockItemModel +from .top_skill_block_model import TopSkillBlockModel +from .training_block_model import TrainingBlockModel +from .training_item_block_model import TrainingItemBlockModel +from .training_type import TrainingType +from .updated_model import UpdatedModel +from .user_gender import UserGender +from .validation_model import ValidationModel +from .validation_model_errors import ValidationModelErrors +from .webhook_add_model import WebhookAddModel +from .webhook_configuration_add_model import WebhookConfigurationAddModel +from .webhook_configuration_model import WebhookConfigurationModel +from .webhook_credentials_add_model import WebhookCredentialsAddModel +from .webhook_credentials_model import WebhookCredentialsModel +from .webhook_entity_type import WebhookEntityType +from .webhook_model import WebhookModel +from .word_engine_type import WordEngineType +from .work_experience_block_item_model import WorkExperienceBlockItemModel +from .work_experience_block_model import WorkExperienceBlockModel + +__all__ = ( + "AbscencePeriodDayModel", + "AbsenceAddEditModel", + "AbsencePeriodDtoModel", + "AbsencePeriodModel", + "AbsenceTypeDto", + "AbsenceTypeModel", + "AccessLevel", + "ActionType", + "AddCompanyImageMultipartData", + "AddCompanySubcontractorGroupMemberModel", + "AddressInfoBlockViewModel", + "AddressType", + "AttachmentType", + "AvailabilityFilterModel", + "AvailabilityModel", + "CalendarDayModel", + "CandidateAttachmentMultipartData", + "ClassicCompanyUserResumeModel", + "CommitmentBlockItemModel", + "CommitmentBlockModel", + "CompanyAddressModel", + "CompanyBaseModel", + "CompanyCandidateAddInviteModel", + "CompanyCandidateAddModel", + "CompanyCandidateAttachmentModel", + "CompanyCandidateBaseModel", + "CompanyCandidateEventBaseModel", + "CompanyCandidateEventMeetingModel", + "CompanyCandidateEventModel", + "CompanyCandidateEventNoteModel", + "CompanyCandidateEventTaskModel", + "CompanyCandidateExtendedModel", + "CompanyCandidateFileAttachmentListModel", + "CompanyCandidateFileAttachmentModel", + "CompanyCandidatePipelineModel", + "CompanyCandidatePipelineStageModel", + "CompanyCandidateQuerySort", + "CompanyCandidateQuerySortPageAndSortByModel", + "CompanyCandidateSkillAddModel", + "CompanyCandidateSkillModel", + "CompanyCandidateState", + "CompanyCandidateUriAttachmentAddModel", + "CompanyCandidateUriAttachmentModel", + "CompanyCapabilitiesModel", + "CompanyCustomerAddModel", + "CompanyCustomerAddressAddEditModel", + "CompanyCustomerAddressModel", + "CompanyCustomerAttachmentModel", + "CompanyCustomerBaseModel", + "CompanyCustomerContactAddEditModel", + "CompanyCustomerContactBaseModel", + "CompanyCustomerContactModel", + "CompanyCustomerContactQuerySort", + "CompanyCustomerContactQuerySortPageAndSortByModel", + "CompanyCustomerDeleteModel", + "CompanyCustomerEditModel", + "CompanyCustomerExtendedModel", + "CompanyCustomerManagerModel", + "CompanyCustomerManagersAddEditModel", + "CompanyCustomerModel", + "CompanyCustomerQuerySort", + "CompanyCustomerQuerySortPageAndSortByModel", + "CompanyEnabledModuleModel", + "CompanyImageModel", + "CompanyModel", + "CompanyProfileFilterModel", + "CompanyProfilesModel", + "CompanyProfileSort", + "CompanyProfileSortPageAndSortByModel", + "CompanyRecruitmentManagerModel", + "CompanyResumeTemplateBaseModel", + "CompanyResumeTemplateLanguageModel", + "CompanySize", + "CompanySubcontractorGroupBaseModel", + "CompanySubcontractorGroupModel", + "CompanyTagBaseModel", + "CompanyTagModel", + "CompanyTagTypeModel", + "CompanyUserAddModel", + "CompanyUserBaseModel", + "CompanyUserEditModel", + "CompanyUserEventBaseModel", + "CompanyUserEventMeetingAddEditModel", + "CompanyUserEventMeetingModel", + "CompanyUserEventModel", + "CompanyUserEventNoteAddEditModel", + "CompanyUserEventNoteModel", + "CompanyUserEventTaskAddEditModel", + "CompanyUserEventTaskModel", + "CompanyUserExtendedModel", + "CompanyUserFullModel", + "CompanyUserImageModel", + "CompanyUserInfoBlockViewModel", + "CompanyUserModel", + "CompanyUserPermissionsEditModel", + "CompanyUserProfileAddEditModel", + "CompanyUserProfileBaseModel", + "CompanyUserProfileCommitmentAddEditModel", + "CompanyUserProfileCommitmentModel", + "CompanyUserProfileCommitmentTranslationModel", + "CompanyUserProfileEducationAddEditModel", + "CompanyUserProfileEducationModel", + "CompanyUserProfileEducationTranslationModel", + "CompanyUserProfileEmployerAddEditModel", + "CompanyUserProfileEmployerModel", + "CompanyUserProfileEmployerTranslationModel", + "CompanyUserProfileExtSkillAddEditModel", + "CompanyUserProfileExtSkillModel", + "CompanyUserProfileExtSkillTranslationModel", + "CompanyUserProfileFullModel", + "CompanyUserProfileLanguageAddEditModel", + "CompanyUserProfileLanguageBranchModel", + "CompanyUserProfileLanguageModel", + "CompanyUserProfilePresentationEditModel", + "CompanyUserProfilePresentationModel", + "CompanyUserProfilePresentationTranslationModel", + "CompanyUserProfileReferenceAddEditModel", + "CompanyUserProfileReferenceModel", + "CompanyUserProfileReferenceTranslationModel", + "CompanyUserProfileSkillAddModel", + "CompanyUserProfileSkillEditModel", + "CompanyUserProfileSkillHistoryModel", + "CompanyUserProfileSkillModel", + "CompanyUserProfileSkillTranslationModel", + "CompanyUserProfileTrainingAddEditModel", + "CompanyUserProfileTrainingModel", + "CompanyUserProfileTrainingTranslationModel", + "CompanyUserProfileTranslationModel", + "CompanyUserProfileWorkExperienceAddEditModel", + "CompanyUserProfileWorkExperienceModel", + "CompanyUserProfileWorkExperienceSkillAddModel", + "CompanyUserProfileWorkExperienceTranslationModel", + "CompanyUserProjectAssignmentModel", + "CompanyUserQuerySort", + "CompanyUserQuerySortPageAndSortByModel", + "CompanyUserResumeBaseModel", + "CompanyUserSearchSkillModel", + "CompanyUserSkillModel", + "CompanyUserStatus", + "CompanyUserSubcontractorAddEditModel", + "CompanyUserSubcontractorAttachmentModel", + "CompanyUserSubcontractorBaseModel", + "CompanyUserSubcontractorFileAttachmentListModel", + "CompanyUserSubcontractorFileAttachmentModel", + "CompanyUserSubcontractorModel", + "CompanyUserSubcontractorRoleMemberModel", + "CompanyUserSubcontractorRolesModel", + "CompanyUserSubcontractorStatus", + "CompanyUserType", + "ContractType", + "ConvertCompanyUserToAadAccountModel", + "CountryModel", + "CreateCompanyUserProfileImportMultipartData", + "CreatedModel", + "CurrencyModel", + "CustomerEventBaseModel", + "CustomerEventMeetingAddEditModel", + "CustomerEventMeetingModel", + "CustomerEventModel", + "CustomerEventNoteAddEditModel", + "CustomerEventNoteModel", + "CustomerEventTaskAddEditModel", + "CustomerEventTaskModel", + "DynamicCompanyUserResumeModel", + "DynamicTemplateViewModel", + "DynamicTemplateViewModelPrimaryScriptAssets", + "DynamicTemplateViewModelPrimaryStyleAssets", + "EducationBlockItemModel", + "EducationBlockModel", + "EmployerBlockItemModel", + "EmployerBlockModel", + "ErrorModel", + "EventCommentModel", + "EventMeetingAddEditModel", + "EventNoteAddEditModel", + "EventNoteType", + "EventStatusValue", + "EventTaskAddEditModel", + "EventTaskType", + "EventType", + "EventVisibility", + "ExtentType", + "ExtraSkillBlockModel", + "ExtraSkillItemBlockModel", + "FilterModel", + "HighlightedWorkExperienceBlockItemModel", + "HighlightedWorkExperienceBlockModel", + "ICompanyAddressViewModel", + "ICompanyCandidatePatchDocument", + "ICompanyUserEmployeePatchDocument", + "IContactInfoViewModel", + "IDynamicBlockViewModel", + "ImageBlockModel", + "ImageSize", + "ImportProfileAsyncOperation", + "ITemplateCompany", + "ITemplateImage", + "ITemplateLogotype", + "ITemplateSharedAssetViewModel", + "ITemplateStyleAssetViewModel", + "ITemplateUserInfo", + "KeywordModel", + "KeywordSynonymModel", + "KeywordType", + "LanguageBlockModel", + "LanguageItemBlockModel", + "LanguageLevel", + "Link", + "LocationBlockModel", + "LocationModel", + "LongRunningStatus", + "MentionTextModel", + "ModuleType", + "Operation", + "OperationValue", + "PartnerBaseModel", + "PartnerConnectionBaseModel", + "PartnerConnectionTrustType", + "PartnerRecipientBaseModel", + "PartnersFilterModel", + "PartnersOverviewModel", + "PdfEngineType", + "PdfOrientation", + "PresentationBlockModel", + "ProfileLanguageModel", + "ProjectAddEditModel", + "ProjectAssignmentAddModel", + "ProjectAssignmentAllocationStatus", + "ProjectAssignmentAnnouncementBaseModel", + "ProjectAssignmentAnnounceModel", + "ProjectAssignmentBaseModel", + "ProjectAssignmentEditModel", + "ProjectAssignmentExtentType", + "ProjectAssignmentFilterModel", + "ProjectAssignmentMemberAllocationStatus", + "ProjectAssignmentMemberEmployeeAddModel", + "ProjectAssignmentMemberEmployeeEditModel", + "ProjectAssignmentMemberModel", + "ProjectAssignmentMemberState", + "ProjectAssignmentMemberStateHistoryModel", + "ProjectAssignmentMemberSubcontractorAddModel", + "ProjectAssignmentMemberSubcontractorEditModel", + "ProjectAssignmentMemberType", + "ProjectAssignmentModel", + "ProjectAssignmentRequestStatus", + "ProjectAssignmentSkillAddModel", + "ProjectAssignmentSkillBaseModel", + "ProjectAssignmentSkillEditModel", + "ProjectAssignmentSkillModel", + "ProjectAssignmentStatus", + "ProjectAssignmentWithStatusModel", + "ProjectAttachmentModel", + "ProjectBaseModel", + "ProjectEventBaseModel", + "ProjectEventMeetingAddEditModel", + "ProjectEventMeetingModel", + "ProjectEventModel", + "ProjectEventNoteAddEditModel", + "ProjectEventNoteModel", + "ProjectEventTaskAddEditModel", + "ProjectEventTaskModel", + "ProjectModel", + "ProjectPipelineModel", + "ProjectPipelineStageModel", + "ProjectPriority", + "ProjectQuerySort", + "ProjectQuerySortPageAndSortByModel", + "ProjectReferenceModel", + "ProjectState", + "ProjectStateHistoryModel", + "ProjectStateReasonModel", + "RecruitmentSourceModel", + "ReferenceBlockItemModel", + "ReferenceBlockModel", + "ResumeModel", + "RoleModel", + "SearchCompanyCandidateQueryModel", + "SearchCompanyCandidateResultModel", + "SearchCompanyCustomerContactQueryModel", + "SearchCompanyCustomerContactResultModel", + "SearchCompanyCustomerQueryModel", + "SearchCompanyCustomerResultModel", + "SearchCompanyUserQueryModel", + "SearchCompanyUserResultModel", + "SearchProjectQueryModel", + "SearchProjectsResultModel", + "SearchSkillModel", + "SearchSkillQueryModel", + "SearchSkillResultModel", + "SkillBlockItemModel", + "SkillByCategoryBlockItemModel", + "SkillByCategoryBlockModel", + "SkillModelModel", + "SkillResultModel", + "SkillSearchQueryTermModel", + "SortOrder", + "Status", + "StringComparisonOperator", + "SubcontractorAttachmentMultipartData", + "TeamAddEditModel", + "TeamBaseModel", + "TeamManagerEditModel", + "TeamManagerModel", + "TeamMemberAddModel", + "TeamMemberEditModel", + "TeamMemberModel", + "TeamMemberMoveModel", + "TeamModel", + "TemplateAssetType", + "TextBlockModel", + "TopSkillBlockItemModel", + "TopSkillBlockModel", + "TrainingBlockModel", + "TrainingItemBlockModel", + "TrainingType", + "UpdatedModel", + "UserGender", + "ValidationModel", + "ValidationModelErrors", + "WebhookAddModel", + "WebhookConfigurationAddModel", + "WebhookConfigurationModel", + "WebhookCredentialsAddModel", + "WebhookCredentialsModel", + "WebhookEntityType", + "WebhookModel", + "WordEngineType", + "WorkExperienceBlockItemModel", + "WorkExperienceBlockModel", +) diff --git a/src/cinode-py-client/cinode_api_client/models/abscence_period_day_model.py b/src/cinode-py-client/cinode_api_client/models/abscence_period_day_model.py new file mode 100644 index 0000000..0ab556f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/abscence_period_day_model.py @@ -0,0 +1,53 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.calendar_day_model import CalendarDayModel + + +T = TypeVar("T", bound="AbscencePeriodDayModel") + + +@_attrs_define +class AbscencePeriodDayModel: + """ + Attributes: + calendar_day (Union[Unset, None, CalendarDayModel]): + """ + + calendar_day: Union[Unset, None, "CalendarDayModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + calendar_day: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.calendar_day, Unset): + calendar_day = self.calendar_day.to_dict() if self.calendar_day else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if calendar_day is not UNSET: + field_dict["calendarDay"] = calendar_day + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.calendar_day_model import CalendarDayModel + + d = src_dict.copy() + _calendar_day = d.pop("calendarDay", UNSET) + calendar_day: Union[Unset, None, CalendarDayModel] + if _calendar_day is None: + calendar_day = None + elif isinstance(_calendar_day, Unset): + calendar_day = UNSET + else: + calendar_day = CalendarDayModel.from_dict(_calendar_day) + + abscence_period_day_model = cls( + calendar_day=calendar_day, + ) + + return abscence_period_day_model diff --git a/src/cinode-py-client/cinode_api_client/models/absence_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/absence_add_edit_model.py new file mode 100644 index 0000000..f6c096a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/absence_add_edit_model.py @@ -0,0 +1,74 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AbsenceAddEditModel") + + +@_attrs_define +class AbsenceAddEditModel: + """ + Attributes: + start (datetime.datetime): + extent_percentage (float): + absence_type_id (int): + end (Union[Unset, None, datetime.datetime]): + """ + + start: datetime.datetime + extent_percentage: float + absence_type_id: int + end: Union[Unset, None, datetime.datetime] = UNSET + + def to_dict(self) -> Dict[str, Any]: + start = self.start.isoformat() + + extent_percentage = self.extent_percentage + absence_type_id = self.absence_type_id + end: Union[Unset, None, str] = UNSET + if not isinstance(self.end, Unset): + end = self.end.isoformat() if self.end else None + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "start": start, + "extentPercentage": extent_percentage, + "absenceTypeId": absence_type_id, + } + ) + if end is not UNSET: + field_dict["end"] = end + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + start = isoparse(d.pop("start")) + + extent_percentage = d.pop("extentPercentage") + + absence_type_id = d.pop("absenceTypeId") + + _end = d.pop("end", UNSET) + end: Union[Unset, None, datetime.datetime] + if _end is None: + end = None + elif isinstance(_end, Unset): + end = UNSET + else: + end = isoparse(_end) + + absence_add_edit_model = cls( + start=start, + extent_percentage=extent_percentage, + absence_type_id=absence_type_id, + end=end, + ) + + return absence_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/absence_period_dto_model.py b/src/cinode-py-client/cinode_api_client/models/absence_period_dto_model.py new file mode 100644 index 0000000..f2dbf56 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/absence_period_dto_model.py @@ -0,0 +1,160 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.absence_type_dto import AbsenceTypeDto + from ..models.link import Link + + +T = TypeVar("T", bound="AbsencePeriodDtoModel") + + +@_attrs_define +class AbsencePeriodDtoModel: + """ + Attributes: + id (Union[Unset, int]): + absence_type (Union[Unset, None, AbsenceTypeDto]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, datetime.datetime]): + extent_percentage (Union[Unset, int]): + company_user_id (Union[Unset, int]): + company_user_seo_id (Union[Unset, None, str]): + company_id (Union[Unset, int]): + company_seo_id (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + absence_type: Union[Unset, None, "AbsenceTypeDto"] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, datetime.datetime] = UNSET + extent_percentage: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + company_user_seo_id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, int] = UNSET + company_seo_id: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + absence_type: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.absence_type, Unset): + absence_type = self.absence_type.to_dict() if self.absence_type else None + + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() + + extent_percentage = self.extent_percentage + company_user_id = self.company_user_id + company_user_seo_id = self.company_user_seo_id + company_id = self.company_id + company_seo_id = self.company_seo_id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if absence_type is not UNSET: + field_dict["absenceType"] = absence_type + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if extent_percentage is not UNSET: + field_dict["extentPercentage"] = extent_percentage + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_user_seo_id is not UNSET: + field_dict["companyUserSeoId"] = company_user_seo_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_seo_id is not UNSET: + field_dict["companySeoId"] = company_seo_id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.absence_type_dto import AbsenceTypeDto + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + _absence_type = d.pop("absenceType", UNSET) + absence_type: Union[Unset, None, AbsenceTypeDto] + if _absence_type is None: + absence_type = None + elif isinstance(_absence_type, Unset): + absence_type = UNSET + else: + absence_type = AbsenceTypeDto.from_dict(_absence_type) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, datetime.datetime] + if isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + extent_percentage = d.pop("extentPercentage", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_user_seo_id = d.pop("companyUserSeoId", UNSET) + + company_id = d.pop("companyId", UNSET) + + company_seo_id = d.pop("companySeoId", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + absence_period_dto_model = cls( + id=id, + absence_type=absence_type, + start_date=start_date, + end_date=end_date, + extent_percentage=extent_percentage, + company_user_id=company_user_id, + company_user_seo_id=company_user_seo_id, + company_id=company_id, + company_seo_id=company_seo_id, + links=links, + ) + + return absence_period_dto_model diff --git a/src/cinode-py-client/cinode_api_client/models/absence_period_model.py b/src/cinode-py-client/cinode_api_client/models/absence_period_model.py new file mode 100644 index 0000000..fdb43de --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/absence_period_model.py @@ -0,0 +1,107 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.abscence_period_day_model import AbscencePeriodDayModel + + +T = TypeVar("T", bound="AbsencePeriodModel") + + +@_attrs_define +class AbsencePeriodModel: + """ + Attributes: + company_id (Union[Unset, int]): + company_user_id (Union[Unset, int]): + absence_type_id (Union[Unset, int]): + absence_type_name (Union[Unset, None, str]): + id (Union[Unset, int]): + days (Union[Unset, None, List['AbscencePeriodDayModel']]): + extent_percentage (Union[Unset, int]): + """ + + company_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + absence_type_id: Union[Unset, int] = UNSET + absence_type_name: Union[Unset, None, str] = UNSET + id: Union[Unset, int] = UNSET + days: Union[Unset, None, List["AbscencePeriodDayModel"]] = UNSET + extent_percentage: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + company_user_id = self.company_user_id + absence_type_id = self.absence_type_id + absence_type_name = self.absence_type_name + id = self.id + days: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.days, Unset): + if self.days is None: + days = None + else: + days = [] + for days_item_data in self.days: + days_item = days_item_data.to_dict() + + days.append(days_item) + + extent_percentage = self.extent_percentage + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if absence_type_id is not UNSET: + field_dict["absenceTypeId"] = absence_type_id + if absence_type_name is not UNSET: + field_dict["absenceTypeName"] = absence_type_name + if id is not UNSET: + field_dict["id"] = id + if days is not UNSET: + field_dict["days"] = days + if extent_percentage is not UNSET: + field_dict["extentPercentage"] = extent_percentage + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.abscence_period_day_model import AbscencePeriodDayModel + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + absence_type_id = d.pop("absenceTypeId", UNSET) + + absence_type_name = d.pop("absenceTypeName", UNSET) + + id = d.pop("id", UNSET) + + days = [] + _days = d.pop("days", UNSET) + for days_item_data in _days or []: + days_item = AbscencePeriodDayModel.from_dict(days_item_data) + + days.append(days_item) + + extent_percentage = d.pop("extentPercentage", UNSET) + + absence_period_model = cls( + company_id=company_id, + company_user_id=company_user_id, + absence_type_id=absence_type_id, + absence_type_name=absence_type_name, + id=id, + days=days, + extent_percentage=extent_percentage, + ) + + return absence_period_model diff --git a/src/cinode-py-client/cinode_api_client/models/absence_type_dto.py b/src/cinode-py-client/cinode_api_client/models/absence_type_dto.py new file mode 100644 index 0000000..0f6359c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/absence_type_dto.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AbsenceTypeDto") + + +@_attrs_define +class AbsenceTypeDto: + """ + Attributes: + id (Union[Unset, int]): + name (Union[Unset, None, str]): + """ + + id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + absence_type_dto = cls( + id=id, + name=name, + ) + + return absence_type_dto diff --git a/src/cinode-py-client/cinode_api_client/models/absence_type_model.py b/src/cinode-py-client/cinode_api_client/models/absence_type_model.py new file mode 100644 index 0000000..30472bb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/absence_type_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AbsenceTypeModel") + + +@_attrs_define +class AbsenceTypeModel: + """ + Attributes: + id (Union[Unset, int]): + name (Union[Unset, None, str]): + """ + + id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + absence_type_model = cls( + id=id, + name=name, + ) + + return absence_type_model diff --git a/src/cinode-py-client/cinode_api_client/models/access_level.py b/src/cinode-py-client/cinode_api_client/models/access_level.py new file mode 100644 index 0000000..c5144b8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/access_level.py @@ -0,0 +1,21 @@ +from enum import IntEnum + + +class AccessLevel(IntEnum): + VALUE_0 = 0 + VALUE_50 = 50 + VALUE_100 = 100 + VALUE_110 = 110 + VALUE_115 = 115 + VALUE_150 = 150 + VALUE_180 = 180 + VALUE_200 = 200 + VALUE_240 = 240 + VALUE_250 = 250 + VALUE_270 = 270 + VALUE_300 = 300 + VALUE_400 = 400 + VALUE_500 = 500 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/action_type.py b/src/cinode-py-client/cinode_api_client/models/action_type.py new file mode 100644 index 0000000..54a5cfa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/action_type.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class ActionType(IntEnum): + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/add_company_image_multipart_data.py b/src/cinode-py-client/cinode_api_client/models/add_company_image_multipart_data.py new file mode 100644 index 0000000..08b95a8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/add_company_image_multipart_data.py @@ -0,0 +1,93 @@ +from io import BytesIO +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, File, Unset + +T = TypeVar("T", bound="AddCompanyImageMultipartData") + + +@_attrs_define +class AddCompanyImageMultipartData: + """ + Attributes: + file (File): + set_as_primary (Union[Unset, bool]): + """ + + file: File + set_as_primary: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + file = self.file.to_tuple() + + set_as_primary = self.set_as_primary + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "File": file, + } + ) + if set_as_primary is not UNSET: + field_dict["SetAsPrimary"] = set_as_primary + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + file = self.file.to_tuple() + + set_as_primary = ( + self.set_as_primary + if isinstance(self.set_as_primary, Unset) + else (None, str(self.set_as_primary).encode(), "text/plain") + ) + + field_dict: Dict[str, Any] = {} + field_dict.update( + {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} + ) + field_dict.update( + { + "File": file, + } + ) + if set_as_primary is not UNSET: + field_dict["SetAsPrimary"] = set_as_primary + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + file = File(payload=BytesIO(d.pop("File"))) + + set_as_primary = d.pop("SetAsPrimary", UNSET) + + add_company_image_multipart_data = cls( + file=file, + set_as_primary=set_as_primary, + ) + + add_company_image_multipart_data.additional_properties = d + return add_company_image_multipart_data + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/add_company_subcontractor_group_member_model.py b/src/cinode-py-client/cinode_api_client/models/add_company_subcontractor_group_member_model.py new file mode 100644 index 0000000..60fb808 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/add_company_subcontractor_group_member_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AddCompanySubcontractorGroupMemberModel") + + +@_attrs_define +class AddCompanySubcontractorGroupMemberModel: + """ + Attributes: + company_user_subcontractor_id (int): + """ + + company_user_subcontractor_id: int + + def to_dict(self) -> Dict[str, Any]: + company_user_subcontractor_id = self.company_user_subcontractor_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "companyUserSubcontractorId": company_user_subcontractor_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_subcontractor_id = d.pop("companyUserSubcontractorId") + + add_company_subcontractor_group_member_model = cls( + company_user_subcontractor_id=company_user_subcontractor_id, + ) + + return add_company_subcontractor_group_member_model diff --git a/src/cinode-py-client/cinode_api_client/models/address_info_block_view_model.py b/src/cinode-py-client/cinode_api_client/models/address_info_block_view_model.py new file mode 100644 index 0000000..b1904cc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/address_info_block_view_model.py @@ -0,0 +1,86 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AddressInfoBlockViewModel") + + +@_attrs_define +class AddressInfoBlockViewModel: + """ + Attributes: + display_name (Union[Unset, None, str]): + street1 (Union[Unset, None, str]): + street2 (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + country (Union[Unset, None, str]): + email (Union[Unset, None, str]): + """ + + display_name: Union[Unset, None, str] = UNSET + street1: Union[Unset, None, str] = UNSET + street2: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + display_name = self.display_name + street1 = self.street1 + street2 = self.street2 + zip_code = self.zip_code + city = self.city + country = self.country + email = self.email + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if display_name is not UNSET: + field_dict["displayName"] = display_name + if street1 is not UNSET: + field_dict["street1"] = street1 + if street2 is not UNSET: + field_dict["street2"] = street2 + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if email is not UNSET: + field_dict["email"] = email + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + display_name = d.pop("displayName", UNSET) + + street1 = d.pop("street1", UNSET) + + street2 = d.pop("street2", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + email = d.pop("email", UNSET) + + address_info_block_view_model = cls( + display_name=display_name, + street1=street1, + street2=street2, + zip_code=zip_code, + city=city, + country=country, + email=email, + ) + + return address_info_block_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/address_type.py b/src/cinode-py-client/cinode_api_client/models/address_type.py new file mode 100644 index 0000000..bfc75db --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/address_type.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class AddressType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/attachment_type.py b/src/cinode-py-client/cinode_api_client/models/attachment_type.py new file mode 100644 index 0000000..d421eb2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/attachment_type.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class AttachmentType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/availability_filter_model.py b/src/cinode-py-client/cinode_api_client/models/availability_filter_model.py new file mode 100644 index 0000000..c2015a7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/availability_filter_model.py @@ -0,0 +1,59 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AvailabilityFilterModel") + + +@_attrs_define +class AvailabilityFilterModel: + """ + Attributes: + start_date (datetime.datetime): + end_date (datetime.datetime): + company_user_id (Union[Unset, None, int]): + """ + + start_date: datetime.datetime + end_date: datetime.datetime + company_user_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + start_date = self.start_date.isoformat() + + end_date = self.end_date.isoformat() + + company_user_id = self.company_user_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "startDate": start_date, + "endDate": end_date, + } + ) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + start_date = isoparse(d.pop("startDate")) + + end_date = isoparse(d.pop("endDate")) + + company_user_id = d.pop("companyUserId", UNSET) + + availability_filter_model = cls( + start_date=start_date, + end_date=end_date, + company_user_id=company_user_id, + ) + + return availability_filter_model diff --git a/src/cinode-py-client/cinode_api_client/models/availability_model.py b/src/cinode-py-client/cinode_api_client/models/availability_model.py new file mode 100644 index 0000000..ed79fd7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/availability_model.py @@ -0,0 +1,79 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AvailabilityModel") + + +@_attrs_define +class AvailabilityModel: + """ + Attributes: + company_user_id (Union[Unset, int]): + availability (Union[Unset, float]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, datetime.datetime]): + """ + + company_user_id: Union[Unset, int] = UNSET + availability: Union[Unset, float] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, datetime.datetime] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + availability = self.availability + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if availability is not UNSET: + field_dict["availability"] = availability + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + availability = d.pop("availability", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, datetime.datetime] + if isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + availability_model = cls( + company_user_id=company_user_id, + availability=availability, + start_date=start_date, + end_date=end_date, + ) + + return availability_model diff --git a/src/cinode-py-client/cinode_api_client/models/calendar_day_model.py b/src/cinode-py-client/cinode_api_client/models/calendar_day_model.py new file mode 100644 index 0000000..7a67e0a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/calendar_day_model.py @@ -0,0 +1,104 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CalendarDayModel") + + +@_attrs_define +class CalendarDayModel: + """ + Attributes: + date (Union[Unset, datetime.datetime]): + year (Union[Unset, int]): + month (Union[Unset, int]): + day (Union[Unset, int]): + weekday (Union[Unset, int]): + week (Union[Unset, int]): + quarter (Union[Unset, int]): + day_of_year (Union[Unset, int]): + """ + + date: Union[Unset, datetime.datetime] = UNSET + year: Union[Unset, int] = UNSET + month: Union[Unset, int] = UNSET + day: Union[Unset, int] = UNSET + weekday: Union[Unset, int] = UNSET + week: Union[Unset, int] = UNSET + quarter: Union[Unset, int] = UNSET + day_of_year: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + date: Union[Unset, str] = UNSET + if not isinstance(self.date, Unset): + date = self.date.isoformat() + + year = self.year + month = self.month + day = self.day + weekday = self.weekday + week = self.week + quarter = self.quarter + day_of_year = self.day_of_year + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if date is not UNSET: + field_dict["date"] = date + if year is not UNSET: + field_dict["year"] = year + if month is not UNSET: + field_dict["month"] = month + if day is not UNSET: + field_dict["day"] = day + if weekday is not UNSET: + field_dict["weekday"] = weekday + if week is not UNSET: + field_dict["week"] = week + if quarter is not UNSET: + field_dict["quarter"] = quarter + if day_of_year is not UNSET: + field_dict["dayOfYear"] = day_of_year + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _date = d.pop("date", UNSET) + date: Union[Unset, datetime.datetime] + if isinstance(_date, Unset): + date = UNSET + else: + date = isoparse(_date) + + year = d.pop("year", UNSET) + + month = d.pop("month", UNSET) + + day = d.pop("day", UNSET) + + weekday = d.pop("weekday", UNSET) + + week = d.pop("week", UNSET) + + quarter = d.pop("quarter", UNSET) + + day_of_year = d.pop("dayOfYear", UNSET) + + calendar_day_model = cls( + date=date, + year=year, + month=month, + day=day, + weekday=weekday, + week=week, + quarter=quarter, + day_of_year=day_of_year, + ) + + return calendar_day_model diff --git a/src/cinode-py-client/cinode_api_client/models/candidate_attachment_multipart_data.py b/src/cinode-py-client/cinode_api_client/models/candidate_attachment_multipart_data.py new file mode 100644 index 0000000..4b3af38 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/candidate_attachment_multipart_data.py @@ -0,0 +1,117 @@ +import json +from io import BytesIO +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, File, Unset + +T = TypeVar("T", bound="CandidateAttachmentMultipartData") + + +@_attrs_define +class CandidateAttachmentMultipartData: + """ + Attributes: + files (List[File]): + title (str): + description (Union[Unset, str]): + """ + + files: List[File] + title: str + description: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + files = [] + for files_item_data in self.files: + files_item = files_item_data.to_tuple() + + files.append(files_item) + + title = self.title + description = self.description + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "Files": files, + "Title": title, + } + ) + if description is not UNSET: + field_dict["Description"] = description + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + _temp_files = [] + for files_item_data in self.files: + files_item = files_item_data.to_tuple() + + _temp_files.append(files_item) + files = (None, json.dumps(_temp_files).encode(), "application/json") + + title = self.title if isinstance(self.title, Unset) else (None, str(self.title).encode(), "text/plain") + description = ( + self.description + if isinstance(self.description, Unset) + else (None, str(self.description).encode(), "text/plain") + ) + + field_dict: Dict[str, Any] = {} + field_dict.update( + {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} + ) + field_dict.update( + { + "Files": files, + "Title": title, + } + ) + if description is not UNSET: + field_dict["Description"] = description + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + files = [] + _files = d.pop("Files") + for files_item_data in _files: + files_item = File(payload=BytesIO(files_item_data)) + + files.append(files_item) + + title = d.pop("Title") + + description = d.pop("Description", UNSET) + + candidate_attachment_multipart_data = cls( + files=files, + title=title, + description=description, + ) + + candidate_attachment_multipart_data.additional_properties = d + return candidate_attachment_multipart_data + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/classic_company_user_resume_model.py b/src/cinode-py-client/cinode_api_client/models/classic_company_user_resume_model.py new file mode 100644 index 0000000..b66a49b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/classic_company_user_resume_model.py @@ -0,0 +1,246 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_resume_template_base_model import CompanyResumeTemplateBaseModel + from ..models.company_resume_template_language_model import CompanyResumeTemplateLanguageModel + from ..models.created_model import CreatedModel + from ..models.link import Link + from ..models.resume_model import ResumeModel + from ..models.updated_model import UpdatedModel + + +T = TypeVar("T", bound="ClassicCompanyUserResumeModel") + + +@_attrs_define +class ClassicCompanyUserResumeModel: + """ + Attributes: + image_id (Union[Unset, None, int]): + parent_profile_id (Union[Unset, int]): + profile_translation_id (Union[Unset, int]): + parent_company_user_resume_id (Union[Unset, None, int]): + resume (Union[Unset, None, ResumeModel]): + id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + created (Union[Unset, None, CreatedModel]): + updated (Union[Unset, None, UpdatedModel]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + slug (Union[Unset, None, str]): + language (Union[Unset, None, CompanyResumeTemplateLanguageModel]): + template (Union[Unset, None, CompanyResumeTemplateBaseModel]): + is_public (Union[Unset, bool]): + links (Union[Unset, None, List['Link']]): + """ + + image_id: Union[Unset, None, int] = UNSET + parent_profile_id: Union[Unset, int] = UNSET + profile_translation_id: Union[Unset, int] = UNSET + parent_company_user_resume_id: Union[Unset, None, int] = UNSET + resume: Union[Unset, None, "ResumeModel"] = UNSET + id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + created: Union[Unset, None, "CreatedModel"] = UNSET + updated: Union[Unset, None, "UpdatedModel"] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + slug: Union[Unset, None, str] = UNSET + language: Union[Unset, None, "CompanyResumeTemplateLanguageModel"] = UNSET + template: Union[Unset, None, "CompanyResumeTemplateBaseModel"] = UNSET + is_public: Union[Unset, bool] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + image_id = self.image_id + parent_profile_id = self.parent_profile_id + profile_translation_id = self.profile_translation_id + parent_company_user_resume_id = self.parent_company_user_resume_id + resume: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.resume, Unset): + resume = self.resume.to_dict() if self.resume else None + + id = self.id + company_user_id = self.company_user_id + company_id = self.company_id + created: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.created, Unset): + created = self.created.to_dict() if self.created else None + + updated: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.to_dict() if self.updated else None + + title = self.title + description = self.description + slug = self.slug + language: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language, Unset): + language = self.language.to_dict() if self.language else None + + template: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.template, Unset): + template = self.template.to_dict() if self.template else None + + is_public = self.is_public + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if image_id is not UNSET: + field_dict["imageId"] = image_id + if parent_profile_id is not UNSET: + field_dict["parentProfileId"] = parent_profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if parent_company_user_resume_id is not UNSET: + field_dict["parentCompanyUserResumeId"] = parent_company_user_resume_id + if resume is not UNSET: + field_dict["resume"] = resume + if id is not UNSET: + field_dict["id"] = id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if slug is not UNSET: + field_dict["slug"] = slug + if language is not UNSET: + field_dict["language"] = language + if template is not UNSET: + field_dict["template"] = template + if is_public is not UNSET: + field_dict["isPublic"] = is_public + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_resume_template_base_model import CompanyResumeTemplateBaseModel + from ..models.company_resume_template_language_model import CompanyResumeTemplateLanguageModel + from ..models.created_model import CreatedModel + from ..models.link import Link + from ..models.resume_model import ResumeModel + from ..models.updated_model import UpdatedModel + + d = src_dict.copy() + image_id = d.pop("imageId", UNSET) + + parent_profile_id = d.pop("parentProfileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + parent_company_user_resume_id = d.pop("parentCompanyUserResumeId", UNSET) + + _resume = d.pop("resume", UNSET) + resume: Union[Unset, None, ResumeModel] + if _resume is None: + resume = None + elif isinstance(_resume, Unset): + resume = UNSET + else: + resume = ResumeModel.from_dict(_resume) + + id = d.pop("id", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, None, CreatedModel] + if _created is None: + created = None + elif isinstance(_created, Unset): + created = UNSET + else: + created = CreatedModel.from_dict(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, UpdatedModel] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = UpdatedModel.from_dict(_updated) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + slug = d.pop("slug", UNSET) + + _language = d.pop("language", UNSET) + language: Union[Unset, None, CompanyResumeTemplateLanguageModel] + if _language is None: + language = None + elif isinstance(_language, Unset): + language = UNSET + else: + language = CompanyResumeTemplateLanguageModel.from_dict(_language) + + _template = d.pop("template", UNSET) + template: Union[Unset, None, CompanyResumeTemplateBaseModel] + if _template is None: + template = None + elif isinstance(_template, Unset): + template = UNSET + else: + template = CompanyResumeTemplateBaseModel.from_dict(_template) + + is_public = d.pop("isPublic", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + classic_company_user_resume_model = cls( + image_id=image_id, + parent_profile_id=parent_profile_id, + profile_translation_id=profile_translation_id, + parent_company_user_resume_id=parent_company_user_resume_id, + resume=resume, + id=id, + company_user_id=company_user_id, + company_id=company_id, + created=created, + updated=updated, + title=title, + description=description, + slug=slug, + language=language, + template=template, + is_public=is_public, + links=links, + ) + + return classic_company_user_resume_model diff --git a/src/cinode-py-client/cinode_api_client/models/commitment_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/commitment_block_item_model.py new file mode 100644 index 0000000..cada811 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/commitment_block_item_model.py @@ -0,0 +1,166 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CommitmentBlockItemModel") + + +@_attrs_define +class CommitmentBlockItemModel: + """ + Attributes: + url (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + url: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + url = self.url + title = self.title + description = self.description + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if url is not UNSET: + field_dict["url"] = url + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + url = d.pop("url", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + commitment_block_item_model = cls( + url=url, + title=title, + description=description, + start_date=start_date, + end_date=end_date, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return commitment_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/commitment_block_model.py b/src/cinode-py-client/cinode_api_client/models/commitment_block_model.py new file mode 100644 index 0000000..5e24915 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/commitment_block_model.py @@ -0,0 +1,135 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.commitment_block_item_model import CommitmentBlockItemModel + + +T = TypeVar("T", bound="CommitmentBlockModel") + + +@_attrs_define +class CommitmentBlockModel: + """ + Attributes: + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + hide_url (Union[Unset, bool]): + data (Union[Unset, None, List['CommitmentBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + hide_url: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["CommitmentBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + hide_url = self.hide_url + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if hide_url is not UNSET: + field_dict["hideUrl"] = hide_url + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.commitment_block_item_model import CommitmentBlockItemModel + + d = src_dict.copy() + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + hide_url = d.pop("hideUrl", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = CommitmentBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + commitment_block_model = cls( + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + hide_url=hide_url, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return commitment_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_address_model.py b/src/cinode-py-client/cinode_api_client/models/company_address_model.py new file mode 100644 index 0000000..8747f66 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_address_model.py @@ -0,0 +1,155 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.address_type import AddressType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyAddressModel") + + +@_attrs_define +class CompanyAddressModel: + """ + Attributes: + company_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + street1 (Union[Unset, None, str]): + street2 (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + country (Union[Unset, None, str]): + email (Union[Unset, None, str]): + address_type (Union[Unset, AddressType]): + + Övrig = 0 + + Besöksadress = 1 + + Faktureringsadress = 2 + + Placeringsort = 3 + comments (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + street1: Union[Unset, None, str] = UNSET + street2: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + address_type: Union[Unset, AddressType] = UNSET + comments: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + id = self.id + street1 = self.street1 + street2 = self.street2 + zip_code = self.zip_code + city = self.city + country = self.country + email = self.email + address_type: Union[Unset, int] = UNSET + if not isinstance(self.address_type, Unset): + address_type = self.address_type.value + + comments = self.comments + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if street1 is not UNSET: + field_dict["street1"] = street1 + if street2 is not UNSET: + field_dict["street2"] = street2 + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if email is not UNSET: + field_dict["email"] = email + if address_type is not UNSET: + field_dict["addressType"] = address_type + if comments is not UNSET: + field_dict["comments"] = comments + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + street1 = d.pop("street1", UNSET) + + street2 = d.pop("street2", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + email = d.pop("email", UNSET) + + _address_type = d.pop("addressType", UNSET) + address_type: Union[Unset, AddressType] + if isinstance(_address_type, Unset): + address_type = UNSET + else: + address_type = AddressType(_address_type) + + comments = d.pop("comments", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_address_model = cls( + company_id=company_id, + id=id, + street1=street1, + street2=street2, + zip_code=zip_code, + city=city, + country=country, + email=email, + address_type=address_type, + comments=comments, + links=links, + ) + + return company_address_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_base_model.py new file mode 100644 index 0000000..96d9668 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_base_model.py @@ -0,0 +1,90 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyBaseModel") + + +@_attrs_define +class CompanyBaseModel: + """ + Attributes: + id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + name = self.name + seo_id = self.seo_id + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + seo_id = d.pop("seoId", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_base_model = cls( + id=id, + name=name, + seo_id=seo_id, + description=description, + links=links, + ) + + return company_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_add_invite_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_add_invite_model.py new file mode 100644 index 0000000..1fc4e5a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_add_invite_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCandidateAddInviteModel") + + +@_attrs_define +class CompanyCandidateAddInviteModel: + """ + Attributes: + email (Union[Unset, None, str]): + message (Union[Unset, None, str]): + """ + + email: Union[Unset, None, str] = UNSET + message: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + email = self.email + message = self.message + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if email is not UNSET: + field_dict["email"] = email + if message is not UNSET: + field_dict["message"] = message + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + email = d.pop("email", UNSET) + + message = d.pop("message", UNSET) + + company_candidate_add_invite_model = cls( + email=email, + message=message, + ) + + return company_candidate_add_invite_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_add_model.py new file mode 100644 index 0000000..852a725 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_add_model.py @@ -0,0 +1,277 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_candidate_state import CompanyCandidateState +from ..models.user_gender import UserGender +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCandidateAddModel") + + +@_attrs_define +class CompanyCandidateAddModel: + """ + Attributes: + first_name (str): + last_name (str): + state (CompanyCandidateState): + + Öppen = 0 + + Vunnen = 10 + + Pausad = 20 + + Avböjd av kandidat = 30 + + Avböjd av oss = 40 + gender (Union[Unset, UserGender]): + + Ej angiven = 0 + + Man = 1 + + Kvinna = 2 + birth_year (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + email (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + linked_in_url (Union[Unset, None, str]): + rating (Union[Unset, None, int]): + available_from_date (Union[Unset, None, datetime.datetime]): + period_of_notice_days (Union[Unset, None, int]): + salary_requirement (Union[Unset, None, int]): + is_mobile (Union[Unset, bool]): + recruitment_manager_id (Union[Unset, None, int]): + pipeline_id (Union[Unset, None, int]): + pipeline_stage_id (Union[Unset, None, int]): + team_id (Union[Unset, None, int]): + company_address_id (Union[Unset, None, int]): + recruitment_source_id (Union[Unset, None, int]): + current_employer (Union[Unset, None, str]): + campaign_code (Union[Unset, None, str]): + currency_id (Union[Unset, None, int]): + offered_salary (Union[Unset, None, int]): + notify_recruitment_manager (Union[Unset, bool]): + """ + + first_name: str + last_name: str + state: CompanyCandidateState + gender: Union[Unset, UserGender] = UNSET + birth_year: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + linked_in_url: Union[Unset, None, str] = UNSET + rating: Union[Unset, None, int] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + period_of_notice_days: Union[Unset, None, int] = UNSET + salary_requirement: Union[Unset, None, int] = UNSET + is_mobile: Union[Unset, bool] = UNSET + recruitment_manager_id: Union[Unset, None, int] = UNSET + pipeline_id: Union[Unset, None, int] = UNSET + pipeline_stage_id: Union[Unset, None, int] = UNSET + team_id: Union[Unset, None, int] = UNSET + company_address_id: Union[Unset, None, int] = UNSET + recruitment_source_id: Union[Unset, None, int] = UNSET + current_employer: Union[Unset, None, str] = UNSET + campaign_code: Union[Unset, None, str] = UNSET + currency_id: Union[Unset, None, int] = UNSET + offered_salary: Union[Unset, None, int] = UNSET + notify_recruitment_manager: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + first_name = self.first_name + last_name = self.last_name + state = self.state.value + + gender: Union[Unset, int] = UNSET + if not isinstance(self.gender, Unset): + gender = self.gender.value + + birth_year = self.birth_year + title = self.title + description = self.description + email = self.email + phone = self.phone + linked_in_url = self.linked_in_url + rating = self.rating + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + period_of_notice_days = self.period_of_notice_days + salary_requirement = self.salary_requirement + is_mobile = self.is_mobile + recruitment_manager_id = self.recruitment_manager_id + pipeline_id = self.pipeline_id + pipeline_stage_id = self.pipeline_stage_id + team_id = self.team_id + company_address_id = self.company_address_id + recruitment_source_id = self.recruitment_source_id + current_employer = self.current_employer + campaign_code = self.campaign_code + currency_id = self.currency_id + offered_salary = self.offered_salary + notify_recruitment_manager = self.notify_recruitment_manager + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "firstName": first_name, + "lastName": last_name, + "state": state, + } + ) + if gender is not UNSET: + field_dict["gender"] = gender + if birth_year is not UNSET: + field_dict["birthYear"] = birth_year + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if email is not UNSET: + field_dict["email"] = email + if phone is not UNSET: + field_dict["phone"] = phone + if linked_in_url is not UNSET: + field_dict["linkedInUrl"] = linked_in_url + if rating is not UNSET: + field_dict["rating"] = rating + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if period_of_notice_days is not UNSET: + field_dict["periodOfNoticeDays"] = period_of_notice_days + if salary_requirement is not UNSET: + field_dict["salaryRequirement"] = salary_requirement + if is_mobile is not UNSET: + field_dict["isMobile"] = is_mobile + if recruitment_manager_id is not UNSET: + field_dict["recruitmentManagerId"] = recruitment_manager_id + if pipeline_id is not UNSET: + field_dict["pipelineId"] = pipeline_id + if pipeline_stage_id is not UNSET: + field_dict["pipelineStageId"] = pipeline_stage_id + if team_id is not UNSET: + field_dict["teamId"] = team_id + if company_address_id is not UNSET: + field_dict["companyAddressId"] = company_address_id + if recruitment_source_id is not UNSET: + field_dict["recruitmentSourceId"] = recruitment_source_id + if current_employer is not UNSET: + field_dict["currentEmployer"] = current_employer + if campaign_code is not UNSET: + field_dict["campaignCode"] = campaign_code + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if offered_salary is not UNSET: + field_dict["offeredSalary"] = offered_salary + if notify_recruitment_manager is not UNSET: + field_dict["notifyRecruitmentManager"] = notify_recruitment_manager + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + first_name = d.pop("firstName") + + last_name = d.pop("lastName") + + state = CompanyCandidateState(d.pop("state")) + + _gender = d.pop("gender", UNSET) + gender: Union[Unset, UserGender] + if isinstance(_gender, Unset): + gender = UNSET + else: + gender = UserGender(_gender) + + birth_year = d.pop("birthYear", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + email = d.pop("email", UNSET) + + phone = d.pop("phone", UNSET) + + linked_in_url = d.pop("linkedInUrl", UNSET) + + rating = d.pop("rating", UNSET) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + period_of_notice_days = d.pop("periodOfNoticeDays", UNSET) + + salary_requirement = d.pop("salaryRequirement", UNSET) + + is_mobile = d.pop("isMobile", UNSET) + + recruitment_manager_id = d.pop("recruitmentManagerId", UNSET) + + pipeline_id = d.pop("pipelineId", UNSET) + + pipeline_stage_id = d.pop("pipelineStageId", UNSET) + + team_id = d.pop("teamId", UNSET) + + company_address_id = d.pop("companyAddressId", UNSET) + + recruitment_source_id = d.pop("recruitmentSourceId", UNSET) + + current_employer = d.pop("currentEmployer", UNSET) + + campaign_code = d.pop("campaignCode", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + offered_salary = d.pop("offeredSalary", UNSET) + + notify_recruitment_manager = d.pop("notifyRecruitmentManager", UNSET) + + company_candidate_add_model = cls( + first_name=first_name, + last_name=last_name, + state=state, + gender=gender, + birth_year=birth_year, + title=title, + description=description, + email=email, + phone=phone, + linked_in_url=linked_in_url, + rating=rating, + available_from_date=available_from_date, + period_of_notice_days=period_of_notice_days, + salary_requirement=salary_requirement, + is_mobile=is_mobile, + recruitment_manager_id=recruitment_manager_id, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + team_id=team_id, + company_address_id=company_address_id, + recruitment_source_id=recruitment_source_id, + current_employer=current_employer, + campaign_code=campaign_code, + currency_id=currency_id, + offered_salary=offered_salary, + notify_recruitment_manager=notify_recruitment_manager, + ) + + return company_candidate_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_attachment_model.py new file mode 100644 index 0000000..6211710 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_attachment_model.py @@ -0,0 +1,119 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateAttachmentModel") + + +@_attrs_define +class CompanyCandidateAttachmentModel: + """ + Attributes: + id (Union[Unset, str]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, int]): + company_candidate_id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, str] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, int] = UNSET + company_candidate_id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + company_candidate_id = self.company_candidate_id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + company_candidate_id = d.pop("companyCandidateId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_attachment_model = cls( + id=id, + attachment_type=attachment_type, + company_id=company_id, + company_candidate_id=company_candidate_id, + title=title, + description=description, + links=links, + ) + + return company_candidate_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_base_model.py new file mode 100644 index 0000000..65a9a27 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_base_model.py @@ -0,0 +1,168 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateBaseModel") + + +@_attrs_define +class CompanyCandidateBaseModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + seo_id (Union[Unset, None, str]): + firstname (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + lastname (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + created_date_time (Union[Unset, datetime.datetime]): + last_touch_date_time (Union[Unset, None, datetime.datetime]): + updated_date_time (Union[Unset, None, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + firstname: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + lastname: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + created_date_time: Union[Unset, datetime.datetime] = UNSET + last_touch_date_time: Union[Unset, None, datetime.datetime] = UNSET + updated_date_time: Union[Unset, None, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + seo_id = self.seo_id + firstname = self.firstname + first_name = self.first_name + lastname = self.lastname + last_name = self.last_name + created_date_time: Union[Unset, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() + + last_touch_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.last_touch_date_time, Unset): + last_touch_date_time = self.last_touch_date_time.isoformat() if self.last_touch_date_time else None + + updated_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_date_time, Unset): + updated_date_time = self.updated_date_time.isoformat() if self.updated_date_time else None + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if firstname is not UNSET: + field_dict["firstname"] = firstname + if first_name is not UNSET: + field_dict["firstName"] = first_name + if lastname is not UNSET: + field_dict["lastname"] = lastname + if last_name is not UNSET: + field_dict["lastName"] = last_name + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if last_touch_date_time is not UNSET: + field_dict["lastTouchDateTime"] = last_touch_date_time + if updated_date_time is not UNSET: + field_dict["updatedDateTime"] = updated_date_time + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + firstname = d.pop("firstname", UNSET) + + first_name = d.pop("firstName", UNSET) + + lastname = d.pop("lastname", UNSET) + + last_name = d.pop("lastName", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, datetime.datetime] + if isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _last_touch_date_time = d.pop("lastTouchDateTime", UNSET) + last_touch_date_time: Union[Unset, None, datetime.datetime] + if _last_touch_date_time is None: + last_touch_date_time = None + elif isinstance(_last_touch_date_time, Unset): + last_touch_date_time = UNSET + else: + last_touch_date_time = isoparse(_last_touch_date_time) + + _updated_date_time = d.pop("updatedDateTime", UNSET) + updated_date_time: Union[Unset, None, datetime.datetime] + if _updated_date_time is None: + updated_date_time = None + elif isinstance(_updated_date_time, Unset): + updated_date_time = UNSET + else: + updated_date_time = isoparse(_updated_date_time) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_base_model = cls( + id=id, + company_id=company_id, + seo_id=seo_id, + firstname=firstname, + first_name=first_name, + lastname=lastname, + last_name=last_name, + created_date_time=created_date_time, + last_touch_date_time=last_touch_date_time, + updated_date_time=updated_date_time, + links=links, + ) + + return company_candidate_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_event_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_base_model.py new file mode 100644 index 0000000..43b3e94 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_base_model.py @@ -0,0 +1,141 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateEventBaseModel") + + +@_attrs_define +class CompanyCandidateEventBaseModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_event_base_model = cls( + company_candidate_id=company_candidate_id, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_candidate_event_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_event_meeting_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_meeting_model.py new file mode 100644 index 0000000..9e7c2d1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_meeting_model.py @@ -0,0 +1,312 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateEventMeetingModel") + + +@_attrs_define +class CompanyCandidateEventMeetingModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + location (Union[Unset, None, str]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + location: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + location = self.location + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if location is not UNSET: + field_dict["location"] = location + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + location = d.pop("location", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_event_meeting_model = cls( + company_candidate_id=company_candidate_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + location=location, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_candidate_event_meeting_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_event_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_model.py new file mode 100644 index 0000000..d5da1a8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_model.py @@ -0,0 +1,237 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateEventModel") + + +@_attrs_define +class CompanyCandidateEventModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_event_model = cls( + company_candidate_id=company_candidate_id, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_candidate_event_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_event_note_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_note_model.py new file mode 100644 index 0000000..7a922f0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_note_model.py @@ -0,0 +1,280 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateEventNoteModel") + + +@_attrs_define +class CompanyCandidateEventNoteModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_event_note_model = cls( + company_candidate_id=company_candidate_id, + note_type=note_type, + note_date=note_date, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_candidate_event_note_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_event_task_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_task_model.py new file mode 100644 index 0000000..3322ae6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_event_task_model.py @@ -0,0 +1,323 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateEventTaskModel") + + +@_attrs_define +class CompanyCandidateEventTaskModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_event_task_model = cls( + company_candidate_id=company_candidate_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_candidate_event_task_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_extended_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_extended_model.py new file mode 100644 index 0000000..9bb579c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_extended_model.py @@ -0,0 +1,419 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_candidate_state import CompanyCandidateState +from ..models.user_gender import UserGender +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_candidate_attachment_model import CompanyCandidateAttachmentModel + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateExtendedModel") + + +@_attrs_define +class CompanyCandidateExtendedModel: + """ + Attributes: + rating (Union[Unset, None, int]): + available_from_date (Union[Unset, None, datetime.datetime]): + period_of_notice_days (Union[Unset, None, int]): + salary_requirement (Union[Unset, None, int]): + offered_salary (Union[Unset, None, int]): + state (Union[Unset, None, CompanyCandidateState]): + + Öppen = 0 + + Vunnen = 10 + + Pausad = 20 + + Avböjd av kandidat = 30 + + Avböjd av oss = 40 + currency_id (Union[Unset, None, int]): + is_mobile (Union[Unset, bool]): + pipeline_id (Union[Unset, None, int]): + pipeline_stage_id (Union[Unset, None, int]): + recruitment_manager_id (Union[Unset, None, int]): + campaign_code (Union[Unset, None, str]): + gender (Union[Unset, UserGender]): + + Ej angiven = 0 + + Man = 1 + + Kvinna = 2 + birth_year (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + email (Union[Unset, None, str]): + linked_in_url (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + attachments (Union[Unset, None, List['CompanyCandidateAttachmentModel']]): + recruitment_manager (Union[Unset, None, CompanyUserBaseModel]): + current_employer (Union[Unset, None, str]): + id (Union[Unset, int]): + company_id (Union[Unset, int]): + seo_id (Union[Unset, None, str]): + firstname (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + lastname (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + created_date_time (Union[Unset, datetime.datetime]): + last_touch_date_time (Union[Unset, None, datetime.datetime]): + updated_date_time (Union[Unset, None, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + rating: Union[Unset, None, int] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + period_of_notice_days: Union[Unset, None, int] = UNSET + salary_requirement: Union[Unset, None, int] = UNSET + offered_salary: Union[Unset, None, int] = UNSET + state: Union[Unset, None, CompanyCandidateState] = UNSET + currency_id: Union[Unset, None, int] = UNSET + is_mobile: Union[Unset, bool] = UNSET + pipeline_id: Union[Unset, None, int] = UNSET + pipeline_stage_id: Union[Unset, None, int] = UNSET + recruitment_manager_id: Union[Unset, None, int] = UNSET + campaign_code: Union[Unset, None, str] = UNSET + gender: Union[Unset, UserGender] = UNSET + birth_year: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + linked_in_url: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + attachments: Union[Unset, None, List["CompanyCandidateAttachmentModel"]] = UNSET + recruitment_manager: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + current_employer: Union[Unset, None, str] = UNSET + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + firstname: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + lastname: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + created_date_time: Union[Unset, datetime.datetime] = UNSET + last_touch_date_time: Union[Unset, None, datetime.datetime] = UNSET + updated_date_time: Union[Unset, None, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + rating = self.rating + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + period_of_notice_days = self.period_of_notice_days + salary_requirement = self.salary_requirement + offered_salary = self.offered_salary + state: Union[Unset, None, int] = UNSET + if not isinstance(self.state, Unset): + state = self.state.value if self.state else None + + currency_id = self.currency_id + is_mobile = self.is_mobile + pipeline_id = self.pipeline_id + pipeline_stage_id = self.pipeline_stage_id + recruitment_manager_id = self.recruitment_manager_id + campaign_code = self.campaign_code + gender: Union[Unset, int] = UNSET + if not isinstance(self.gender, Unset): + gender = self.gender.value + + birth_year = self.birth_year + title = self.title + description = self.description + email = self.email + linked_in_url = self.linked_in_url + phone = self.phone + attachments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.attachments, Unset): + if self.attachments is None: + attachments = None + else: + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + + attachments.append(attachments_item) + + recruitment_manager: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.recruitment_manager, Unset): + recruitment_manager = self.recruitment_manager.to_dict() if self.recruitment_manager else None + + current_employer = self.current_employer + id = self.id + company_id = self.company_id + seo_id = self.seo_id + firstname = self.firstname + first_name = self.first_name + lastname = self.lastname + last_name = self.last_name + created_date_time: Union[Unset, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() + + last_touch_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.last_touch_date_time, Unset): + last_touch_date_time = self.last_touch_date_time.isoformat() if self.last_touch_date_time else None + + updated_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_date_time, Unset): + updated_date_time = self.updated_date_time.isoformat() if self.updated_date_time else None + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if rating is not UNSET: + field_dict["rating"] = rating + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if period_of_notice_days is not UNSET: + field_dict["periodOfNoticeDays"] = period_of_notice_days + if salary_requirement is not UNSET: + field_dict["salaryRequirement"] = salary_requirement + if offered_salary is not UNSET: + field_dict["offeredSalary"] = offered_salary + if state is not UNSET: + field_dict["state"] = state + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if is_mobile is not UNSET: + field_dict["isMobile"] = is_mobile + if pipeline_id is not UNSET: + field_dict["pipelineId"] = pipeline_id + if pipeline_stage_id is not UNSET: + field_dict["pipelineStageId"] = pipeline_stage_id + if recruitment_manager_id is not UNSET: + field_dict["recruitmentManagerId"] = recruitment_manager_id + if campaign_code is not UNSET: + field_dict["campaignCode"] = campaign_code + if gender is not UNSET: + field_dict["gender"] = gender + if birth_year is not UNSET: + field_dict["birthYear"] = birth_year + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if email is not UNSET: + field_dict["email"] = email + if linked_in_url is not UNSET: + field_dict["linkedInUrl"] = linked_in_url + if phone is not UNSET: + field_dict["phone"] = phone + if attachments is not UNSET: + field_dict["attachments"] = attachments + if recruitment_manager is not UNSET: + field_dict["recruitmentManager"] = recruitment_manager + if current_employer is not UNSET: + field_dict["currentEmployer"] = current_employer + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if firstname is not UNSET: + field_dict["firstname"] = firstname + if first_name is not UNSET: + field_dict["firstName"] = first_name + if lastname is not UNSET: + field_dict["lastname"] = lastname + if last_name is not UNSET: + field_dict["lastName"] = last_name + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if last_touch_date_time is not UNSET: + field_dict["lastTouchDateTime"] = last_touch_date_time + if updated_date_time is not UNSET: + field_dict["updatedDateTime"] = updated_date_time + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_candidate_attachment_model import CompanyCandidateAttachmentModel + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + + d = src_dict.copy() + rating = d.pop("rating", UNSET) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + period_of_notice_days = d.pop("periodOfNoticeDays", UNSET) + + salary_requirement = d.pop("salaryRequirement", UNSET) + + offered_salary = d.pop("offeredSalary", UNSET) + + _state = d.pop("state", UNSET) + state: Union[Unset, None, CompanyCandidateState] + if _state is None: + state = None + elif isinstance(_state, Unset): + state = UNSET + else: + state = CompanyCandidateState(_state) + + currency_id = d.pop("currencyId", UNSET) + + is_mobile = d.pop("isMobile", UNSET) + + pipeline_id = d.pop("pipelineId", UNSET) + + pipeline_stage_id = d.pop("pipelineStageId", UNSET) + + recruitment_manager_id = d.pop("recruitmentManagerId", UNSET) + + campaign_code = d.pop("campaignCode", UNSET) + + _gender = d.pop("gender", UNSET) + gender: Union[Unset, UserGender] + if isinstance(_gender, Unset): + gender = UNSET + else: + gender = UserGender(_gender) + + birth_year = d.pop("birthYear", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + email = d.pop("email", UNSET) + + linked_in_url = d.pop("linkedInUrl", UNSET) + + phone = d.pop("phone", UNSET) + + attachments = [] + _attachments = d.pop("attachments", UNSET) + for attachments_item_data in _attachments or []: + attachments_item = CompanyCandidateAttachmentModel.from_dict(attachments_item_data) + + attachments.append(attachments_item) + + _recruitment_manager = d.pop("recruitmentManager", UNSET) + recruitment_manager: Union[Unset, None, CompanyUserBaseModel] + if _recruitment_manager is None: + recruitment_manager = None + elif isinstance(_recruitment_manager, Unset): + recruitment_manager = UNSET + else: + recruitment_manager = CompanyUserBaseModel.from_dict(_recruitment_manager) + + current_employer = d.pop("currentEmployer", UNSET) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + firstname = d.pop("firstname", UNSET) + + first_name = d.pop("firstName", UNSET) + + lastname = d.pop("lastname", UNSET) + + last_name = d.pop("lastName", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, datetime.datetime] + if isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _last_touch_date_time = d.pop("lastTouchDateTime", UNSET) + last_touch_date_time: Union[Unset, None, datetime.datetime] + if _last_touch_date_time is None: + last_touch_date_time = None + elif isinstance(_last_touch_date_time, Unset): + last_touch_date_time = UNSET + else: + last_touch_date_time = isoparse(_last_touch_date_time) + + _updated_date_time = d.pop("updatedDateTime", UNSET) + updated_date_time: Union[Unset, None, datetime.datetime] + if _updated_date_time is None: + updated_date_time = None + elif isinstance(_updated_date_time, Unset): + updated_date_time = UNSET + else: + updated_date_time = isoparse(_updated_date_time) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_extended_model = cls( + rating=rating, + available_from_date=available_from_date, + period_of_notice_days=period_of_notice_days, + salary_requirement=salary_requirement, + offered_salary=offered_salary, + state=state, + currency_id=currency_id, + is_mobile=is_mobile, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + recruitment_manager_id=recruitment_manager_id, + campaign_code=campaign_code, + gender=gender, + birth_year=birth_year, + title=title, + description=description, + email=email, + linked_in_url=linked_in_url, + phone=phone, + attachments=attachments, + recruitment_manager=recruitment_manager, + current_employer=current_employer, + id=id, + company_id=company_id, + seo_id=seo_id, + firstname=firstname, + first_name=first_name, + lastname=lastname, + last_name=last_name, + created_date_time=created_date_time, + last_touch_date_time=last_touch_date_time, + updated_date_time=updated_date_time, + links=links, + ) + + return company_candidate_extended_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_list_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_list_model.py new file mode 100644 index 0000000..37fa15d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_list_model.py @@ -0,0 +1,99 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_candidate_file_attachment_model import CompanyCandidateFileAttachmentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateFileAttachmentListModel") + + +@_attrs_define +class CompanyCandidateFileAttachmentListModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + company_id (Union[Unset, int]): + attachments (Union[Unset, None, List['CompanyCandidateFileAttachmentModel']]): + links (Union[Unset, None, List['Link']]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + attachments: Union[Unset, None, List["CompanyCandidateFileAttachmentModel"]] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + company_id = self.company_id + attachments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.attachments, Unset): + if self.attachments is None: + attachments = None + else: + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + + attachments.append(attachments_item) + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if attachments is not UNSET: + field_dict["attachments"] = attachments + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_candidate_file_attachment_model import CompanyCandidateFileAttachmentModel + from ..models.link import Link + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + company_id = d.pop("companyId", UNSET) + + attachments = [] + _attachments = d.pop("attachments", UNSET) + for attachments_item_data in _attachments or []: + attachments_item = CompanyCandidateFileAttachmentModel.from_dict(attachments_item_data) + + attachments.append(attachments_item) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_file_attachment_list_model = cls( + company_candidate_id=company_candidate_id, + company_id=company_id, + attachments=attachments, + links=links, + ) + + return company_candidate_file_attachment_list_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_model.py new file mode 100644 index 0000000..248c8db --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_file_attachment_model.py @@ -0,0 +1,135 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateFileAttachmentModel") + + +@_attrs_define +class CompanyCandidateFileAttachmentModel: + """ + Attributes: + file_name (Union[Unset, None, str]): + extension (Union[Unset, None, str]): + id (Union[Unset, str]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, int]): + company_candidate_id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + file_name: Union[Unset, None, str] = UNSET + extension: Union[Unset, None, str] = UNSET + id: Union[Unset, str] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, int] = UNSET + company_candidate_id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + file_name = self.file_name + extension = self.extension + id = self.id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + company_candidate_id = self.company_candidate_id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if file_name is not UNSET: + field_dict["fileName"] = file_name + if extension is not UNSET: + field_dict["extension"] = extension + if id is not UNSET: + field_dict["id"] = id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + file_name = d.pop("fileName", UNSET) + + extension = d.pop("extension", UNSET) + + id = d.pop("id", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + company_candidate_id = d.pop("companyCandidateId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_file_attachment_model = cls( + file_name=file_name, + extension=extension, + id=id, + attachment_type=attachment_type, + company_id=company_id, + company_candidate_id=company_candidate_id, + title=title, + description=description, + links=links, + ) + + return company_candidate_file_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_model.py new file mode 100644 index 0000000..561c0e2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_model.py @@ -0,0 +1,82 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_candidate_pipeline_stage_model import CompanyCandidatePipelineStageModel + + +T = TypeVar("T", bound="CompanyCandidatePipelineModel") + + +@_attrs_define +class CompanyCandidatePipelineModel: + """ + Attributes: + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + stages (Union[Unset, None, List['CompanyCandidatePipelineStageModel']]): + """ + + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + stages: Union[Unset, None, List["CompanyCandidatePipelineStageModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + title = self.title + description = self.description + stages: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.stages, Unset): + if self.stages is None: + stages = None + else: + stages = [] + for stages_item_data in self.stages: + stages_item = stages_item_data.to_dict() + + stages.append(stages_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if stages is not UNSET: + field_dict["stages"] = stages + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_candidate_pipeline_stage_model import CompanyCandidatePipelineStageModel + + d = src_dict.copy() + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + stages = [] + _stages = d.pop("stages", UNSET) + for stages_item_data in _stages or []: + stages_item = CompanyCandidatePipelineStageModel.from_dict(stages_item_data) + + stages.append(stages_item) + + company_candidate_pipeline_model = cls( + id=id, + title=title, + description=description, + stages=stages, + ) + + return company_candidate_pipeline_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_stage_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_stage_model.py new file mode 100644 index 0000000..ffde80b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_pipeline_stage_model.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCandidatePipelineStageModel") + + +@_attrs_define +class CompanyCandidatePipelineStageModel: + """ + Attributes: + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + order (Union[Unset, int]): + probability (Union[Unset, None, int]): + """ + + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + order: Union[Unset, int] = UNSET + probability: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + title = self.title + description = self.description + order = self.order + probability = self.probability + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if order is not UNSET: + field_dict["order"] = order + if probability is not UNSET: + field_dict["probability"] = probability + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + order = d.pop("order", UNSET) + + probability = d.pop("probability", UNSET) + + company_candidate_pipeline_stage_model = cls( + id=id, + title=title, + description=description, + order=order, + probability=probability, + ) + + return company_candidate_pipeline_stage_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort.py new file mode 100644 index 0000000..f0d2eac --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort.py @@ -0,0 +1,13 @@ +from enum import IntEnum + + +class CompanyCandidateQuerySort(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort_page_and_sort_by_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort_page_and_sort_by_model.py new file mode 100644 index 0000000..faf151a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_query_sort_page_and_sort_by_model.py @@ -0,0 +1,93 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_candidate_query_sort import CompanyCandidateQuerySort +from ..models.sort_order import SortOrder +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCandidateQuerySortPageAndSortByModel") + + +@_attrs_define +class CompanyCandidateQuerySortPageAndSortByModel: + """ + Attributes: + sort_by (Union[Unset, CompanyCandidateQuerySort]): + + CreatedDateTime = 0 + + FirstName = 1 + + LastName = 2 + + Status = 3 + + Email = 4 + + UpdatedDateTime = 5 + sort_order (Union[Unset, SortOrder]): 0 - Ascending, + 1 - Descending + page (Union[Unset, int]): Default: 1. + items_per_page (Union[Unset, int]): Default: 15. + """ + + sort_by: Union[Unset, CompanyCandidateQuerySort] = UNSET + sort_order: Union[Unset, SortOrder] = UNSET + page: Union[Unset, int] = 1 + items_per_page: Union[Unset, int] = 15 + + def to_dict(self) -> Dict[str, Any]: + sort_by: Union[Unset, int] = UNSET + if not isinstance(self.sort_by, Unset): + sort_by = self.sort_by.value + + sort_order: Union[Unset, int] = UNSET + if not isinstance(self.sort_order, Unset): + sort_order = self.sort_order.value + + page = self.page + items_per_page = self.items_per_page + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if sort_by is not UNSET: + field_dict["sortBy"] = sort_by + if sort_order is not UNSET: + field_dict["sortOrder"] = sort_order + if page is not UNSET: + field_dict["page"] = page + if items_per_page is not UNSET: + field_dict["itemsPerPage"] = items_per_page + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _sort_by = d.pop("sortBy", UNSET) + sort_by: Union[Unset, CompanyCandidateQuerySort] + if isinstance(_sort_by, Unset): + sort_by = UNSET + else: + sort_by = CompanyCandidateQuerySort(_sort_by) + + _sort_order = d.pop("sortOrder", UNSET) + sort_order: Union[Unset, SortOrder] + if isinstance(_sort_order, Unset): + sort_order = UNSET + else: + sort_order = SortOrder(_sort_order) + + page = d.pop("page", UNSET) + + items_per_page = d.pop("itemsPerPage", UNSET) + + company_candidate_query_sort_page_and_sort_by_model = cls( + sort_by=sort_by, + sort_order=sort_order, + page=page, + items_per_page=items_per_page, + ) + + return company_candidate_query_sort_page_and_sort_by_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_skill_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_skill_add_model.py new file mode 100644 index 0000000..2aa9deb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_skill_add_model.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCandidateSkillAddModel") + + +@_attrs_define +class CompanyCandidateSkillAddModel: + """ + Attributes: + name (Union[Unset, None, str]): + company_candidate_id (Union[Unset, int]): + keyword_synonym_id (Union[Unset, None, int]): + language_id (Union[Unset, None, int]): + """ + + name: Union[Unset, None, str] = UNSET + company_candidate_id: Union[Unset, int] = UNSET + keyword_synonym_id: Union[Unset, None, int] = UNSET + language_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + company_candidate_id = self.company_candidate_id + keyword_synonym_id = self.keyword_synonym_id + language_id = self.language_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if language_id is not UNSET: + field_dict["languageId"] = language_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name", UNSET) + + company_candidate_id = d.pop("companyCandidateId", UNSET) + + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + language_id = d.pop("languageId", UNSET) + + company_candidate_skill_add_model = cls( + name=name, + company_candidate_id=company_candidate_id, + keyword_synonym_id=keyword_synonym_id, + language_id=language_id, + ) + + return company_candidate_skill_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_skill_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_skill_model.py new file mode 100644 index 0000000..9cc183a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_skill_model.py @@ -0,0 +1,97 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.keyword_model import KeywordModel + from ..models.keyword_synonym_model import KeywordSynonymModel + + +T = TypeVar("T", bound="CompanyCandidateSkillModel") + + +@_attrs_define +class CompanyCandidateSkillModel: + """ + Attributes: + company_candidate_id (Union[Unset, int]): + keyword_id (Union[Unset, int]): + keyword (Union[Unset, None, KeywordModel]): + keyword_synonym_id (Union[Unset, int]): + keyword_synonym (Union[Unset, None, KeywordSynonymModel]): + """ + + company_candidate_id: Union[Unset, int] = UNSET + keyword_id: Union[Unset, int] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + keyword_synonym_id: Union[Unset, int] = UNSET + keyword_synonym: Union[Unset, None, "KeywordSynonymModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_candidate_id = self.company_candidate_id + keyword_id = self.keyword_id + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + keyword_synonym_id = self.keyword_synonym_id + keyword_synonym: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword_synonym, Unset): + keyword_synonym = self.keyword_synonym.to_dict() if self.keyword_synonym else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if keyword is not UNSET: + field_dict["keyword"] = keyword + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if keyword_synonym is not UNSET: + field_dict["keywordSynonym"] = keyword_synonym + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.keyword_model import KeywordModel + from ..models.keyword_synonym_model import KeywordSynonymModel + + d = src_dict.copy() + company_candidate_id = d.pop("companyCandidateId", UNSET) + + keyword_id = d.pop("keywordId", UNSET) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + _keyword_synonym = d.pop("keywordSynonym", UNSET) + keyword_synonym: Union[Unset, None, KeywordSynonymModel] + if _keyword_synonym is None: + keyword_synonym = None + elif isinstance(_keyword_synonym, Unset): + keyword_synonym = UNSET + else: + keyword_synonym = KeywordSynonymModel.from_dict(_keyword_synonym) + + company_candidate_skill_model = cls( + company_candidate_id=company_candidate_id, + keyword_id=keyword_id, + keyword=keyword, + keyword_synonym_id=keyword_synonym_id, + keyword_synonym=keyword_synonym, + ) + + return company_candidate_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_state.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_state.py new file mode 100644 index 0000000..e281bc1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_state.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class CompanyCandidateState(IntEnum): + VALUE_0 = 0 + VALUE_10 = 10 + VALUE_20 = 20 + VALUE_30 = 30 + VALUE_40 = 40 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_add_model.py new file mode 100644 index 0000000..9e8d4c3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_add_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCandidateUriAttachmentAddModel") + + +@_attrs_define +class CompanyCandidateUriAttachmentAddModel: + """ + Attributes: + uri (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + """ + + uri: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + uri = self.uri + title = self.title + description = self.description + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if uri is not UNSET: + field_dict["uri"] = uri + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + uri = d.pop("uri", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + company_candidate_uri_attachment_add_model = cls( + uri=uri, + title=title, + description=description, + ) + + return company_candidate_uri_attachment_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_model.py new file mode 100644 index 0000000..7099c37 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_candidate_uri_attachment_model.py @@ -0,0 +1,127 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCandidateUriAttachmentModel") + + +@_attrs_define +class CompanyCandidateUriAttachmentModel: + """ + Attributes: + uri (Union[Unset, None, str]): + id (Union[Unset, str]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, int]): + company_candidate_id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + uri: Union[Unset, None, str] = UNSET + id: Union[Unset, str] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, int] = UNSET + company_candidate_id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + uri = self.uri + id = self.id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + company_candidate_id = self.company_candidate_id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if uri is not UNSET: + field_dict["uri"] = uri + if id is not UNSET: + field_dict["id"] = id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + uri = d.pop("uri", UNSET) + + id = d.pop("id", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + company_candidate_id = d.pop("companyCandidateId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_candidate_uri_attachment_model = cls( + uri=uri, + id=id, + attachment_type=attachment_type, + company_id=company_id, + company_candidate_id=company_candidate_id, + title=title, + description=description, + links=links, + ) + + return company_candidate_uri_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_capabilities_model.py b/src/cinode-py-client/cinode_api_client/models/company_capabilities_model.py new file mode 100644 index 0000000..9ae6a52 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_capabilities_model.py @@ -0,0 +1,58 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_enabled_module_model import CompanyEnabledModuleModel + + +T = TypeVar("T", bound="CompanyCapabilitiesModel") + + +@_attrs_define +class CompanyCapabilitiesModel: + """ + Attributes: + enabled_modules (Union[Unset, None, List['CompanyEnabledModuleModel']]): + """ + + enabled_modules: Union[Unset, None, List["CompanyEnabledModuleModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + enabled_modules: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.enabled_modules, Unset): + if self.enabled_modules is None: + enabled_modules = None + else: + enabled_modules = [] + for enabled_modules_item_data in self.enabled_modules: + enabled_modules_item = enabled_modules_item_data.to_dict() + + enabled_modules.append(enabled_modules_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if enabled_modules is not UNSET: + field_dict["enabledModules"] = enabled_modules + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_enabled_module_model import CompanyEnabledModuleModel + + d = src_dict.copy() + enabled_modules = [] + _enabled_modules = d.pop("enabledModules", UNSET) + for enabled_modules_item_data in _enabled_modules or []: + enabled_modules_item = CompanyEnabledModuleModel.from_dict(enabled_modules_item_data) + + enabled_modules.append(enabled_modules_item) + + company_capabilities_model = cls( + enabled_modules=enabled_modules, + ) + + return company_capabilities_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_add_model.py new file mode 100644 index 0000000..adf7af6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_add_model.py @@ -0,0 +1,181 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_size import CompanySize +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerAddModel") + + +@_attrs_define +class CompanyCustomerAddModel: + """ + Attributes: + name (str): + status (Union[Unset, bool]): + description (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + vat_number (Union[Unset, None, str]): + identification (Union[Unset, None, str]): + email (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + fax (Union[Unset, None, str]): + intermediator (Union[Unset, bool]): + size (Union[Unset, None, CompanySize]): + + Egenföretagare = 0 + + 2-10 = 1 + + 11-50 = 2 + + 51-200 = 3 + + 201-500 = 4 + + 501-1 000 = 5 + + 1 001-5 000 = 6 + + 5 001-10 000 = 7 + + 10 001+ = 8 + country_id (Union[Unset, None, int]): + turn_over (Union[Unset, None, int]): + turn_over_currency_id (Union[Unset, None, int]): + """ + + name: str + status: Union[Unset, bool] = UNSET + description: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + vat_number: Union[Unset, None, str] = UNSET + identification: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + fax: Union[Unset, None, str] = UNSET + intermediator: Union[Unset, bool] = UNSET + size: Union[Unset, None, CompanySize] = UNSET + country_id: Union[Unset, None, int] = UNSET + turn_over: Union[Unset, None, int] = UNSET + turn_over_currency_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + status = self.status + description = self.description + corporate_identity_number = self.corporate_identity_number + vat_number = self.vat_number + identification = self.identification + email = self.email + homepage = self.homepage + phone = self.phone + fax = self.fax + intermediator = self.intermediator + size: Union[Unset, None, int] = UNSET + if not isinstance(self.size, Unset): + size = self.size.value if self.size else None + + country_id = self.country_id + turn_over = self.turn_over + turn_over_currency_id = self.turn_over_currency_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "name": name, + } + ) + if status is not UNSET: + field_dict["status"] = status + if description is not UNSET: + field_dict["description"] = description + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if vat_number is not UNSET: + field_dict["vatNumber"] = vat_number + if identification is not UNSET: + field_dict["identification"] = identification + if email is not UNSET: + field_dict["email"] = email + if homepage is not UNSET: + field_dict["homepage"] = homepage + if phone is not UNSET: + field_dict["phone"] = phone + if fax is not UNSET: + field_dict["fax"] = fax + if intermediator is not UNSET: + field_dict["intermediator"] = intermediator + if size is not UNSET: + field_dict["size"] = size + if country_id is not UNSET: + field_dict["countryId"] = country_id + if turn_over is not UNSET: + field_dict["turnOver"] = turn_over + if turn_over_currency_id is not UNSET: + field_dict["turnOverCurrencyId"] = turn_over_currency_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + status = d.pop("status", UNSET) + + description = d.pop("description", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + vat_number = d.pop("vatNumber", UNSET) + + identification = d.pop("identification", UNSET) + + email = d.pop("email", UNSET) + + homepage = d.pop("homepage", UNSET) + + phone = d.pop("phone", UNSET) + + fax = d.pop("fax", UNSET) + + intermediator = d.pop("intermediator", UNSET) + + _size = d.pop("size", UNSET) + size: Union[Unset, None, CompanySize] + if _size is None: + size = None + elif isinstance(_size, Unset): + size = UNSET + else: + size = CompanySize(_size) + + country_id = d.pop("countryId", UNSET) + + turn_over = d.pop("turnOver", UNSET) + + turn_over_currency_id = d.pop("turnOverCurrencyId", UNSET) + + company_customer_add_model = cls( + name=name, + status=status, + description=description, + corporate_identity_number=corporate_identity_number, + vat_number=vat_number, + identification=identification, + email=email, + homepage=homepage, + phone=phone, + fax=fax, + intermediator=intermediator, + size=size, + country_id=country_id, + turn_over=turn_over, + turn_over_currency_id=turn_over_currency_id, + ) + + return company_customer_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_address_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_address_add_edit_model.py new file mode 100644 index 0000000..3f02ba3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_address_add_edit_model.py @@ -0,0 +1,110 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.address_type import AddressType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerAddressAddEditModel") + + +@_attrs_define +class CompanyCustomerAddressAddEditModel: + """ + Attributes: + street1 (Union[Unset, None, str]): + street2 (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + email (Union[Unset, None, str]): + comments (Union[Unset, None, str]): + country (Union[Unset, None, str]): + address_type (Union[Unset, AddressType]): + + Övrig = 0 + + Besöksadress = 1 + + Faktureringsadress = 2 + + Placeringsort = 3 + """ + + street1: Union[Unset, None, str] = UNSET + street2: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + comments: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + address_type: Union[Unset, AddressType] = UNSET + + def to_dict(self) -> Dict[str, Any]: + street1 = self.street1 + street2 = self.street2 + zip_code = self.zip_code + city = self.city + email = self.email + comments = self.comments + country = self.country + address_type: Union[Unset, int] = UNSET + if not isinstance(self.address_type, Unset): + address_type = self.address_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if street1 is not UNSET: + field_dict["street1"] = street1 + if street2 is not UNSET: + field_dict["street2"] = street2 + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if email is not UNSET: + field_dict["email"] = email + if comments is not UNSET: + field_dict["comments"] = comments + if country is not UNSET: + field_dict["country"] = country + if address_type is not UNSET: + field_dict["addressType"] = address_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + street1 = d.pop("street1", UNSET) + + street2 = d.pop("street2", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + email = d.pop("email", UNSET) + + comments = d.pop("comments", UNSET) + + country = d.pop("country", UNSET) + + _address_type = d.pop("addressType", UNSET) + address_type: Union[Unset, AddressType] + if isinstance(_address_type, Unset): + address_type = UNSET + else: + address_type = AddressType(_address_type) + + company_customer_address_add_edit_model = cls( + street1=street1, + street2=street2, + zip_code=zip_code, + city=city, + email=email, + comments=comments, + country=country, + address_type=address_type, + ) + + return company_customer_address_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_address_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_address_model.py new file mode 100644 index 0000000..ed0139a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_address_model.py @@ -0,0 +1,163 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.address_type import AddressType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerAddressModel") + + +@_attrs_define +class CompanyCustomerAddressModel: + """ + Attributes: + company_customer_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + street1 (Union[Unset, None, str]): + street2 (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + country (Union[Unset, None, str]): + email (Union[Unset, None, str]): + address_type (Union[Unset, AddressType]): + + Övrig = 0 + + Besöksadress = 1 + + Faktureringsadress = 2 + + Placeringsort = 3 + comments (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + company_customer_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + street1: Union[Unset, None, str] = UNSET + street2: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + address_type: Union[Unset, AddressType] = UNSET + comments: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_customer_id = self.company_customer_id + company_id = self.company_id + id = self.id + street1 = self.street1 + street2 = self.street2 + zip_code = self.zip_code + city = self.city + country = self.country + email = self.email + address_type: Union[Unset, int] = UNSET + if not isinstance(self.address_type, Unset): + address_type = self.address_type.value + + comments = self.comments + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_customer_id is not UNSET: + field_dict["companyCustomerId"] = company_customer_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if street1 is not UNSET: + field_dict["street1"] = street1 + if street2 is not UNSET: + field_dict["street2"] = street2 + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if email is not UNSET: + field_dict["email"] = email + if address_type is not UNSET: + field_dict["addressType"] = address_type + if comments is not UNSET: + field_dict["comments"] = comments + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_customer_id = d.pop("companyCustomerId", UNSET) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + street1 = d.pop("street1", UNSET) + + street2 = d.pop("street2", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + email = d.pop("email", UNSET) + + _address_type = d.pop("addressType", UNSET) + address_type: Union[Unset, AddressType] + if isinstance(_address_type, Unset): + address_type = UNSET + else: + address_type = AddressType(_address_type) + + comments = d.pop("comments", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_address_model = cls( + company_customer_id=company_customer_id, + company_id=company_id, + id=id, + street1=street1, + street2=street2, + zip_code=zip_code, + city=city, + country=country, + email=email, + address_type=address_type, + comments=comments, + links=links, + ) + + return company_customer_address_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_attachment_model.py new file mode 100644 index 0000000..994a725 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_attachment_model.py @@ -0,0 +1,119 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerAttachmentModel") + + +@_attrs_define +class CompanyCustomerAttachmentModel: + """ + Attributes: + customer_id (Union[Unset, int]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, None, int]): + id (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + customer_id: Union[Unset, int] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_id = self.customer_id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + id = self.id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + customer_id = d.pop("customerId", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_attachment_model = cls( + customer_id=customer_id, + attachment_type=attachment_type, + company_id=company_id, + id=id, + title=title, + description=description, + links=links, + ) + + return company_customer_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_base_model.py new file mode 100644 index 0000000..b15b430 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_base_model.py @@ -0,0 +1,127 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status import Status +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerBaseModel") + + +@_attrs_define +class CompanyCustomerBaseModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + identification (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + status (Union[Unset, Status]): + + Inaktiv = 0 + + Aktiv = 1 + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + identification: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + status: Union[Unset, Status] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + name = self.name + description = self.description + identification = self.identification + seo_id = self.seo_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if identification is not UNSET: + field_dict["identification"] = identification + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if status is not UNSET: + field_dict["status"] = status + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + identification = d.pop("identification", UNSET) + + seo_id = d.pop("seoId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, Status] + if isinstance(_status, Unset): + status = UNSET + else: + status = Status(_status) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_base_model = cls( + id=id, + company_id=company_id, + name=name, + description=description, + identification=identification, + seo_id=seo_id, + status=status, + links=links, + ) + + return company_customer_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_contact_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_add_edit_model.py new file mode 100644 index 0000000..3ac1852 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_add_edit_model.py @@ -0,0 +1,87 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerContactAddEditModel") + + +@_attrs_define +class CompanyCustomerContactAddEditModel: + """ + Attributes: + first_name (str): + last_name (str): + email (Union[Unset, None, str]): + phone1 (Union[Unset, None, str]): + phone2 (Union[Unset, None, str]): + title (Union[Unset, None, str]): + comments (Union[Unset, None, str]): + """ + + first_name: str + last_name: str + email: Union[Unset, None, str] = UNSET + phone1: Union[Unset, None, str] = UNSET + phone2: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + comments: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + first_name = self.first_name + last_name = self.last_name + email = self.email + phone1 = self.phone1 + phone2 = self.phone2 + title = self.title + comments = self.comments + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "firstName": first_name, + "lastName": last_name, + } + ) + if email is not UNSET: + field_dict["email"] = email + if phone1 is not UNSET: + field_dict["phone1"] = phone1 + if phone2 is not UNSET: + field_dict["phone2"] = phone2 + if title is not UNSET: + field_dict["title"] = title + if comments is not UNSET: + field_dict["comments"] = comments + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + first_name = d.pop("firstName") + + last_name = d.pop("lastName") + + email = d.pop("email", UNSET) + + phone1 = d.pop("phone1", UNSET) + + phone2 = d.pop("phone2", UNSET) + + title = d.pop("title", UNSET) + + comments = d.pop("comments", UNSET) + + company_customer_contact_add_edit_model = cls( + first_name=first_name, + last_name=last_name, + email=email, + phone1=phone1, + phone2=phone2, + title=title, + comments=comments, + ) + + return company_customer_contact_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_contact_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_base_model.py new file mode 100644 index 0000000..a9a1af9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_base_model.py @@ -0,0 +1,114 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerContactBaseModel") + + +@_attrs_define +class CompanyCustomerContactBaseModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + slug (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + email (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + slug: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + customer_id = self.customer_id + slug = self.slug + first_name = self.first_name + last_name = self.last_name + email = self.email + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if slug is not UNSET: + field_dict["slug"] = slug + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if email is not UNSET: + field_dict["email"] = email + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + slug = d.pop("slug", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + email = d.pop("email", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_contact_base_model = cls( + id=id, + company_id=company_id, + customer_id=customer_id, + slug=slug, + first_name=first_name, + last_name=last_name, + email=email, + links=links, + ) + + return company_customer_contact_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_contact_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_model.py new file mode 100644 index 0000000..215ce09 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_model.py @@ -0,0 +1,189 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_tag_model import CompanyTagModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerContactModel") + + +@_attrs_define +class CompanyCustomerContactModel: + """ + Attributes: + title (Union[Unset, None, str]): + phone1 (Union[Unset, None, str]): + phone2 (Union[Unset, None, str]): + comments (Union[Unset, None, str]): + created_date_time (Union[Unset, datetime.datetime]): + tags (Union[Unset, None, List['CompanyTagModel']]): + id (Union[Unset, int]): + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + slug (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + email (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + title: Union[Unset, None, str] = UNSET + phone1: Union[Unset, None, str] = UNSET + phone2: Union[Unset, None, str] = UNSET + comments: Union[Unset, None, str] = UNSET + created_date_time: Union[Unset, datetime.datetime] = UNSET + tags: Union[Unset, None, List["CompanyTagModel"]] = UNSET + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + slug: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + phone1 = self.phone1 + phone2 = self.phone2 + comments = self.comments + created_date_time: Union[Unset, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() + + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + id = self.id + company_id = self.company_id + customer_id = self.customer_id + slug = self.slug + first_name = self.first_name + last_name = self.last_name + email = self.email + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if phone1 is not UNSET: + field_dict["phone1"] = phone1 + if phone2 is not UNSET: + field_dict["phone2"] = phone2 + if comments is not UNSET: + field_dict["comments"] = comments + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if tags is not UNSET: + field_dict["tags"] = tags + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if slug is not UNSET: + field_dict["slug"] = slug + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if email is not UNSET: + field_dict["email"] = email + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_tag_model import CompanyTagModel + from ..models.link import Link + + d = src_dict.copy() + title = d.pop("title", UNSET) + + phone1 = d.pop("phone1", UNSET) + + phone2 = d.pop("phone2", UNSET) + + comments = d.pop("comments", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, datetime.datetime] + if isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagModel.from_dict(tags_item_data) + + tags.append(tags_item) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + slug = d.pop("slug", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + email = d.pop("email", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_contact_model = cls( + title=title, + phone1=phone1, + phone2=phone2, + comments=comments, + created_date_time=created_date_time, + tags=tags, + id=id, + company_id=company_id, + customer_id=customer_id, + slug=slug, + first_name=first_name, + last_name=last_name, + email=email, + links=links, + ) + + return company_customer_contact_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort.py b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort.py new file mode 100644 index 0000000..383627f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort.py @@ -0,0 +1,13 @@ +from enum import IntEnum + + +class CompanyCustomerContactQuerySort(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort_page_and_sort_by_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort_page_and_sort_by_model.py new file mode 100644 index 0000000..5f8d498 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_contact_query_sort_page_and_sort_by_model.py @@ -0,0 +1,93 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_customer_contact_query_sort import CompanyCustomerContactQuerySort +from ..models.sort_order import SortOrder +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerContactQuerySortPageAndSortByModel") + + +@_attrs_define +class CompanyCustomerContactQuerySortPageAndSortByModel: + """ + Attributes: + sort_by (Union[Unset, CompanyCustomerContactQuerySort]): + + CreatedDateTime = 0 + + FirstName = 1 + + LastName = 2 + + Email = 3 + + UpdatedDateTime = 4 + + CustomerId = 5 + sort_order (Union[Unset, SortOrder]): 0 - Ascending, + 1 - Descending + page (Union[Unset, int]): Default: 1. + items_per_page (Union[Unset, int]): Default: 15. + """ + + sort_by: Union[Unset, CompanyCustomerContactQuerySort] = UNSET + sort_order: Union[Unset, SortOrder] = UNSET + page: Union[Unset, int] = 1 + items_per_page: Union[Unset, int] = 15 + + def to_dict(self) -> Dict[str, Any]: + sort_by: Union[Unset, int] = UNSET + if not isinstance(self.sort_by, Unset): + sort_by = self.sort_by.value + + sort_order: Union[Unset, int] = UNSET + if not isinstance(self.sort_order, Unset): + sort_order = self.sort_order.value + + page = self.page + items_per_page = self.items_per_page + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if sort_by is not UNSET: + field_dict["sortBy"] = sort_by + if sort_order is not UNSET: + field_dict["sortOrder"] = sort_order + if page is not UNSET: + field_dict["page"] = page + if items_per_page is not UNSET: + field_dict["itemsPerPage"] = items_per_page + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _sort_by = d.pop("sortBy", UNSET) + sort_by: Union[Unset, CompanyCustomerContactQuerySort] + if isinstance(_sort_by, Unset): + sort_by = UNSET + else: + sort_by = CompanyCustomerContactQuerySort(_sort_by) + + _sort_order = d.pop("sortOrder", UNSET) + sort_order: Union[Unset, SortOrder] + if isinstance(_sort_order, Unset): + sort_order = UNSET + else: + sort_order = SortOrder(_sort_order) + + page = d.pop("page", UNSET) + + items_per_page = d.pop("itemsPerPage", UNSET) + + company_customer_contact_query_sort_page_and_sort_by_model = cls( + sort_by=sort_by, + sort_order=sort_order, + page=page, + items_per_page=items_per_page, + ) + + return company_customer_contact_query_sort_page_and_sort_by_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_delete_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_delete_model.py new file mode 100644 index 0000000..ca07af3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_delete_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerDeleteModel") + + +@_attrs_define +class CompanyCustomerDeleteModel: + """ + Attributes: + customer_verification_name (Union[Unset, None, str]): + """ + + customer_verification_name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_verification_name = self.customer_verification_name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_verification_name is not UNSET: + field_dict["customerVerificationName"] = customer_verification_name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + customer_verification_name = d.pop("customerVerificationName", UNSET) + + company_customer_delete_model = cls( + customer_verification_name=customer_verification_name, + ) + + return company_customer_delete_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_edit_model.py new file mode 100644 index 0000000..b3135f7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_edit_model.py @@ -0,0 +1,156 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_size import CompanySize +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerEditModel") + + +@_attrs_define +class CompanyCustomerEditModel: + """ + Attributes: + name (str): + status (Union[Unset, bool]): + description (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + vat_number (Union[Unset, None, str]): + identification (Union[Unset, None, str]): + email (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + fax (Union[Unset, None, str]): + intermediator (Union[Unset, bool]): + size (Union[Unset, None, CompanySize]): + + Egenföretagare = 0 + + 2-10 = 1 + + 11-50 = 2 + + 51-200 = 3 + + 201-500 = 4 + + 501-1 000 = 5 + + 1 001-5 000 = 6 + + 5 001-10 000 = 7 + + 10 001+ = 8 + """ + + name: str + status: Union[Unset, bool] = UNSET + description: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + vat_number: Union[Unset, None, str] = UNSET + identification: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + fax: Union[Unset, None, str] = UNSET + intermediator: Union[Unset, bool] = UNSET + size: Union[Unset, None, CompanySize] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + status = self.status + description = self.description + corporate_identity_number = self.corporate_identity_number + vat_number = self.vat_number + identification = self.identification + email = self.email + homepage = self.homepage + phone = self.phone + fax = self.fax + intermediator = self.intermediator + size: Union[Unset, None, int] = UNSET + if not isinstance(self.size, Unset): + size = self.size.value if self.size else None + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "name": name, + } + ) + if status is not UNSET: + field_dict["status"] = status + if description is not UNSET: + field_dict["description"] = description + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if vat_number is not UNSET: + field_dict["vatNumber"] = vat_number + if identification is not UNSET: + field_dict["identification"] = identification + if email is not UNSET: + field_dict["email"] = email + if homepage is not UNSET: + field_dict["homepage"] = homepage + if phone is not UNSET: + field_dict["phone"] = phone + if fax is not UNSET: + field_dict["fax"] = fax + if intermediator is not UNSET: + field_dict["intermediator"] = intermediator + if size is not UNSET: + field_dict["size"] = size + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + status = d.pop("status", UNSET) + + description = d.pop("description", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + vat_number = d.pop("vatNumber", UNSET) + + identification = d.pop("identification", UNSET) + + email = d.pop("email", UNSET) + + homepage = d.pop("homepage", UNSET) + + phone = d.pop("phone", UNSET) + + fax = d.pop("fax", UNSET) + + intermediator = d.pop("intermediator", UNSET) + + _size = d.pop("size", UNSET) + size: Union[Unset, None, CompanySize] + if _size is None: + size = None + elif isinstance(_size, Unset): + size = UNSET + else: + size = CompanySize(_size) + + company_customer_edit_model = cls( + name=name, + status=status, + description=description, + corporate_identity_number=corporate_identity_number, + vat_number=vat_number, + identification=identification, + email=email, + homepage=homepage, + phone=phone, + fax=fax, + intermediator=intermediator, + size=size, + ) + + return company_customer_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_extended_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_extended_model.py new file mode 100644 index 0000000..bb65b52 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_extended_model.py @@ -0,0 +1,185 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.status import Status +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerExtendedModel") + + +@_attrs_define +class CompanyCustomerExtendedModel: + """ + Attributes: + email (Union[Unset, None, str]): + tags (Union[Unset, None, List['CompanyTagBaseModel']]): + managers (Union[Unset, None, List['CompanyCustomerManagerModel']]): + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + identification (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + status (Union[Unset, Status]): + + Inaktiv = 0 + + Aktiv = 1 + links (Union[Unset, None, List['Link']]): + """ + + email: Union[Unset, None, str] = UNSET + tags: Union[Unset, None, List["CompanyTagBaseModel"]] = UNSET + managers: Union[Unset, None, List["CompanyCustomerManagerModel"]] = UNSET + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + identification: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + status: Union[Unset, Status] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + email = self.email + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.managers, Unset): + if self.managers is None: + managers = None + else: + managers = [] + for managers_item_data in self.managers: + managers_item = managers_item_data.to_dict() + + managers.append(managers_item) + + id = self.id + company_id = self.company_id + name = self.name + description = self.description + identification = self.identification + seo_id = self.seo_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if email is not UNSET: + field_dict["email"] = email + if tags is not UNSET: + field_dict["tags"] = tags + if managers is not UNSET: + field_dict["managers"] = managers + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if identification is not UNSET: + field_dict["identification"] = identification + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if status is not UNSET: + field_dict["status"] = status + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.link import Link + + d = src_dict.copy() + email = d.pop("email", UNSET) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagBaseModel.from_dict(tags_item_data) + + tags.append(tags_item) + + managers = [] + _managers = d.pop("managers", UNSET) + for managers_item_data in _managers or []: + managers_item = CompanyCustomerManagerModel.from_dict(managers_item_data) + + managers.append(managers_item) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + identification = d.pop("identification", UNSET) + + seo_id = d.pop("seoId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, Status] + if isinstance(_status, Unset): + status = UNSET + else: + status = Status(_status) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_extended_model = cls( + email=email, + tags=tags, + managers=managers, + id=id, + company_id=company_id, + name=name, + description=description, + identification=identification, + seo_id=seo_id, + status=status, + links=links, + ) + + return company_customer_extended_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_manager_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_manager_model.py new file mode 100644 index 0000000..1be27c8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_manager_model.py @@ -0,0 +1,171 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyCustomerManagerModel") + + +@_attrs_define +class CompanyCustomerManagerModel: + """ + Attributes: + company_customer_manager_id (Union[Unset, None, int]): + customer_id (Union[Unset, None, int]): + customer (Union[Unset, None, CompanyCustomerBaseModel]): + id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + links (Union[Unset, None, List['Link']]): + """ + + company_customer_manager_id: Union[Unset, None, int] = UNSET + customer_id: Union[Unset, None, int] = UNSET + customer: Union[Unset, None, "CompanyCustomerBaseModel"] = UNSET + id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_customer_manager_id = self.company_customer_manager_id + customer_id = self.customer_id + customer: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.customer, Unset): + customer = self.customer.to_dict() if self.customer else None + + id = self.id + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_customer_manager_id is not UNSET: + field_dict["companyCustomerManagerId"] = company_customer_manager_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if customer is not UNSET: + field_dict["customer"] = customer + if id is not UNSET: + field_dict["id"] = id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.link import Link + + d = src_dict.copy() + company_customer_manager_id = d.pop("companyCustomerManagerId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + _customer = d.pop("customer", UNSET) + customer: Union[Unset, None, CompanyCustomerBaseModel] + if _customer is None: + customer = None + elif isinstance(_customer, Unset): + customer = UNSET + else: + customer = CompanyCustomerBaseModel.from_dict(_customer) + + id = d.pop("id", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_manager_model = cls( + company_customer_manager_id=company_customer_manager_id, + customer_id=customer_id, + customer=customer, + id=id, + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + links=links, + ) + + return company_customer_manager_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_managers_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_managers_add_edit_model.py new file mode 100644 index 0000000..c64f628 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_managers_add_edit_model.py @@ -0,0 +1,43 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerManagersAddEditModel") + + +@_attrs_define +class CompanyCustomerManagersAddEditModel: + """ + Attributes: + company_user_ids (Union[Unset, None, List[int]]): + """ + + company_user_ids: Union[Unset, None, List[int]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_ids: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.company_user_ids, Unset): + if self.company_user_ids is None: + company_user_ids = None + else: + company_user_ids = self.company_user_ids + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_ids is not UNSET: + field_dict["companyUserIds"] = company_user_ids + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_ids = cast(List[int], d.pop("companyUserIds", UNSET)) + + company_customer_managers_add_edit_model = cls( + company_user_ids=company_user_ids, + ) + + return company_customer_managers_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_model.py new file mode 100644 index 0000000..84a7a2e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_model.py @@ -0,0 +1,434 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_size import CompanySize +from ..models.status import Status +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_address_model import CompanyCustomerAddressModel + from ..models.company_customer_attachment_model import CompanyCustomerAttachmentModel + from ..models.company_customer_contact_base_model import CompanyCustomerContactBaseModel + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.country_model import CountryModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.project_base_model import ProjectBaseModel + + +T = TypeVar("T", bound="CompanyCustomerModel") + + +@_attrs_define +class CompanyCustomerModel: + """ + Attributes: + phone (Union[Unset, None, str]): + fax (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + vat_number (Union[Unset, None, str]): + contacts (Union[Unset, None, List['CompanyCustomerContactBaseModel']]): + addresses (Union[Unset, None, List['CompanyCustomerAddressModel']]): + projects (Union[Unset, None, List['ProjectBaseModel']]): + intermediator (Union[Unset, None, bool]): + attachments (Union[Unset, None, List['CompanyCustomerAttachmentModel']]): + size (Union[Unset, None, CompanySize]): + + Egenföretagare = 0 + + 2-10 = 1 + + 11-50 = 2 + + 51-200 = 3 + + 201-500 = 4 + + 501-1 000 = 5 + + 1 001-5 000 = 6 + + 5 001-10 000 = 7 + + 10 001+ = 8 + country_id (Union[Unset, None, int]): + country (Union[Unset, None, CountryModel]): + turn_over (Union[Unset, None, int]): + turn_over_currency_id (Union[Unset, None, int]): + turn_over_currency (Union[Unset, None, CurrencyModel]): + email (Union[Unset, None, str]): + tags (Union[Unset, None, List['CompanyTagBaseModel']]): + managers (Union[Unset, None, List['CompanyCustomerManagerModel']]): + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + identification (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + status (Union[Unset, Status]): + + Inaktiv = 0 + + Aktiv = 1 + links (Union[Unset, None, List['Link']]): + """ + + phone: Union[Unset, None, str] = UNSET + fax: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + vat_number: Union[Unset, None, str] = UNSET + contacts: Union[Unset, None, List["CompanyCustomerContactBaseModel"]] = UNSET + addresses: Union[Unset, None, List["CompanyCustomerAddressModel"]] = UNSET + projects: Union[Unset, None, List["ProjectBaseModel"]] = UNSET + intermediator: Union[Unset, None, bool] = UNSET + attachments: Union[Unset, None, List["CompanyCustomerAttachmentModel"]] = UNSET + size: Union[Unset, None, CompanySize] = UNSET + country_id: Union[Unset, None, int] = UNSET + country: Union[Unset, None, "CountryModel"] = UNSET + turn_over: Union[Unset, None, int] = UNSET + turn_over_currency_id: Union[Unset, None, int] = UNSET + turn_over_currency: Union[Unset, None, "CurrencyModel"] = UNSET + email: Union[Unset, None, str] = UNSET + tags: Union[Unset, None, List["CompanyTagBaseModel"]] = UNSET + managers: Union[Unset, None, List["CompanyCustomerManagerModel"]] = UNSET + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + identification: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + status: Union[Unset, Status] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + phone = self.phone + fax = self.fax + homepage = self.homepage + corporate_identity_number = self.corporate_identity_number + vat_number = self.vat_number + contacts: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.contacts, Unset): + if self.contacts is None: + contacts = None + else: + contacts = [] + for contacts_item_data in self.contacts: + contacts_item = contacts_item_data.to_dict() + + contacts.append(contacts_item) + + addresses: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.addresses, Unset): + if self.addresses is None: + addresses = None + else: + addresses = [] + for addresses_item_data in self.addresses: + addresses_item = addresses_item_data.to_dict() + + addresses.append(addresses_item) + + projects: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.projects, Unset): + if self.projects is None: + projects = None + else: + projects = [] + for projects_item_data in self.projects: + projects_item = projects_item_data.to_dict() + + projects.append(projects_item) + + intermediator = self.intermediator + attachments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.attachments, Unset): + if self.attachments is None: + attachments = None + else: + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + + attachments.append(attachments_item) + + size: Union[Unset, None, int] = UNSET + if not isinstance(self.size, Unset): + size = self.size.value if self.size else None + + country_id = self.country_id + country: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.country, Unset): + country = self.country.to_dict() if self.country else None + + turn_over = self.turn_over + turn_over_currency_id = self.turn_over_currency_id + turn_over_currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.turn_over_currency, Unset): + turn_over_currency = self.turn_over_currency.to_dict() if self.turn_over_currency else None + + email = self.email + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.managers, Unset): + if self.managers is None: + managers = None + else: + managers = [] + for managers_item_data in self.managers: + managers_item = managers_item_data.to_dict() + + managers.append(managers_item) + + id = self.id + company_id = self.company_id + name = self.name + description = self.description + identification = self.identification + seo_id = self.seo_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if phone is not UNSET: + field_dict["phone"] = phone + if fax is not UNSET: + field_dict["fax"] = fax + if homepage is not UNSET: + field_dict["homepage"] = homepage + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if vat_number is not UNSET: + field_dict["vatNumber"] = vat_number + if contacts is not UNSET: + field_dict["contacts"] = contacts + if addresses is not UNSET: + field_dict["addresses"] = addresses + if projects is not UNSET: + field_dict["projects"] = projects + if intermediator is not UNSET: + field_dict["intermediator"] = intermediator + if attachments is not UNSET: + field_dict["attachments"] = attachments + if size is not UNSET: + field_dict["size"] = size + if country_id is not UNSET: + field_dict["countryId"] = country_id + if country is not UNSET: + field_dict["country"] = country + if turn_over is not UNSET: + field_dict["turnOver"] = turn_over + if turn_over_currency_id is not UNSET: + field_dict["turnOverCurrencyId"] = turn_over_currency_id + if turn_over_currency is not UNSET: + field_dict["turnOverCurrency"] = turn_over_currency + if email is not UNSET: + field_dict["email"] = email + if tags is not UNSET: + field_dict["tags"] = tags + if managers is not UNSET: + field_dict["managers"] = managers + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if identification is not UNSET: + field_dict["identification"] = identification + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if status is not UNSET: + field_dict["status"] = status + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_address_model import CompanyCustomerAddressModel + from ..models.company_customer_attachment_model import CompanyCustomerAttachmentModel + from ..models.company_customer_contact_base_model import CompanyCustomerContactBaseModel + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.country_model import CountryModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.project_base_model import ProjectBaseModel + + d = src_dict.copy() + phone = d.pop("phone", UNSET) + + fax = d.pop("fax", UNSET) + + homepage = d.pop("homepage", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + vat_number = d.pop("vatNumber", UNSET) + + contacts = [] + _contacts = d.pop("contacts", UNSET) + for contacts_item_data in _contacts or []: + contacts_item = CompanyCustomerContactBaseModel.from_dict(contacts_item_data) + + contacts.append(contacts_item) + + addresses = [] + _addresses = d.pop("addresses", UNSET) + for addresses_item_data in _addresses or []: + addresses_item = CompanyCustomerAddressModel.from_dict(addresses_item_data) + + addresses.append(addresses_item) + + projects = [] + _projects = d.pop("projects", UNSET) + for projects_item_data in _projects or []: + projects_item = ProjectBaseModel.from_dict(projects_item_data) + + projects.append(projects_item) + + intermediator = d.pop("intermediator", UNSET) + + attachments = [] + _attachments = d.pop("attachments", UNSET) + for attachments_item_data in _attachments or []: + attachments_item = CompanyCustomerAttachmentModel.from_dict(attachments_item_data) + + attachments.append(attachments_item) + + _size = d.pop("size", UNSET) + size: Union[Unset, None, CompanySize] + if _size is None: + size = None + elif isinstance(_size, Unset): + size = UNSET + else: + size = CompanySize(_size) + + country_id = d.pop("countryId", UNSET) + + _country = d.pop("country", UNSET) + country: Union[Unset, None, CountryModel] + if _country is None: + country = None + elif isinstance(_country, Unset): + country = UNSET + else: + country = CountryModel.from_dict(_country) + + turn_over = d.pop("turnOver", UNSET) + + turn_over_currency_id = d.pop("turnOverCurrencyId", UNSET) + + _turn_over_currency = d.pop("turnOverCurrency", UNSET) + turn_over_currency: Union[Unset, None, CurrencyModel] + if _turn_over_currency is None: + turn_over_currency = None + elif isinstance(_turn_over_currency, Unset): + turn_over_currency = UNSET + else: + turn_over_currency = CurrencyModel.from_dict(_turn_over_currency) + + email = d.pop("email", UNSET) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagBaseModel.from_dict(tags_item_data) + + tags.append(tags_item) + + managers = [] + _managers = d.pop("managers", UNSET) + for managers_item_data in _managers or []: + managers_item = CompanyCustomerManagerModel.from_dict(managers_item_data) + + managers.append(managers_item) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + identification = d.pop("identification", UNSET) + + seo_id = d.pop("seoId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, Status] + if isinstance(_status, Unset): + status = UNSET + else: + status = Status(_status) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_customer_model = cls( + phone=phone, + fax=fax, + homepage=homepage, + corporate_identity_number=corporate_identity_number, + vat_number=vat_number, + contacts=contacts, + addresses=addresses, + projects=projects, + intermediator=intermediator, + attachments=attachments, + size=size, + country_id=country_id, + country=country, + turn_over=turn_over, + turn_over_currency_id=turn_over_currency_id, + turn_over_currency=turn_over_currency, + email=email, + tags=tags, + managers=managers, + id=id, + company_id=company_id, + name=name, + description=description, + identification=identification, + seo_id=seo_id, + status=status, + links=links, + ) + + return company_customer_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_query_sort.py b/src/cinode-py-client/cinode_api_client/models/company_customer_query_sort.py new file mode 100644 index 0000000..37afd95 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_query_sort.py @@ -0,0 +1,22 @@ +from enum import IntEnum + + +class CompanyCustomerQuerySort(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + VALUE_7 = 7 + VALUE_8 = 8 + VALUE_9 = 9 + VALUE_10 = 10 + VALUE_11 = 11 + VALUE_12 = 12 + VALUE_13 = 13 + VALUE_14 = 14 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_customer_query_sort_page_and_sort_by_model.py b/src/cinode-py-client/cinode_api_client/models/company_customer_query_sort_page_and_sort_by_model.py new file mode 100644 index 0000000..a3c3b29 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_customer_query_sort_page_and_sort_by_model.py @@ -0,0 +1,111 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_customer_query_sort import CompanyCustomerQuerySort +from ..models.sort_order import SortOrder +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyCustomerQuerySortPageAndSortByModel") + + +@_attrs_define +class CompanyCustomerQuerySortPageAndSortByModel: + """ + Attributes: + sort_by (Union[Unset, CompanyCustomerQuerySort]): + + CreatedDateTime = 0 + + Name = 1 + + Description = 2 + + Identification = 3 + + SeoId = 4 + + Status = 5 + + Phone = 6 + + Email = 7 + + Fax = 8 + + Homepage = 9 + + CorporateIdentityNumber = 10 + + VATNumber = 11 + + Intermediator = 12 + + UpdatedDateTime = 13 + + LastTouchDateTime = 14 + sort_order (Union[Unset, SortOrder]): 0 - Ascending, + 1 - Descending + page (Union[Unset, int]): Default: 1. + items_per_page (Union[Unset, int]): Default: 15. + """ + + sort_by: Union[Unset, CompanyCustomerQuerySort] = UNSET + sort_order: Union[Unset, SortOrder] = UNSET + page: Union[Unset, int] = 1 + items_per_page: Union[Unset, int] = 15 + + def to_dict(self) -> Dict[str, Any]: + sort_by: Union[Unset, int] = UNSET + if not isinstance(self.sort_by, Unset): + sort_by = self.sort_by.value + + sort_order: Union[Unset, int] = UNSET + if not isinstance(self.sort_order, Unset): + sort_order = self.sort_order.value + + page = self.page + items_per_page = self.items_per_page + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if sort_by is not UNSET: + field_dict["sortBy"] = sort_by + if sort_order is not UNSET: + field_dict["sortOrder"] = sort_order + if page is not UNSET: + field_dict["page"] = page + if items_per_page is not UNSET: + field_dict["itemsPerPage"] = items_per_page + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _sort_by = d.pop("sortBy", UNSET) + sort_by: Union[Unset, CompanyCustomerQuerySort] + if isinstance(_sort_by, Unset): + sort_by = UNSET + else: + sort_by = CompanyCustomerQuerySort(_sort_by) + + _sort_order = d.pop("sortOrder", UNSET) + sort_order: Union[Unset, SortOrder] + if isinstance(_sort_order, Unset): + sort_order = UNSET + else: + sort_order = SortOrder(_sort_order) + + page = d.pop("page", UNSET) + + items_per_page = d.pop("itemsPerPage", UNSET) + + company_customer_query_sort_page_and_sort_by_model = cls( + sort_by=sort_by, + sort_order=sort_order, + page=page, + items_per_page=items_per_page, + ) + + return company_customer_query_sort_page_and_sort_by_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_enabled_module_model.py b/src/cinode-py-client/cinode_api_client/models/company_enabled_module_model.py new file mode 100644 index 0000000..3a08f4d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_enabled_module_model.py @@ -0,0 +1,106 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.module_type import ModuleType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyEnabledModuleModel") + + +@_attrs_define +class CompanyEnabledModuleModel: + """ + Attributes: + module_id (Union[Unset, ModuleType]): + + CompanyUserResume = 1 + + Customers = 2 + + Assignments = 3 + + Partners = 4 + + Offers = 5 + + Reports = 6 + + Recruitment = 8 + + Absence = 9 + + Api = 10 + + ReferenceText = 11 + + ProfileCompleteness = 12 + + CalendarSync = 13 + + AllowWidgetModification = 14 + + ConfiguredFilters = 19 + + SkillSets = 20 + + ProfileUpdateReminders = 21 + + OverdueProjectReminders = 22 + + EmailSync = 23 + + ApplicationRegistration = 30 + + ApplicationDirectory = 31 + + NextGenResume = 40 + + HideLinkToMvcProfilePageInSidebarAndRemoveEditAndCopyCVInoldViewAndTheBetaChips = 41 + + ImportCv = 42 + + AI = 43 + + ExternalAccounts = 50 + + ConvertAccount = 51 + + UserProvisioning = 52 + + Webhooks = 60 + + GrowthPlan = 70 + + Intercom = 600 + """ + + module_id: Union[Unset, ModuleType] = UNSET + + def to_dict(self) -> Dict[str, Any]: + module_id: Union[Unset, int] = UNSET + if not isinstance(self.module_id, Unset): + module_id = self.module_id.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if module_id is not UNSET: + field_dict["moduleId"] = module_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _module_id = d.pop("moduleId", UNSET) + module_id: Union[Unset, ModuleType] + if isinstance(_module_id, Unset): + module_id = UNSET + else: + module_id = ModuleType(_module_id) + + company_enabled_module_model = cls( + module_id=module_id, + ) + + return company_enabled_module_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_image_model.py b/src/cinode-py-client/cinode_api_client/models/company_image_model.py new file mode 100644 index 0000000..096542b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_image_model.py @@ -0,0 +1,150 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyImageModel") + + +@_attrs_define +class CompanyImageModel: + """ + Attributes: + id (Union[Unset, int]): + image_file_name (Union[Unset, str]): + extension (Union[Unset, None, str]): + company_id (Union[Unset, int]): + created (Union[Unset, datetime.datetime]): + assigned_to_company_user (Union[Unset, None, CompanyUserBaseModel]): + uploaded_by_company_user (Union[Unset, None, CompanyUserBaseModel]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + image_file_name: Union[Unset, str] = UNSET + extension: Union[Unset, None, str] = UNSET + company_id: Union[Unset, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + assigned_to_company_user: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + uploaded_by_company_user: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + image_file_name = self.image_file_name + extension = self.extension + company_id = self.company_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + assigned_to_company_user: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.assigned_to_company_user, Unset): + assigned_to_company_user = ( + self.assigned_to_company_user.to_dict() if self.assigned_to_company_user else None + ) + + uploaded_by_company_user: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.uploaded_by_company_user, Unset): + uploaded_by_company_user = ( + self.uploaded_by_company_user.to_dict() if self.uploaded_by_company_user else None + ) + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if image_file_name is not UNSET: + field_dict["imageFileName"] = image_file_name + if extension is not UNSET: + field_dict["extension"] = extension + if company_id is not UNSET: + field_dict["companyId"] = company_id + if created is not UNSET: + field_dict["created"] = created + if assigned_to_company_user is not UNSET: + field_dict["assignedToCompanyUser"] = assigned_to_company_user + if uploaded_by_company_user is not UNSET: + field_dict["uploadedByCompanyUser"] = uploaded_by_company_user + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + image_file_name = d.pop("imageFileName", UNSET) + + extension = d.pop("extension", UNSET) + + company_id = d.pop("companyId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _assigned_to_company_user = d.pop("assignedToCompanyUser", UNSET) + assigned_to_company_user: Union[Unset, None, CompanyUserBaseModel] + if _assigned_to_company_user is None: + assigned_to_company_user = None + elif isinstance(_assigned_to_company_user, Unset): + assigned_to_company_user = UNSET + else: + assigned_to_company_user = CompanyUserBaseModel.from_dict(_assigned_to_company_user) + + _uploaded_by_company_user = d.pop("uploadedByCompanyUser", UNSET) + uploaded_by_company_user: Union[Unset, None, CompanyUserBaseModel] + if _uploaded_by_company_user is None: + uploaded_by_company_user = None + elif isinstance(_uploaded_by_company_user, Unset): + uploaded_by_company_user = UNSET + else: + uploaded_by_company_user = CompanyUserBaseModel.from_dict(_uploaded_by_company_user) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_image_model = cls( + id=id, + image_file_name=image_file_name, + extension=extension, + company_id=company_id, + created=created, + assigned_to_company_user=assigned_to_company_user, + uploaded_by_company_user=uploaded_by_company_user, + links=links, + ) + + return company_image_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_model.py b/src/cinode-py-client/cinode_api_client/models/company_model.py new file mode 100644 index 0000000..54066dc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_model.py @@ -0,0 +1,223 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyModel") + + +@_attrs_define +class CompanyModel: + """ + Attributes: + corporate_identity_number (Union[Unset, None, str]): External identifier + vat_number (Union[Unset, None, str]): + registration_year (Union[Unset, None, int]): + is_tax_registered (Union[Unset, None, bool]): + addresses (Union[Unset, None, List['CompanyAddressModel']]): + tags (Union[Unset, None, List['CompanyTagBaseModel']]): + country_id (Union[Unset, None, int]): + default_currency (Union[Unset, None, CurrencyModel]): + currencies (Union[Unset, None, List['CurrencyModel']]): + id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + corporate_identity_number: Union[Unset, None, str] = UNSET + vat_number: Union[Unset, None, str] = UNSET + registration_year: Union[Unset, None, int] = UNSET + is_tax_registered: Union[Unset, None, bool] = UNSET + addresses: Union[Unset, None, List["CompanyAddressModel"]] = UNSET + tags: Union[Unset, None, List["CompanyTagBaseModel"]] = UNSET + country_id: Union[Unset, None, int] = UNSET + default_currency: Union[Unset, None, "CurrencyModel"] = UNSET + currencies: Union[Unset, None, List["CurrencyModel"]] = UNSET + id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + corporate_identity_number = self.corporate_identity_number + vat_number = self.vat_number + registration_year = self.registration_year + is_tax_registered = self.is_tax_registered + addresses: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.addresses, Unset): + if self.addresses is None: + addresses = None + else: + addresses = [] + for addresses_item_data in self.addresses: + addresses_item = addresses_item_data.to_dict() + + addresses.append(addresses_item) + + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + country_id = self.country_id + default_currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.default_currency, Unset): + default_currency = self.default_currency.to_dict() if self.default_currency else None + + currencies: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.currencies, Unset): + if self.currencies is None: + currencies = None + else: + currencies = [] + for currencies_item_data in self.currencies: + currencies_item = currencies_item_data.to_dict() + + currencies.append(currencies_item) + + id = self.id + name = self.name + seo_id = self.seo_id + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if vat_number is not UNSET: + field_dict["vatNumber"] = vat_number + if registration_year is not UNSET: + field_dict["registrationYear"] = registration_year + if is_tax_registered is not UNSET: + field_dict["isTaxRegistered"] = is_tax_registered + if addresses is not UNSET: + field_dict["addresses"] = addresses + if tags is not UNSET: + field_dict["tags"] = tags + if country_id is not UNSET: + field_dict["countryId"] = country_id + if default_currency is not UNSET: + field_dict["defaultCurrency"] = default_currency + if currencies is not UNSET: + field_dict["currencies"] = currencies + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + + d = src_dict.copy() + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + vat_number = d.pop("vatNumber", UNSET) + + registration_year = d.pop("registrationYear", UNSET) + + is_tax_registered = d.pop("isTaxRegistered", UNSET) + + addresses = [] + _addresses = d.pop("addresses", UNSET) + for addresses_item_data in _addresses or []: + addresses_item = CompanyAddressModel.from_dict(addresses_item_data) + + addresses.append(addresses_item) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagBaseModel.from_dict(tags_item_data) + + tags.append(tags_item) + + country_id = d.pop("countryId", UNSET) + + _default_currency = d.pop("defaultCurrency", UNSET) + default_currency: Union[Unset, None, CurrencyModel] + if _default_currency is None: + default_currency = None + elif isinstance(_default_currency, Unset): + default_currency = UNSET + else: + default_currency = CurrencyModel.from_dict(_default_currency) + + currencies = [] + _currencies = d.pop("currencies", UNSET) + for currencies_item_data in _currencies or []: + currencies_item = CurrencyModel.from_dict(currencies_item_data) + + currencies.append(currencies_item) + + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + seo_id = d.pop("seoId", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_model = cls( + corporate_identity_number=corporate_identity_number, + vat_number=vat_number, + registration_year=registration_year, + is_tax_registered=is_tax_registered, + addresses=addresses, + tags=tags, + country_id=country_id, + default_currency=default_currency, + currencies=currencies, + id=id, + name=name, + seo_id=seo_id, + description=description, + links=links, + ) + + return company_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_profile_filter_model.py b/src/cinode-py-client/cinode_api_client/models/company_profile_filter_model.py new file mode 100644 index 0000000..c6d6201 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_profile_filter_model.py @@ -0,0 +1,71 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_profile_sort_page_and_sort_by_model import CompanyProfileSortPageAndSortByModel + + +T = TypeVar("T", bound="CompanyProfileFilterModel") + + +@_attrs_define +class CompanyProfileFilterModel: + """ + Attributes: + created_offset_days (Union[Unset, None, int]): If set to true, the results will include only Profiles created + within the last X days + updated_offset_days (Union[Unset, None, int]): If set to true, the results will include only Profiles updated + within the last X days + page_and_sort_by (Union[Unset, None, CompanyProfileSortPageAndSortByModel]): + """ + + created_offset_days: Union[Unset, None, int] = UNSET + updated_offset_days: Union[Unset, None, int] = UNSET + page_and_sort_by: Union[Unset, None, "CompanyProfileSortPageAndSortByModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + created_offset_days = self.created_offset_days + updated_offset_days = self.updated_offset_days + page_and_sort_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.page_and_sort_by, Unset): + page_and_sort_by = self.page_and_sort_by.to_dict() if self.page_and_sort_by else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if created_offset_days is not UNSET: + field_dict["createdOffsetDays"] = created_offset_days + if updated_offset_days is not UNSET: + field_dict["updatedOffsetDays"] = updated_offset_days + if page_and_sort_by is not UNSET: + field_dict["pageAndSortBy"] = page_and_sort_by + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_profile_sort_page_and_sort_by_model import CompanyProfileSortPageAndSortByModel + + d = src_dict.copy() + created_offset_days = d.pop("createdOffsetDays", UNSET) + + updated_offset_days = d.pop("updatedOffsetDays", UNSET) + + _page_and_sort_by = d.pop("pageAndSortBy", UNSET) + page_and_sort_by: Union[Unset, None, CompanyProfileSortPageAndSortByModel] + if _page_and_sort_by is None: + page_and_sort_by = None + elif isinstance(_page_and_sort_by, Unset): + page_and_sort_by = UNSET + else: + page_and_sort_by = CompanyProfileSortPageAndSortByModel.from_dict(_page_and_sort_by) + + company_profile_filter_model = cls( + created_offset_days=created_offset_days, + updated_offset_days=updated_offset_days, + page_and_sort_by=page_and_sort_by, + ) + + return company_profile_filter_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_profile_sort.py b/src/cinode-py-client/cinode_api_client/models/company_profile_sort.py new file mode 100644 index 0000000..e2d0b51 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_profile_sort.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class CompanyProfileSort(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_profile_sort_page_and_sort_by_model.py b/src/cinode-py-client/cinode_api_client/models/company_profile_sort_page_and_sort_by_model.py new file mode 100644 index 0000000..2850625 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_profile_sort_page_and_sort_by_model.py @@ -0,0 +1,84 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_profile_sort import CompanyProfileSort +from ..models.sort_order import SortOrder +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyProfileSortPageAndSortByModel") + + +@_attrs_define +class CompanyProfileSortPageAndSortByModel: + """ + Attributes: + sort_by (Union[Unset, CompanyProfileSort]): 0 - Id (Default), + 1 - CompanyUserId, + 2 - CreatedDateTime, + 3 - UpdatedDateTime + sort_order (Union[Unset, SortOrder]): 0 - Ascending, + 1 - Descending + page (Union[Unset, int]): Default: 1. + items_per_page (Union[Unset, int]): Default: 15. + """ + + sort_by: Union[Unset, CompanyProfileSort] = UNSET + sort_order: Union[Unset, SortOrder] = UNSET + page: Union[Unset, int] = 1 + items_per_page: Union[Unset, int] = 15 + + def to_dict(self) -> Dict[str, Any]: + sort_by: Union[Unset, int] = UNSET + if not isinstance(self.sort_by, Unset): + sort_by = self.sort_by.value + + sort_order: Union[Unset, int] = UNSET + if not isinstance(self.sort_order, Unset): + sort_order = self.sort_order.value + + page = self.page + items_per_page = self.items_per_page + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if sort_by is not UNSET: + field_dict["sortBy"] = sort_by + if sort_order is not UNSET: + field_dict["sortOrder"] = sort_order + if page is not UNSET: + field_dict["page"] = page + if items_per_page is not UNSET: + field_dict["itemsPerPage"] = items_per_page + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _sort_by = d.pop("sortBy", UNSET) + sort_by: Union[Unset, CompanyProfileSort] + if isinstance(_sort_by, Unset): + sort_by = UNSET + else: + sort_by = CompanyProfileSort(_sort_by) + + _sort_order = d.pop("sortOrder", UNSET) + sort_order: Union[Unset, SortOrder] + if isinstance(_sort_order, Unset): + sort_order = UNSET + else: + sort_order = SortOrder(_sort_order) + + page = d.pop("page", UNSET) + + items_per_page = d.pop("itemsPerPage", UNSET) + + company_profile_sort_page_and_sort_by_model = cls( + sort_by=sort_by, + sort_order=sort_order, + page=page, + items_per_page=items_per_page, + ) + + return company_profile_sort_page_and_sort_by_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_profiles_model.py b/src/cinode-py-client/cinode_api_client/models/company_profiles_model.py new file mode 100644 index 0000000..20cadde --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_profiles_model.py @@ -0,0 +1,66 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_base_model import CompanyUserProfileBaseModel + + +T = TypeVar("T", bound="CompanyProfilesModel") + + +@_attrs_define +class CompanyProfilesModel: + """ + Attributes: + total_items (Union[Unset, int]): + profiles (Union[Unset, None, List['CompanyUserProfileBaseModel']]): + """ + + total_items: Union[Unset, int] = UNSET + profiles: Union[Unset, None, List["CompanyUserProfileBaseModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + total_items = self.total_items + profiles: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.profiles, Unset): + if self.profiles is None: + profiles = None + else: + profiles = [] + for profiles_item_data in self.profiles: + profiles_item = profiles_item_data.to_dict() + + profiles.append(profiles_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if total_items is not UNSET: + field_dict["totalItems"] = total_items + if profiles is not UNSET: + field_dict["profiles"] = profiles + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_base_model import CompanyUserProfileBaseModel + + d = src_dict.copy() + total_items = d.pop("totalItems", UNSET) + + profiles = [] + _profiles = d.pop("profiles", UNSET) + for profiles_item_data in _profiles or []: + profiles_item = CompanyUserProfileBaseModel.from_dict(profiles_item_data) + + profiles.append(profiles_item) + + company_profiles_model = cls( + total_items=total_items, + profiles=profiles, + ) + + return company_profiles_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_recruitment_manager_model.py b/src/cinode-py-client/cinode_api_client/models/company_recruitment_manager_model.py new file mode 100644 index 0000000..80cc04b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_recruitment_manager_model.py @@ -0,0 +1,135 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyRecruitmentManagerModel") + + +@_attrs_define +class CompanyRecruitmentManagerModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_recruitment_manager_model = cls( + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_recruitment_manager_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_resume_template_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_resume_template_base_model.py new file mode 100644 index 0000000..06ba63b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_resume_template_base_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyResumeTemplateBaseModel") + + +@_attrs_define +class CompanyResumeTemplateBaseModel: + """ + Attributes: + id (Union[Unset, int]): + title (Union[Unset, None, str]): + """ + + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + title = self.title + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + company_resume_template_base_model = cls( + id=id, + title=title, + ) + + return company_resume_template_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_resume_template_language_model.py b/src/cinode-py-client/cinode_api_client/models/company_resume_template_language_model.py new file mode 100644 index 0000000..0ec7b8b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_resume_template_language_model.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyResumeTemplateLanguageModel") + + +@_attrs_define +class CompanyResumeTemplateLanguageModel: + """ + Attributes: + language_id (Union[Unset, int]): + name (Union[Unset, None, str]): + culture (Union[Unset, None, str]): + lang (Union[Unset, None, str]): + country (Union[Unset, None, str]): + """ + + language_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + culture: Union[Unset, None, str] = UNSET + lang: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + language_id = self.language_id + name = self.name + culture = self.culture + lang = self.lang + country = self.country + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if language_id is not UNSET: + field_dict["languageId"] = language_id + if name is not UNSET: + field_dict["name"] = name + if culture is not UNSET: + field_dict["culture"] = culture + if lang is not UNSET: + field_dict["lang"] = lang + if country is not UNSET: + field_dict["country"] = country + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + language_id = d.pop("languageId", UNSET) + + name = d.pop("name", UNSET) + + culture = d.pop("culture", UNSET) + + lang = d.pop("lang", UNSET) + + country = d.pop("country", UNSET) + + company_resume_template_language_model = cls( + language_id=language_id, + name=name, + culture=culture, + lang=lang, + country=country, + ) + + return company_resume_template_language_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_size.py b/src/cinode-py-client/cinode_api_client/models/company_size.py new file mode 100644 index 0000000..b8c1673 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_size.py @@ -0,0 +1,16 @@ +from enum import IntEnum + + +class CompanySize(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + VALUE_7 = 7 + VALUE_8 = 8 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_base_model.py new file mode 100644 index 0000000..a0cce9a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_base_model.py @@ -0,0 +1,90 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanySubcontractorGroupBaseModel") + + +@_attrs_define +class CompanySubcontractorGroupBaseModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + name = self.name + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_subcontractor_group_base_model = cls( + id=id, + company_id=company_id, + name=name, + description=description, + links=links, + ) + + return company_subcontractor_group_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_model.py b/src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_model.py new file mode 100644 index 0000000..c1e52b9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_subcontractor_group_model.py @@ -0,0 +1,133 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanySubcontractorGroupModel") + + +@_attrs_define +class CompanySubcontractorGroupModel: + """ + Attributes: + company_user_manager (Union[Unset, None, CompanyUserBaseModel]): + members (Union[Unset, None, List['CompanyUserBaseModel']]): + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_manager: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + members: Union[Unset, None, List["CompanyUserBaseModel"]] = UNSET + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_manager: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_user_manager, Unset): + company_user_manager = self.company_user_manager.to_dict() if self.company_user_manager else None + + members: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.members, Unset): + if self.members is None: + members = None + else: + members = [] + for members_item_data in self.members: + members_item = members_item_data.to_dict() + + members.append(members_item) + + id = self.id + company_id = self.company_id + name = self.name + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_manager is not UNSET: + field_dict["companyUserManager"] = company_user_manager + if members is not UNSET: + field_dict["members"] = members + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + + d = src_dict.copy() + _company_user_manager = d.pop("companyUserManager", UNSET) + company_user_manager: Union[Unset, None, CompanyUserBaseModel] + if _company_user_manager is None: + company_user_manager = None + elif isinstance(_company_user_manager, Unset): + company_user_manager = UNSET + else: + company_user_manager = CompanyUserBaseModel.from_dict(_company_user_manager) + + members = [] + _members = d.pop("members", UNSET) + for members_item_data in _members or []: + members_item = CompanyUserBaseModel.from_dict(members_item_data) + + members.append(members_item) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_subcontractor_group_model = cls( + company_user_manager=company_user_manager, + members=members, + id=id, + company_id=company_id, + name=name, + description=description, + links=links, + ) + + return company_subcontractor_group_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_tag_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_tag_base_model.py new file mode 100644 index 0000000..ab1f992 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_tag_base_model.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyTagBaseModel") + + +@_attrs_define +class CompanyTagBaseModel: + """ + Attributes: + company_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + name (Union[Unset, None, str]): + """ + + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + id = self.id + seo_id = self.seo_id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + seo_id = d.pop("seoId", UNSET) + + name = d.pop("name", UNSET) + + company_tag_base_model = cls( + company_id=company_id, + id=id, + seo_id=seo_id, + name=name, + ) + + return company_tag_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_tag_model.py b/src/cinode-py-client/cinode_api_client/models/company_tag_model.py new file mode 100644 index 0000000..2ace37e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_tag_model.py @@ -0,0 +1,86 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_tag_type_model import CompanyTagTypeModel + + +T = TypeVar("T", bound="CompanyTagModel") + + +@_attrs_define +class CompanyTagModel: + """ + Attributes: + tag_type (Union[Unset, None, CompanyTagTypeModel]): + company_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + name (Union[Unset, None, str]): + """ + + tag_type: Union[Unset, None, "CompanyTagTypeModel"] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + tag_type: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.tag_type, Unset): + tag_type = self.tag_type.to_dict() if self.tag_type else None + + company_id = self.company_id + id = self.id + seo_id = self.seo_id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if tag_type is not UNSET: + field_dict["tagType"] = tag_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_tag_type_model import CompanyTagTypeModel + + d = src_dict.copy() + _tag_type = d.pop("tagType", UNSET) + tag_type: Union[Unset, None, CompanyTagTypeModel] + if _tag_type is None: + tag_type = None + elif isinstance(_tag_type, Unset): + tag_type = UNSET + else: + tag_type = CompanyTagTypeModel.from_dict(_tag_type) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + seo_id = d.pop("seoId", UNSET) + + name = d.pop("name", UNSET) + + company_tag_model = cls( + tag_type=tag_type, + company_id=company_id, + id=id, + seo_id=seo_id, + name=name, + ) + + return company_tag_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_tag_type_model.py b/src/cinode-py-client/cinode_api_client/models/company_tag_type_model.py new file mode 100644 index 0000000..48be867 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_tag_type_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyTagTypeModel") + + +@_attrs_define +class CompanyTagTypeModel: + """ + Attributes: + id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + """ + + id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + company_tag_type_model = cls( + id=id, + name=name, + ) + + return company_tag_type_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_add_model.py new file mode 100644 index 0000000..17ab60a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_add_model.py @@ -0,0 +1,198 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_status import CompanyUserStatus +from ..models.user_gender import UserGender +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserAddModel") + + +@_attrs_define +class CompanyUserAddModel: + """ + Attributes: + email (str): + first_name (str): + last_name (str): + password (str): + confirm_password (str): + gender (UserGender): + + Ej angiven = 0 + + Man = 1 + + Kvinna = 2 + status (Union[Unset, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + team_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + language_id (Union[Unset, None, int]): + employment_number (Union[Unset, None, str]): + employment_start_date (Union[Unset, None, datetime.datetime]): + add_profile (Union[Unset, bool]): + location_id (Union[Unset, None, int]): + default_currency_id (Union[Unset, None, int]): + display_currency_id (Union[Unset, None, int]): + must_change_password (Union[Unset, bool]): + """ + + email: str + first_name: str + last_name: str + password: str + confirm_password: str + gender: UserGender + status: Union[Unset, CompanyUserStatus] = UNSET + team_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + language_id: Union[Unset, None, int] = UNSET + employment_number: Union[Unset, None, str] = UNSET + employment_start_date: Union[Unset, None, datetime.datetime] = UNSET + add_profile: Union[Unset, bool] = UNSET + location_id: Union[Unset, None, int] = UNSET + default_currency_id: Union[Unset, None, int] = UNSET + display_currency_id: Union[Unset, None, int] = UNSET + must_change_password: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + email = self.email + first_name = self.first_name + last_name = self.last_name + password = self.password + confirm_password = self.confirm_password + gender = self.gender.value + + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + team_id = self.team_id + title = self.title + language_id = self.language_id + employment_number = self.employment_number + employment_start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_start_date, Unset): + employment_start_date = self.employment_start_date.isoformat() if self.employment_start_date else None + + add_profile = self.add_profile + location_id = self.location_id + default_currency_id = self.default_currency_id + display_currency_id = self.display_currency_id + must_change_password = self.must_change_password + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "email": email, + "firstName": first_name, + "lastName": last_name, + "password": password, + "confirmPassword": confirm_password, + "gender": gender, + } + ) + if status is not UNSET: + field_dict["status"] = status + if team_id is not UNSET: + field_dict["teamId"] = team_id + if title is not UNSET: + field_dict["title"] = title + if language_id is not UNSET: + field_dict["languageId"] = language_id + if employment_number is not UNSET: + field_dict["employmentNumber"] = employment_number + if employment_start_date is not UNSET: + field_dict["employmentStartDate"] = employment_start_date + if add_profile is not UNSET: + field_dict["addProfile"] = add_profile + if location_id is not UNSET: + field_dict["locationId"] = location_id + if default_currency_id is not UNSET: + field_dict["defaultCurrencyId"] = default_currency_id + if display_currency_id is not UNSET: + field_dict["displayCurrencyId"] = display_currency_id + if must_change_password is not UNSET: + field_dict["mustChangePassword"] = must_change_password + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + email = d.pop("email") + + first_name = d.pop("firstName") + + last_name = d.pop("lastName") + + password = d.pop("password") + + confirm_password = d.pop("confirmPassword") + + gender = UserGender(d.pop("gender")) + + _status = d.pop("status", UNSET) + status: Union[Unset, CompanyUserStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + team_id = d.pop("teamId", UNSET) + + title = d.pop("title", UNSET) + + language_id = d.pop("languageId", UNSET) + + employment_number = d.pop("employmentNumber", UNSET) + + _employment_start_date = d.pop("employmentStartDate", UNSET) + employment_start_date: Union[Unset, None, datetime.datetime] + if _employment_start_date is None: + employment_start_date = None + elif isinstance(_employment_start_date, Unset): + employment_start_date = UNSET + else: + employment_start_date = isoparse(_employment_start_date) + + add_profile = d.pop("addProfile", UNSET) + + location_id = d.pop("locationId", UNSET) + + default_currency_id = d.pop("defaultCurrencyId", UNSET) + + display_currency_id = d.pop("displayCurrencyId", UNSET) + + must_change_password = d.pop("mustChangePassword", UNSET) + + company_user_add_model = cls( + email=email, + first_name=first_name, + last_name=last_name, + password=password, + confirm_password=confirm_password, + gender=gender, + status=status, + team_id=team_id, + title=title, + language_id=language_id, + employment_number=employment_number, + employment_start_date=employment_start_date, + add_profile=add_profile, + location_id=location_id, + default_currency_id=default_currency_id, + display_currency_id=display_currency_id, + must_change_password=must_change_password, + ) + + return company_user_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_base_model.py new file mode 100644 index 0000000..d001935 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_base_model.py @@ -0,0 +1,135 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserBaseModel") + + +@_attrs_define +class CompanyUserBaseModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_base_model = cls( + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_user_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_edit_model.py new file mode 100644 index 0000000..ef9c754 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_edit_model.py @@ -0,0 +1,302 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_status import CompanyUserStatus +from ..models.user_gender import UserGender +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserEditModel") + + +@_attrs_define +class CompanyUserEditModel: + """ + Attributes: + status (Union[Unset, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + employment_start_date (Union[Unset, None, datetime.datetime]): + employment_end_date (Union[Unset, None, datetime.datetime]): + employment_number (Union[Unset, None, str]): + invoicing_goal (Union[Unset, None, int]): + mobility (Union[Unset, None, int]): + availability_percent (Union[Unset, None, int]): + available_from_date (Union[Unset, None, datetime.datetime]): + title (Union[Unset, None, str]): + email (Union[Unset, None, str]): + tax_table (Union[Unset, None, str]): + base_salary (Union[Unset, None, int]): + provision (Union[Unset, None, int]): + hourly_target_rate (Union[Unset, None, int]): + self_cost (Union[Unset, None, int]): + location_id (Union[Unset, None, int]): + default_currency_id (Union[Unset, None, int]): + display_currency_id (Union[Unset, None, int]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + date_of_birth (Union[Unset, None, datetime.datetime]): + gender (Union[Unset, UserGender]): + + Ej angiven = 0 + + Man = 1 + + Kvinna = 2 + company_calendar_id (Union[Unset, None, int]): + timezone_id (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + """ + + status: Union[Unset, CompanyUserStatus] = UNSET + employment_start_date: Union[Unset, None, datetime.datetime] = UNSET + employment_end_date: Union[Unset, None, datetime.datetime] = UNSET + employment_number: Union[Unset, None, str] = UNSET + invoicing_goal: Union[Unset, None, int] = UNSET + mobility: Union[Unset, None, int] = UNSET + availability_percent: Union[Unset, None, int] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + title: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + tax_table: Union[Unset, None, str] = UNSET + base_salary: Union[Unset, None, int] = UNSET + provision: Union[Unset, None, int] = UNSET + hourly_target_rate: Union[Unset, None, int] = UNSET + self_cost: Union[Unset, None, int] = UNSET + location_id: Union[Unset, None, int] = UNSET + default_currency_id: Union[Unset, None, int] = UNSET + display_currency_id: Union[Unset, None, int] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + date_of_birth: Union[Unset, None, datetime.datetime] = UNSET + gender: Union[Unset, UserGender] = UNSET + company_calendar_id: Union[Unset, None, int] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + employment_start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_start_date, Unset): + employment_start_date = self.employment_start_date.isoformat() if self.employment_start_date else None + + employment_end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_end_date, Unset): + employment_end_date = self.employment_end_date.isoformat() if self.employment_end_date else None + + employment_number = self.employment_number + invoicing_goal = self.invoicing_goal + mobility = self.mobility + availability_percent = self.availability_percent + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + title = self.title + email = self.email + tax_table = self.tax_table + base_salary = self.base_salary + provision = self.provision + hourly_target_rate = self.hourly_target_rate + self_cost = self.self_cost + location_id = self.location_id + default_currency_id = self.default_currency_id + display_currency_id = self.display_currency_id + first_name = self.first_name + last_name = self.last_name + date_of_birth: Union[Unset, None, str] = UNSET + if not isinstance(self.date_of_birth, Unset): + date_of_birth = self.date_of_birth.isoformat() if self.date_of_birth else None + + gender: Union[Unset, int] = UNSET + if not isinstance(self.gender, Unset): + gender = self.gender.value + + company_calendar_id = self.company_calendar_id + timezone_id = self.timezone_id + phone = self.phone + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if status is not UNSET: + field_dict["status"] = status + if employment_start_date is not UNSET: + field_dict["employmentStartDate"] = employment_start_date + if employment_end_date is not UNSET: + field_dict["employmentEndDate"] = employment_end_date + if employment_number is not UNSET: + field_dict["employmentNumber"] = employment_number + if invoicing_goal is not UNSET: + field_dict["invoicingGoal"] = invoicing_goal + if mobility is not UNSET: + field_dict["mobility"] = mobility + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if title is not UNSET: + field_dict["title"] = title + if email is not UNSET: + field_dict["email"] = email + if tax_table is not UNSET: + field_dict["taxTable"] = tax_table + if base_salary is not UNSET: + field_dict["baseSalary"] = base_salary + if provision is not UNSET: + field_dict["provision"] = provision + if hourly_target_rate is not UNSET: + field_dict["hourlyTargetRate"] = hourly_target_rate + if self_cost is not UNSET: + field_dict["selfCost"] = self_cost + if location_id is not UNSET: + field_dict["locationId"] = location_id + if default_currency_id is not UNSET: + field_dict["defaultCurrencyId"] = default_currency_id + if display_currency_id is not UNSET: + field_dict["displayCurrencyId"] = display_currency_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if date_of_birth is not UNSET: + field_dict["dateOfBirth"] = date_of_birth + if gender is not UNSET: + field_dict["gender"] = gender + if company_calendar_id is not UNSET: + field_dict["companyCalendarId"] = company_calendar_id + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if phone is not UNSET: + field_dict["phone"] = phone + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _status = d.pop("status", UNSET) + status: Union[Unset, CompanyUserStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + _employment_start_date = d.pop("employmentStartDate", UNSET) + employment_start_date: Union[Unset, None, datetime.datetime] + if _employment_start_date is None: + employment_start_date = None + elif isinstance(_employment_start_date, Unset): + employment_start_date = UNSET + else: + employment_start_date = isoparse(_employment_start_date) + + _employment_end_date = d.pop("employmentEndDate", UNSET) + employment_end_date: Union[Unset, None, datetime.datetime] + if _employment_end_date is None: + employment_end_date = None + elif isinstance(_employment_end_date, Unset): + employment_end_date = UNSET + else: + employment_end_date = isoparse(_employment_end_date) + + employment_number = d.pop("employmentNumber", UNSET) + + invoicing_goal = d.pop("invoicingGoal", UNSET) + + mobility = d.pop("mobility", UNSET) + + availability_percent = d.pop("availabilityPercent", UNSET) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + title = d.pop("title", UNSET) + + email = d.pop("email", UNSET) + + tax_table = d.pop("taxTable", UNSET) + + base_salary = d.pop("baseSalary", UNSET) + + provision = d.pop("provision", UNSET) + + hourly_target_rate = d.pop("hourlyTargetRate", UNSET) + + self_cost = d.pop("selfCost", UNSET) + + location_id = d.pop("locationId", UNSET) + + default_currency_id = d.pop("defaultCurrencyId", UNSET) + + display_currency_id = d.pop("displayCurrencyId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _date_of_birth = d.pop("dateOfBirth", UNSET) + date_of_birth: Union[Unset, None, datetime.datetime] + if _date_of_birth is None: + date_of_birth = None + elif isinstance(_date_of_birth, Unset): + date_of_birth = UNSET + else: + date_of_birth = isoparse(_date_of_birth) + + _gender = d.pop("gender", UNSET) + gender: Union[Unset, UserGender] + if isinstance(_gender, Unset): + gender = UNSET + else: + gender = UserGender(_gender) + + company_calendar_id = d.pop("companyCalendarId", UNSET) + + timezone_id = d.pop("timezoneId", UNSET) + + phone = d.pop("phone", UNSET) + + company_user_edit_model = cls( + status=status, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + employment_number=employment_number, + invoicing_goal=invoicing_goal, + mobility=mobility, + availability_percent=availability_percent, + available_from_date=available_from_date, + title=title, + email=email, + tax_table=tax_table, + base_salary=base_salary, + provision=provision, + hourly_target_rate=hourly_target_rate, + self_cost=self_cost, + location_id=location_id, + default_currency_id=default_currency_id, + display_currency_id=display_currency_id, + first_name=first_name, + last_name=last_name, + date_of_birth=date_of_birth, + gender=gender, + company_calendar_id=company_calendar_id, + timezone_id=timezone_id, + phone=phone, + ) + + return company_user_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_base_model.py new file mode 100644 index 0000000..d45e782 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_base_model.py @@ -0,0 +1,141 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserEventBaseModel") + + +@_attrs_define +class CompanyUserEventBaseModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_event_base_model = cls( + company_user_id=company_user_id, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_user_event_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_add_edit_model.py new file mode 100644 index 0000000..72d2142 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_add_edit_model.py @@ -0,0 +1,180 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserEventMeetingAddEditModel") + + +@_attrs_define +class CompanyUserEventMeetingAddEditModel: + """ + Attributes: + title (str): + company_user_id (Union[Unset, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for StartDateTime and EndDateTime + properties. Valid timezone ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + company_user_id: Union[Unset, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + company_user_id = self.company_user_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + company_user_id = d.pop("companyUserId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + company_user_event_meeting_add_edit_model = cls( + title=title, + company_user_id=company_user_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return company_user_event_meeting_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_model.py new file mode 100644 index 0000000..8d11582 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_meeting_model.py @@ -0,0 +1,312 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserEventMeetingModel") + + +@_attrs_define +class CompanyUserEventMeetingModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + location (Union[Unset, None, str]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + location: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + location = self.location + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if location is not UNSET: + field_dict["location"] = location + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + location = d.pop("location", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_event_meeting_model = cls( + company_user_id=company_user_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + location=location, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_user_event_meeting_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_model.py new file mode 100644 index 0000000..47d2476 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_model.py @@ -0,0 +1,237 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserEventModel") + + +@_attrs_define +class CompanyUserEventModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_event_model = cls( + company_user_id=company_user_id, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_user_event_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_note_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_note_add_edit_model.py new file mode 100644 index 0000000..c46f3fa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_note_add_edit_model.py @@ -0,0 +1,156 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserEventNoteAddEditModel") + + +@_attrs_define +class CompanyUserEventNoteAddEditModel: + """ + Attributes: + title (str): + company_user_id (Union[Unset, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for NoteDate property. Valid timezone ids + can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + company_user_id: Union[Unset, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + company_user_id = self.company_user_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + timezone_id = self.timezone_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + company_user_id = d.pop("companyUserId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + timezone_id = d.pop("timezoneId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + company_user_event_note_add_edit_model = cls( + title=title, + company_user_id=company_user_id, + note_type=note_type, + note_date=note_date, + timezone_id=timezone_id, + type=type, + description=description, + visibility=visibility, + ) + + return company_user_event_note_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_note_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_note_model.py new file mode 100644 index 0000000..8d5df17 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_note_model.py @@ -0,0 +1,280 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserEventNoteModel") + + +@_attrs_define +class CompanyUserEventNoteModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_event_note_model = cls( + company_user_id=company_user_id, + note_type=note_type, + note_date=note_date, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_user_event_note_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_task_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_task_add_edit_model.py new file mode 100644 index 0000000..58aa25f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_task_add_edit_model.py @@ -0,0 +1,199 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserEventTaskAddEditModel") + + +@_attrs_define +class CompanyUserEventTaskAddEditModel: + """ + Attributes: + title (str): + company_user_id (Union[Unset, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for DueDateTime property. Valid timezone + ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + company_user_id: Union[Unset, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + company_user_id = self.company_user_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + company_user_id = d.pop("companyUserId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + company_user_event_task_add_edit_model = cls( + title=title, + company_user_id=company_user_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return company_user_event_task_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_event_task_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_event_task_model.py new file mode 100644 index 0000000..5619bd0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_event_task_model.py @@ -0,0 +1,323 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserEventTaskModel") + + +@_attrs_define +class CompanyUserEventTaskModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_event_task_model = cls( + company_user_id=company_user_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return company_user_event_task_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_extended_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_extended_model.py new file mode 100644 index 0000000..e7c76e0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_extended_model.py @@ -0,0 +1,330 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_status import CompanyUserStatus +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.link import Link + from ..models.location_model import LocationModel + + +T = TypeVar("T", bound="CompanyUserExtendedModel") + + +@_attrs_define +class CompanyUserExtendedModel: + """ + Attributes: + status (Union[Unset, None, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + title (Union[Unset, None, str]): + company_user_email (Union[Unset, None, str]): + created_date_time (Union[Unset, None, datetime.datetime]): + updated_date_time (Union[Unset, None, datetime.datetime]): + company_address (Union[Unset, None, CompanyAddressModel]): + home_address (Union[Unset, None, LocationModel]): + image (Union[Unset, None, CompanyUserImageModel]): + desired_assignment (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + twitter (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + blog (Union[Unset, None, str]): + git_hub (Union[Unset, None, str]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + status: Union[Unset, None, CompanyUserStatus] = UNSET + title: Union[Unset, None, str] = UNSET + company_user_email: Union[Unset, None, str] = UNSET + created_date_time: Union[Unset, None, datetime.datetime] = UNSET + updated_date_time: Union[Unset, None, datetime.datetime] = UNSET + company_address: Union[Unset, None, "CompanyAddressModel"] = UNSET + home_address: Union[Unset, None, "LocationModel"] = UNSET + image: Union[Unset, None, "CompanyUserImageModel"] = UNSET + desired_assignment: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + twitter: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + blog: Union[Unset, None, str] = UNSET + git_hub: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + title = self.title + company_user_email = self.company_user_email + created_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() if self.created_date_time else None + + updated_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_date_time, Unset): + updated_date_time = self.updated_date_time.isoformat() if self.updated_date_time else None + + company_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_address, Unset): + company_address = self.company_address.to_dict() if self.company_address else None + + home_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.home_address, Unset): + home_address = self.home_address.to_dict() if self.home_address else None + + image: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.image, Unset): + image = self.image.to_dict() if self.image else None + + desired_assignment = self.desired_assignment + internal_identifier = self.internal_identifier + twitter = self.twitter + linked_in = self.linked_in + homepage = self.homepage + blog = self.blog + git_hub = self.git_hub + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if status is not UNSET: + field_dict["status"] = status + if title is not UNSET: + field_dict["title"] = title + if company_user_email is not UNSET: + field_dict["companyUserEmail"] = company_user_email + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if updated_date_time is not UNSET: + field_dict["updatedDateTime"] = updated_date_time + if company_address is not UNSET: + field_dict["companyAddress"] = company_address + if home_address is not UNSET: + field_dict["homeAddress"] = home_address + if image is not UNSET: + field_dict["image"] = image + if desired_assignment is not UNSET: + field_dict["desiredAssignment"] = desired_assignment + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if twitter is not UNSET: + field_dict["twitter"] = twitter + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if homepage is not UNSET: + field_dict["homepage"] = homepage + if blog is not UNSET: + field_dict["blog"] = blog + if git_hub is not UNSET: + field_dict["gitHub"] = git_hub + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.link import Link + from ..models.location_model import LocationModel + + d = src_dict.copy() + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + title = d.pop("title", UNSET) + + company_user_email = d.pop("companyUserEmail", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, None, datetime.datetime] + if _created_date_time is None: + created_date_time = None + elif isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _updated_date_time = d.pop("updatedDateTime", UNSET) + updated_date_time: Union[Unset, None, datetime.datetime] + if _updated_date_time is None: + updated_date_time = None + elif isinstance(_updated_date_time, Unset): + updated_date_time = UNSET + else: + updated_date_time = isoparse(_updated_date_time) + + _company_address = d.pop("companyAddress", UNSET) + company_address: Union[Unset, None, CompanyAddressModel] + if _company_address is None: + company_address = None + elif isinstance(_company_address, Unset): + company_address = UNSET + else: + company_address = CompanyAddressModel.from_dict(_company_address) + + _home_address = d.pop("homeAddress", UNSET) + home_address: Union[Unset, None, LocationModel] + if _home_address is None: + home_address = None + elif isinstance(_home_address, Unset): + home_address = UNSET + else: + home_address = LocationModel.from_dict(_home_address) + + _image = d.pop("image", UNSET) + image: Union[Unset, None, CompanyUserImageModel] + if _image is None: + image = None + elif isinstance(_image, Unset): + image = UNSET + else: + image = CompanyUserImageModel.from_dict(_image) + + desired_assignment = d.pop("desiredAssignment", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + twitter = d.pop("twitter", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + homepage = d.pop("homepage", UNSET) + + blog = d.pop("blog", UNSET) + + git_hub = d.pop("gitHub", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_extended_model = cls( + status=status, + title=title, + company_user_email=company_user_email, + created_date_time=created_date_time, + updated_date_time=updated_date_time, + company_address=company_address, + home_address=home_address, + image=image, + desired_assignment=desired_assignment, + internal_identifier=internal_identifier, + twitter=twitter, + linked_in=linked_in, + homepage=homepage, + blog=blog, + git_hub=git_hub, + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_user_extended_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_full_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_full_model.py new file mode 100644 index 0000000..8a9d95a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_full_model.py @@ -0,0 +1,685 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_status import CompanyUserStatus +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.absence_period_model import AbsencePeriodModel + from ..models.company_address_model import CompanyAddressModel + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_model import CompanyTagModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.company_user_resume_base_model import CompanyUserResumeBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.location_model import LocationModel + from ..models.role_model import RoleModel + from ..models.team_manager_model import TeamManagerModel + from ..models.team_member_model import TeamMemberModel + + +T = TypeVar("T", bound="CompanyUserFullModel") + + +@_attrs_define +class CompanyUserFullModel: + """ + Attributes: + invoicing_goal (Union[Unset, None, int]): + tax_table (Union[Unset, None, str]): + base_salary (Union[Unset, None, int]): + provision (Union[Unset, None, int]): + hourly_target_rate (Union[Unset, None, int]): + self_cost (Union[Unset, None, int]): + employment_start_date (Union[Unset, None, datetime.datetime]): + employment_end_date (Union[Unset, None, datetime.datetime]): + employment_number (Union[Unset, None, str]): + availability_percent (Union[Unset, None, int]): + available_from_date (Union[Unset, None, datetime.datetime]): + mobility (Union[Unset, None, int]): + location_name (Union[Unset, None, str]): + resumes (Union[Unset, None, List['CompanyUserResumeBaseModel']]): + roles (Union[Unset, None, List['RoleModel']]): + team_managers (Union[Unset, None, List['TeamManagerModel']]): + team_members (Union[Unset, None, List['TeamMemberModel']]): + customer_managers (Union[Unset, None, List['CompanyCustomerManagerModel']]): + periods (Union[Unset, None, List['AbsencePeriodModel']]): + default_currency (Union[Unset, None, CurrencyModel]): + phone (Union[Unset, None, str]): + date_of_birth (Union[Unset, None, datetime.datetime]): + tags (Union[Unset, None, List['CompanyTagModel']]): + status (Union[Unset, None, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + title (Union[Unset, None, str]): + company_user_email (Union[Unset, None, str]): + created_date_time (Union[Unset, None, datetime.datetime]): + updated_date_time (Union[Unset, None, datetime.datetime]): + company_address (Union[Unset, None, CompanyAddressModel]): + home_address (Union[Unset, None, LocationModel]): + image (Union[Unset, None, CompanyUserImageModel]): + desired_assignment (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + twitter (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + blog (Union[Unset, None, str]): + git_hub (Union[Unset, None, str]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + invoicing_goal: Union[Unset, None, int] = UNSET + tax_table: Union[Unset, None, str] = UNSET + base_salary: Union[Unset, None, int] = UNSET + provision: Union[Unset, None, int] = UNSET + hourly_target_rate: Union[Unset, None, int] = UNSET + self_cost: Union[Unset, None, int] = UNSET + employment_start_date: Union[Unset, None, datetime.datetime] = UNSET + employment_end_date: Union[Unset, None, datetime.datetime] = UNSET + employment_number: Union[Unset, None, str] = UNSET + availability_percent: Union[Unset, None, int] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + mobility: Union[Unset, None, int] = UNSET + location_name: Union[Unset, None, str] = UNSET + resumes: Union[Unset, None, List["CompanyUserResumeBaseModel"]] = UNSET + roles: Union[Unset, None, List["RoleModel"]] = UNSET + team_managers: Union[Unset, None, List["TeamManagerModel"]] = UNSET + team_members: Union[Unset, None, List["TeamMemberModel"]] = UNSET + customer_managers: Union[Unset, None, List["CompanyCustomerManagerModel"]] = UNSET + periods: Union[Unset, None, List["AbsencePeriodModel"]] = UNSET + default_currency: Union[Unset, None, "CurrencyModel"] = UNSET + phone: Union[Unset, None, str] = UNSET + date_of_birth: Union[Unset, None, datetime.datetime] = UNSET + tags: Union[Unset, None, List["CompanyTagModel"]] = UNSET + status: Union[Unset, None, CompanyUserStatus] = UNSET + title: Union[Unset, None, str] = UNSET + company_user_email: Union[Unset, None, str] = UNSET + created_date_time: Union[Unset, None, datetime.datetime] = UNSET + updated_date_time: Union[Unset, None, datetime.datetime] = UNSET + company_address: Union[Unset, None, "CompanyAddressModel"] = UNSET + home_address: Union[Unset, None, "LocationModel"] = UNSET + image: Union[Unset, None, "CompanyUserImageModel"] = UNSET + desired_assignment: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + twitter: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + blog: Union[Unset, None, str] = UNSET + git_hub: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + invoicing_goal = self.invoicing_goal + tax_table = self.tax_table + base_salary = self.base_salary + provision = self.provision + hourly_target_rate = self.hourly_target_rate + self_cost = self.self_cost + employment_start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_start_date, Unset): + employment_start_date = self.employment_start_date.isoformat() if self.employment_start_date else None + + employment_end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_end_date, Unset): + employment_end_date = self.employment_end_date.isoformat() if self.employment_end_date else None + + employment_number = self.employment_number + availability_percent = self.availability_percent + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + mobility = self.mobility + location_name = self.location_name + resumes: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.resumes, Unset): + if self.resumes is None: + resumes = None + else: + resumes = [] + for resumes_item_data in self.resumes: + resumes_item = resumes_item_data.to_dict() + + resumes.append(resumes_item) + + roles: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.roles, Unset): + if self.roles is None: + roles = None + else: + roles = [] + for roles_item_data in self.roles: + roles_item = roles_item_data.to_dict() + + roles.append(roles_item) + + team_managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.team_managers, Unset): + if self.team_managers is None: + team_managers = None + else: + team_managers = [] + for team_managers_item_data in self.team_managers: + team_managers_item = team_managers_item_data.to_dict() + + team_managers.append(team_managers_item) + + team_members: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.team_members, Unset): + if self.team_members is None: + team_members = None + else: + team_members = [] + for team_members_item_data in self.team_members: + team_members_item = team_members_item_data.to_dict() + + team_members.append(team_members_item) + + customer_managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.customer_managers, Unset): + if self.customer_managers is None: + customer_managers = None + else: + customer_managers = [] + for customer_managers_item_data in self.customer_managers: + customer_managers_item = customer_managers_item_data.to_dict() + + customer_managers.append(customer_managers_item) + + periods: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.periods, Unset): + if self.periods is None: + periods = None + else: + periods = [] + for periods_item_data in self.periods: + periods_item = periods_item_data.to_dict() + + periods.append(periods_item) + + default_currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.default_currency, Unset): + default_currency = self.default_currency.to_dict() if self.default_currency else None + + phone = self.phone + date_of_birth: Union[Unset, None, str] = UNSET + if not isinstance(self.date_of_birth, Unset): + date_of_birth = self.date_of_birth.isoformat() if self.date_of_birth else None + + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + title = self.title + company_user_email = self.company_user_email + created_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() if self.created_date_time else None + + updated_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_date_time, Unset): + updated_date_time = self.updated_date_time.isoformat() if self.updated_date_time else None + + company_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_address, Unset): + company_address = self.company_address.to_dict() if self.company_address else None + + home_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.home_address, Unset): + home_address = self.home_address.to_dict() if self.home_address else None + + image: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.image, Unset): + image = self.image.to_dict() if self.image else None + + desired_assignment = self.desired_assignment + internal_identifier = self.internal_identifier + twitter = self.twitter + linked_in = self.linked_in + homepage = self.homepage + blog = self.blog + git_hub = self.git_hub + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if invoicing_goal is not UNSET: + field_dict["invoicingGoal"] = invoicing_goal + if tax_table is not UNSET: + field_dict["taxTable"] = tax_table + if base_salary is not UNSET: + field_dict["baseSalary"] = base_salary + if provision is not UNSET: + field_dict["provision"] = provision + if hourly_target_rate is not UNSET: + field_dict["hourlyTargetRate"] = hourly_target_rate + if self_cost is not UNSET: + field_dict["selfCost"] = self_cost + if employment_start_date is not UNSET: + field_dict["employmentStartDate"] = employment_start_date + if employment_end_date is not UNSET: + field_dict["employmentEndDate"] = employment_end_date + if employment_number is not UNSET: + field_dict["employmentNumber"] = employment_number + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if mobility is not UNSET: + field_dict["mobility"] = mobility + if location_name is not UNSET: + field_dict["locationName"] = location_name + if resumes is not UNSET: + field_dict["resumes"] = resumes + if roles is not UNSET: + field_dict["roles"] = roles + if team_managers is not UNSET: + field_dict["teamManagers"] = team_managers + if team_members is not UNSET: + field_dict["teamMembers"] = team_members + if customer_managers is not UNSET: + field_dict["customerManagers"] = customer_managers + if periods is not UNSET: + field_dict["periods"] = periods + if default_currency is not UNSET: + field_dict["defaultCurrency"] = default_currency + if phone is not UNSET: + field_dict["phone"] = phone + if date_of_birth is not UNSET: + field_dict["dateOfBirth"] = date_of_birth + if tags is not UNSET: + field_dict["tags"] = tags + if status is not UNSET: + field_dict["status"] = status + if title is not UNSET: + field_dict["title"] = title + if company_user_email is not UNSET: + field_dict["companyUserEmail"] = company_user_email + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if updated_date_time is not UNSET: + field_dict["updatedDateTime"] = updated_date_time + if company_address is not UNSET: + field_dict["companyAddress"] = company_address + if home_address is not UNSET: + field_dict["homeAddress"] = home_address + if image is not UNSET: + field_dict["image"] = image + if desired_assignment is not UNSET: + field_dict["desiredAssignment"] = desired_assignment + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if twitter is not UNSET: + field_dict["twitter"] = twitter + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if homepage is not UNSET: + field_dict["homepage"] = homepage + if blog is not UNSET: + field_dict["blog"] = blog + if git_hub is not UNSET: + field_dict["gitHub"] = git_hub + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.absence_period_model import AbsencePeriodModel + from ..models.company_address_model import CompanyAddressModel + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_model import CompanyTagModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.company_user_resume_base_model import CompanyUserResumeBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.location_model import LocationModel + from ..models.role_model import RoleModel + from ..models.team_manager_model import TeamManagerModel + from ..models.team_member_model import TeamMemberModel + + d = src_dict.copy() + invoicing_goal = d.pop("invoicingGoal", UNSET) + + tax_table = d.pop("taxTable", UNSET) + + base_salary = d.pop("baseSalary", UNSET) + + provision = d.pop("provision", UNSET) + + hourly_target_rate = d.pop("hourlyTargetRate", UNSET) + + self_cost = d.pop("selfCost", UNSET) + + _employment_start_date = d.pop("employmentStartDate", UNSET) + employment_start_date: Union[Unset, None, datetime.datetime] + if _employment_start_date is None: + employment_start_date = None + elif isinstance(_employment_start_date, Unset): + employment_start_date = UNSET + else: + employment_start_date = isoparse(_employment_start_date) + + _employment_end_date = d.pop("employmentEndDate", UNSET) + employment_end_date: Union[Unset, None, datetime.datetime] + if _employment_end_date is None: + employment_end_date = None + elif isinstance(_employment_end_date, Unset): + employment_end_date = UNSET + else: + employment_end_date = isoparse(_employment_end_date) + + employment_number = d.pop("employmentNumber", UNSET) + + availability_percent = d.pop("availabilityPercent", UNSET) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + mobility = d.pop("mobility", UNSET) + + location_name = d.pop("locationName", UNSET) + + resumes = [] + _resumes = d.pop("resumes", UNSET) + for resumes_item_data in _resumes or []: + resumes_item = CompanyUserResumeBaseModel.from_dict(resumes_item_data) + + resumes.append(resumes_item) + + roles = [] + _roles = d.pop("roles", UNSET) + for roles_item_data in _roles or []: + roles_item = RoleModel.from_dict(roles_item_data) + + roles.append(roles_item) + + team_managers = [] + _team_managers = d.pop("teamManagers", UNSET) + for team_managers_item_data in _team_managers or []: + team_managers_item = TeamManagerModel.from_dict(team_managers_item_data) + + team_managers.append(team_managers_item) + + team_members = [] + _team_members = d.pop("teamMembers", UNSET) + for team_members_item_data in _team_members or []: + team_members_item = TeamMemberModel.from_dict(team_members_item_data) + + team_members.append(team_members_item) + + customer_managers = [] + _customer_managers = d.pop("customerManagers", UNSET) + for customer_managers_item_data in _customer_managers or []: + customer_managers_item = CompanyCustomerManagerModel.from_dict(customer_managers_item_data) + + customer_managers.append(customer_managers_item) + + periods = [] + _periods = d.pop("periods", UNSET) + for periods_item_data in _periods or []: + periods_item = AbsencePeriodModel.from_dict(periods_item_data) + + periods.append(periods_item) + + _default_currency = d.pop("defaultCurrency", UNSET) + default_currency: Union[Unset, None, CurrencyModel] + if _default_currency is None: + default_currency = None + elif isinstance(_default_currency, Unset): + default_currency = UNSET + else: + default_currency = CurrencyModel.from_dict(_default_currency) + + phone = d.pop("phone", UNSET) + + _date_of_birth = d.pop("dateOfBirth", UNSET) + date_of_birth: Union[Unset, None, datetime.datetime] + if _date_of_birth is None: + date_of_birth = None + elif isinstance(_date_of_birth, Unset): + date_of_birth = UNSET + else: + date_of_birth = isoparse(_date_of_birth) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagModel.from_dict(tags_item_data) + + tags.append(tags_item) + + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + title = d.pop("title", UNSET) + + company_user_email = d.pop("companyUserEmail", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, None, datetime.datetime] + if _created_date_time is None: + created_date_time = None + elif isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _updated_date_time = d.pop("updatedDateTime", UNSET) + updated_date_time: Union[Unset, None, datetime.datetime] + if _updated_date_time is None: + updated_date_time = None + elif isinstance(_updated_date_time, Unset): + updated_date_time = UNSET + else: + updated_date_time = isoparse(_updated_date_time) + + _company_address = d.pop("companyAddress", UNSET) + company_address: Union[Unset, None, CompanyAddressModel] + if _company_address is None: + company_address = None + elif isinstance(_company_address, Unset): + company_address = UNSET + else: + company_address = CompanyAddressModel.from_dict(_company_address) + + _home_address = d.pop("homeAddress", UNSET) + home_address: Union[Unset, None, LocationModel] + if _home_address is None: + home_address = None + elif isinstance(_home_address, Unset): + home_address = UNSET + else: + home_address = LocationModel.from_dict(_home_address) + + _image = d.pop("image", UNSET) + image: Union[Unset, None, CompanyUserImageModel] + if _image is None: + image = None + elif isinstance(_image, Unset): + image = UNSET + else: + image = CompanyUserImageModel.from_dict(_image) + + desired_assignment = d.pop("desiredAssignment", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + twitter = d.pop("twitter", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + homepage = d.pop("homepage", UNSET) + + blog = d.pop("blog", UNSET) + + git_hub = d.pop("gitHub", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_full_model = cls( + invoicing_goal=invoicing_goal, + tax_table=tax_table, + base_salary=base_salary, + provision=provision, + hourly_target_rate=hourly_target_rate, + self_cost=self_cost, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + employment_number=employment_number, + availability_percent=availability_percent, + available_from_date=available_from_date, + mobility=mobility, + location_name=location_name, + resumes=resumes, + roles=roles, + team_managers=team_managers, + team_members=team_members, + customer_managers=customer_managers, + periods=periods, + default_currency=default_currency, + phone=phone, + date_of_birth=date_of_birth, + tags=tags, + status=status, + title=title, + company_user_email=company_user_email, + created_date_time=created_date_time, + updated_date_time=updated_date_time, + company_address=company_address, + home_address=home_address, + image=image, + desired_assignment=desired_assignment, + internal_identifier=internal_identifier, + twitter=twitter, + linked_in=linked_in, + homepage=homepage, + blog=blog, + git_hub=git_hub, + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_user_full_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_image_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_image_model.py new file mode 100644 index 0000000..373ff88 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_image_model.py @@ -0,0 +1,108 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserImageModel") + + +@_attrs_define +class CompanyUserImageModel: + """ + Attributes: + image_id (Union[Unset, int]): + company_id (Union[Unset, int]): + url (Union[Unset, None, str]): + large_image_url (Union[Unset, None, str]): + uploaded_when (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + image_id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + url: Union[Unset, None, str] = UNSET + large_image_url: Union[Unset, None, str] = UNSET + uploaded_when: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + image_id = self.image_id + company_id = self.company_id + url = self.url + large_image_url = self.large_image_url + uploaded_when: Union[Unset, str] = UNSET + if not isinstance(self.uploaded_when, Unset): + uploaded_when = self.uploaded_when.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if image_id is not UNSET: + field_dict["imageId"] = image_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if url is not UNSET: + field_dict["url"] = url + if large_image_url is not UNSET: + field_dict["largeImageUrl"] = large_image_url + if uploaded_when is not UNSET: + field_dict["uploadedWhen"] = uploaded_when + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + image_id = d.pop("imageId", UNSET) + + company_id = d.pop("companyId", UNSET) + + url = d.pop("url", UNSET) + + large_image_url = d.pop("largeImageUrl", UNSET) + + _uploaded_when = d.pop("uploadedWhen", UNSET) + uploaded_when: Union[Unset, datetime.datetime] + if isinstance(_uploaded_when, Unset): + uploaded_when = UNSET + else: + uploaded_when = isoparse(_uploaded_when) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_image_model = cls( + image_id=image_id, + company_id=company_id, + url=url, + large_image_url=large_image_url, + uploaded_when=uploaded_when, + links=links, + ) + + return company_user_image_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_info_block_view_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_info_block_view_model.py new file mode 100644 index 0000000..da47654 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_info_block_view_model.py @@ -0,0 +1,70 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.address_info_block_view_model import AddressInfoBlockViewModel + + +T = TypeVar("T", bound="CompanyUserInfoBlockViewModel") + + +@_attrs_define +class CompanyUserInfoBlockViewModel: + """ + Attributes: + address (Union[Unset, None, AddressInfoBlockViewModel]): + email (Union[Unset, None, str]): + title (Union[Unset, None, str]): + """ + + address: Union[Unset, None, "AddressInfoBlockViewModel"] = UNSET + email: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.address, Unset): + address = self.address.to_dict() if self.address else None + + email = self.email + title = self.title + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if address is not UNSET: + field_dict["address"] = address + if email is not UNSET: + field_dict["email"] = email + if title is not UNSET: + field_dict["title"] = title + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.address_info_block_view_model import AddressInfoBlockViewModel + + d = src_dict.copy() + _address = d.pop("address", UNSET) + address: Union[Unset, None, AddressInfoBlockViewModel] + if _address is None: + address = None + elif isinstance(_address, Unset): + address = UNSET + else: + address = AddressInfoBlockViewModel.from_dict(_address) + + email = d.pop("email", UNSET) + + title = d.pop("title", UNSET) + + company_user_info_block_view_model = cls( + address=address, + email=email, + title=title, + ) + + return company_user_info_block_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_model.py new file mode 100644 index 0000000..d196f19 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_model.py @@ -0,0 +1,637 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_status import CompanyUserStatus +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.absence_period_model import AbsencePeriodModel + from ..models.company_address_model import CompanyAddressModel + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_model import CompanyTagModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.company_user_resume_base_model import CompanyUserResumeBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.location_model import LocationModel + from ..models.role_model import RoleModel + from ..models.team_manager_model import TeamManagerModel + from ..models.team_member_model import TeamMemberModel + + +T = TypeVar("T", bound="CompanyUserModel") + + +@_attrs_define +class CompanyUserModel: + """ + Attributes: + employment_start_date (Union[Unset, None, datetime.datetime]): + employment_end_date (Union[Unset, None, datetime.datetime]): + employment_number (Union[Unset, None, str]): + availability_percent (Union[Unset, None, int]): + available_from_date (Union[Unset, None, datetime.datetime]): + mobility (Union[Unset, None, int]): + location_name (Union[Unset, None, str]): + resumes (Union[Unset, None, List['CompanyUserResumeBaseModel']]): + roles (Union[Unset, None, List['RoleModel']]): + team_managers (Union[Unset, None, List['TeamManagerModel']]): + team_members (Union[Unset, None, List['TeamMemberModel']]): + customer_managers (Union[Unset, None, List['CompanyCustomerManagerModel']]): + periods (Union[Unset, None, List['AbsencePeriodModel']]): + default_currency (Union[Unset, None, CurrencyModel]): + phone (Union[Unset, None, str]): + date_of_birth (Union[Unset, None, datetime.datetime]): + tags (Union[Unset, None, List['CompanyTagModel']]): + status (Union[Unset, None, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + title (Union[Unset, None, str]): + company_user_email (Union[Unset, None, str]): + created_date_time (Union[Unset, None, datetime.datetime]): + updated_date_time (Union[Unset, None, datetime.datetime]): + company_address (Union[Unset, None, CompanyAddressModel]): + home_address (Union[Unset, None, LocationModel]): + image (Union[Unset, None, CompanyUserImageModel]): + desired_assignment (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + twitter (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + blog (Union[Unset, None, str]): + git_hub (Union[Unset, None, str]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + employment_start_date: Union[Unset, None, datetime.datetime] = UNSET + employment_end_date: Union[Unset, None, datetime.datetime] = UNSET + employment_number: Union[Unset, None, str] = UNSET + availability_percent: Union[Unset, None, int] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + mobility: Union[Unset, None, int] = UNSET + location_name: Union[Unset, None, str] = UNSET + resumes: Union[Unset, None, List["CompanyUserResumeBaseModel"]] = UNSET + roles: Union[Unset, None, List["RoleModel"]] = UNSET + team_managers: Union[Unset, None, List["TeamManagerModel"]] = UNSET + team_members: Union[Unset, None, List["TeamMemberModel"]] = UNSET + customer_managers: Union[Unset, None, List["CompanyCustomerManagerModel"]] = UNSET + periods: Union[Unset, None, List["AbsencePeriodModel"]] = UNSET + default_currency: Union[Unset, None, "CurrencyModel"] = UNSET + phone: Union[Unset, None, str] = UNSET + date_of_birth: Union[Unset, None, datetime.datetime] = UNSET + tags: Union[Unset, None, List["CompanyTagModel"]] = UNSET + status: Union[Unset, None, CompanyUserStatus] = UNSET + title: Union[Unset, None, str] = UNSET + company_user_email: Union[Unset, None, str] = UNSET + created_date_time: Union[Unset, None, datetime.datetime] = UNSET + updated_date_time: Union[Unset, None, datetime.datetime] = UNSET + company_address: Union[Unset, None, "CompanyAddressModel"] = UNSET + home_address: Union[Unset, None, "LocationModel"] = UNSET + image: Union[Unset, None, "CompanyUserImageModel"] = UNSET + desired_assignment: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + twitter: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + blog: Union[Unset, None, str] = UNSET + git_hub: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + employment_start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_start_date, Unset): + employment_start_date = self.employment_start_date.isoformat() if self.employment_start_date else None + + employment_end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_end_date, Unset): + employment_end_date = self.employment_end_date.isoformat() if self.employment_end_date else None + + employment_number = self.employment_number + availability_percent = self.availability_percent + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + mobility = self.mobility + location_name = self.location_name + resumes: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.resumes, Unset): + if self.resumes is None: + resumes = None + else: + resumes = [] + for resumes_item_data in self.resumes: + resumes_item = resumes_item_data.to_dict() + + resumes.append(resumes_item) + + roles: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.roles, Unset): + if self.roles is None: + roles = None + else: + roles = [] + for roles_item_data in self.roles: + roles_item = roles_item_data.to_dict() + + roles.append(roles_item) + + team_managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.team_managers, Unset): + if self.team_managers is None: + team_managers = None + else: + team_managers = [] + for team_managers_item_data in self.team_managers: + team_managers_item = team_managers_item_data.to_dict() + + team_managers.append(team_managers_item) + + team_members: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.team_members, Unset): + if self.team_members is None: + team_members = None + else: + team_members = [] + for team_members_item_data in self.team_members: + team_members_item = team_members_item_data.to_dict() + + team_members.append(team_members_item) + + customer_managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.customer_managers, Unset): + if self.customer_managers is None: + customer_managers = None + else: + customer_managers = [] + for customer_managers_item_data in self.customer_managers: + customer_managers_item = customer_managers_item_data.to_dict() + + customer_managers.append(customer_managers_item) + + periods: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.periods, Unset): + if self.periods is None: + periods = None + else: + periods = [] + for periods_item_data in self.periods: + periods_item = periods_item_data.to_dict() + + periods.append(periods_item) + + default_currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.default_currency, Unset): + default_currency = self.default_currency.to_dict() if self.default_currency else None + + phone = self.phone + date_of_birth: Union[Unset, None, str] = UNSET + if not isinstance(self.date_of_birth, Unset): + date_of_birth = self.date_of_birth.isoformat() if self.date_of_birth else None + + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + title = self.title + company_user_email = self.company_user_email + created_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() if self.created_date_time else None + + updated_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_date_time, Unset): + updated_date_time = self.updated_date_time.isoformat() if self.updated_date_time else None + + company_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_address, Unset): + company_address = self.company_address.to_dict() if self.company_address else None + + home_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.home_address, Unset): + home_address = self.home_address.to_dict() if self.home_address else None + + image: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.image, Unset): + image = self.image.to_dict() if self.image else None + + desired_assignment = self.desired_assignment + internal_identifier = self.internal_identifier + twitter = self.twitter + linked_in = self.linked_in + homepage = self.homepage + blog = self.blog + git_hub = self.git_hub + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if employment_start_date is not UNSET: + field_dict["employmentStartDate"] = employment_start_date + if employment_end_date is not UNSET: + field_dict["employmentEndDate"] = employment_end_date + if employment_number is not UNSET: + field_dict["employmentNumber"] = employment_number + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if mobility is not UNSET: + field_dict["mobility"] = mobility + if location_name is not UNSET: + field_dict["locationName"] = location_name + if resumes is not UNSET: + field_dict["resumes"] = resumes + if roles is not UNSET: + field_dict["roles"] = roles + if team_managers is not UNSET: + field_dict["teamManagers"] = team_managers + if team_members is not UNSET: + field_dict["teamMembers"] = team_members + if customer_managers is not UNSET: + field_dict["customerManagers"] = customer_managers + if periods is not UNSET: + field_dict["periods"] = periods + if default_currency is not UNSET: + field_dict["defaultCurrency"] = default_currency + if phone is not UNSET: + field_dict["phone"] = phone + if date_of_birth is not UNSET: + field_dict["dateOfBirth"] = date_of_birth + if tags is not UNSET: + field_dict["tags"] = tags + if status is not UNSET: + field_dict["status"] = status + if title is not UNSET: + field_dict["title"] = title + if company_user_email is not UNSET: + field_dict["companyUserEmail"] = company_user_email + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if updated_date_time is not UNSET: + field_dict["updatedDateTime"] = updated_date_time + if company_address is not UNSET: + field_dict["companyAddress"] = company_address + if home_address is not UNSET: + field_dict["homeAddress"] = home_address + if image is not UNSET: + field_dict["image"] = image + if desired_assignment is not UNSET: + field_dict["desiredAssignment"] = desired_assignment + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if twitter is not UNSET: + field_dict["twitter"] = twitter + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if homepage is not UNSET: + field_dict["homepage"] = homepage + if blog is not UNSET: + field_dict["blog"] = blog + if git_hub is not UNSET: + field_dict["gitHub"] = git_hub + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.absence_period_model import AbsencePeriodModel + from ..models.company_address_model import CompanyAddressModel + from ..models.company_customer_manager_model import CompanyCustomerManagerModel + from ..models.company_tag_model import CompanyTagModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.company_user_resume_base_model import CompanyUserResumeBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.location_model import LocationModel + from ..models.role_model import RoleModel + from ..models.team_manager_model import TeamManagerModel + from ..models.team_member_model import TeamMemberModel + + d = src_dict.copy() + _employment_start_date = d.pop("employmentStartDate", UNSET) + employment_start_date: Union[Unset, None, datetime.datetime] + if _employment_start_date is None: + employment_start_date = None + elif isinstance(_employment_start_date, Unset): + employment_start_date = UNSET + else: + employment_start_date = isoparse(_employment_start_date) + + _employment_end_date = d.pop("employmentEndDate", UNSET) + employment_end_date: Union[Unset, None, datetime.datetime] + if _employment_end_date is None: + employment_end_date = None + elif isinstance(_employment_end_date, Unset): + employment_end_date = UNSET + else: + employment_end_date = isoparse(_employment_end_date) + + employment_number = d.pop("employmentNumber", UNSET) + + availability_percent = d.pop("availabilityPercent", UNSET) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + mobility = d.pop("mobility", UNSET) + + location_name = d.pop("locationName", UNSET) + + resumes = [] + _resumes = d.pop("resumes", UNSET) + for resumes_item_data in _resumes or []: + resumes_item = CompanyUserResumeBaseModel.from_dict(resumes_item_data) + + resumes.append(resumes_item) + + roles = [] + _roles = d.pop("roles", UNSET) + for roles_item_data in _roles or []: + roles_item = RoleModel.from_dict(roles_item_data) + + roles.append(roles_item) + + team_managers = [] + _team_managers = d.pop("teamManagers", UNSET) + for team_managers_item_data in _team_managers or []: + team_managers_item = TeamManagerModel.from_dict(team_managers_item_data) + + team_managers.append(team_managers_item) + + team_members = [] + _team_members = d.pop("teamMembers", UNSET) + for team_members_item_data in _team_members or []: + team_members_item = TeamMemberModel.from_dict(team_members_item_data) + + team_members.append(team_members_item) + + customer_managers = [] + _customer_managers = d.pop("customerManagers", UNSET) + for customer_managers_item_data in _customer_managers or []: + customer_managers_item = CompanyCustomerManagerModel.from_dict(customer_managers_item_data) + + customer_managers.append(customer_managers_item) + + periods = [] + _periods = d.pop("periods", UNSET) + for periods_item_data in _periods or []: + periods_item = AbsencePeriodModel.from_dict(periods_item_data) + + periods.append(periods_item) + + _default_currency = d.pop("defaultCurrency", UNSET) + default_currency: Union[Unset, None, CurrencyModel] + if _default_currency is None: + default_currency = None + elif isinstance(_default_currency, Unset): + default_currency = UNSET + else: + default_currency = CurrencyModel.from_dict(_default_currency) + + phone = d.pop("phone", UNSET) + + _date_of_birth = d.pop("dateOfBirth", UNSET) + date_of_birth: Union[Unset, None, datetime.datetime] + if _date_of_birth is None: + date_of_birth = None + elif isinstance(_date_of_birth, Unset): + date_of_birth = UNSET + else: + date_of_birth = isoparse(_date_of_birth) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagModel.from_dict(tags_item_data) + + tags.append(tags_item) + + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + title = d.pop("title", UNSET) + + company_user_email = d.pop("companyUserEmail", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, None, datetime.datetime] + if _created_date_time is None: + created_date_time = None + elif isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _updated_date_time = d.pop("updatedDateTime", UNSET) + updated_date_time: Union[Unset, None, datetime.datetime] + if _updated_date_time is None: + updated_date_time = None + elif isinstance(_updated_date_time, Unset): + updated_date_time = UNSET + else: + updated_date_time = isoparse(_updated_date_time) + + _company_address = d.pop("companyAddress", UNSET) + company_address: Union[Unset, None, CompanyAddressModel] + if _company_address is None: + company_address = None + elif isinstance(_company_address, Unset): + company_address = UNSET + else: + company_address = CompanyAddressModel.from_dict(_company_address) + + _home_address = d.pop("homeAddress", UNSET) + home_address: Union[Unset, None, LocationModel] + if _home_address is None: + home_address = None + elif isinstance(_home_address, Unset): + home_address = UNSET + else: + home_address = LocationModel.from_dict(_home_address) + + _image = d.pop("image", UNSET) + image: Union[Unset, None, CompanyUserImageModel] + if _image is None: + image = None + elif isinstance(_image, Unset): + image = UNSET + else: + image = CompanyUserImageModel.from_dict(_image) + + desired_assignment = d.pop("desiredAssignment", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + twitter = d.pop("twitter", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + homepage = d.pop("homepage", UNSET) + + blog = d.pop("blog", UNSET) + + git_hub = d.pop("gitHub", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_model = cls( + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + employment_number=employment_number, + availability_percent=availability_percent, + available_from_date=available_from_date, + mobility=mobility, + location_name=location_name, + resumes=resumes, + roles=roles, + team_managers=team_managers, + team_members=team_members, + customer_managers=customer_managers, + periods=periods, + default_currency=default_currency, + phone=phone, + date_of_birth=date_of_birth, + tags=tags, + status=status, + title=title, + company_user_email=company_user_email, + created_date_time=created_date_time, + updated_date_time=updated_date_time, + company_address=company_address, + home_address=home_address, + image=image, + desired_assignment=desired_assignment, + internal_identifier=internal_identifier, + twitter=twitter, + linked_in=linked_in, + homepage=homepage, + blog=blog, + git_hub=git_hub, + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_user_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_permissions_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_permissions_edit_model.py new file mode 100644 index 0000000..8d384ae --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_permissions_edit_model.py @@ -0,0 +1,53 @@ +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.access_level import AccessLevel +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserPermissionsEditModel") + + +@_attrs_define +class CompanyUserPermissionsEditModel: + """ + Attributes: + permissions (Union[Unset, None, List[AccessLevel]]): + """ + + permissions: Union[Unset, None, List[AccessLevel]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + permissions: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.permissions, Unset): + if self.permissions is None: + permissions = None + else: + permissions = [] + for permissions_item_data in self.permissions: + permissions_item = permissions_item_data.value + + permissions.append(permissions_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if permissions is not UNSET: + field_dict["permissions"] = permissions + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + permissions = [] + _permissions = d.pop("permissions", UNSET) + for permissions_item_data in _permissions or []: + permissions_item = AccessLevel(permissions_item_data) + + permissions.append(permissions_item) + + company_user_permissions_edit_model = cls( + permissions=permissions, + ) + + return company_user_permissions_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_add_edit_model.py new file mode 100644 index 0000000..a21ff1d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_add_edit_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileAddEditModel") + + +@_attrs_define +class CompanyUserProfileAddEditModel: + """ + Attributes: + language_id (Union[Unset, None, int]): + """ + + language_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + language_id = self.language_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if language_id is not UNSET: + field_dict["languageId"] = language_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + language_id = d.pop("languageId", UNSET) + + company_user_profile_add_edit_model = cls( + language_id=language_id, + ) + + return company_user_profile_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_base_model.py new file mode 100644 index 0000000..10af249 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_base_model.py @@ -0,0 +1,209 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_presentation_model import CompanyUserProfilePresentationModel + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileBaseModel") + + +@_attrs_define +class CompanyUserProfileBaseModel: + """ + Attributes: + id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + created_when (Union[Unset, None, datetime.datetime]): + updated_when (Union[Unset, None, datetime.datetime]): + published_when (Union[Unset, None, datetime.datetime]): + presentation (Union[Unset, None, CompanyUserProfilePresentationModel]): + profile_translation_id (Union[Unset, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + translations (Union[Unset, None, List['CompanyUserProfileTranslationModel']]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + created_when: Union[Unset, None, datetime.datetime] = UNSET + updated_when: Union[Unset, None, datetime.datetime] = UNSET + published_when: Union[Unset, None, datetime.datetime] = UNSET + presentation: Union[Unset, None, "CompanyUserProfilePresentationModel"] = UNSET + profile_translation_id: Union[Unset, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileTranslationModel"]] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + company_user_id = self.company_user_id + created_when: Union[Unset, None, str] = UNSET + if not isinstance(self.created_when, Unset): + created_when = self.created_when.isoformat() if self.created_when else None + + updated_when: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_when, Unset): + updated_when = self.updated_when.isoformat() if self.updated_when else None + + published_when: Union[Unset, None, str] = UNSET + if not isinstance(self.published_when, Unset): + published_when = self.published_when.isoformat() if self.published_when else None + + presentation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.presentation, Unset): + presentation = self.presentation.to_dict() if self.presentation else None + + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if created_when is not UNSET: + field_dict["createdWhen"] = created_when + if updated_when is not UNSET: + field_dict["updatedWhen"] = updated_when + if published_when is not UNSET: + field_dict["publishedWhen"] = published_when + if presentation is not UNSET: + field_dict["presentation"] = presentation + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + if translations is not UNSET: + field_dict["translations"] = translations + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_presentation_model import CompanyUserProfilePresentationModel + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + _created_when = d.pop("createdWhen", UNSET) + created_when: Union[Unset, None, datetime.datetime] + if _created_when is None: + created_when = None + elif isinstance(_created_when, Unset): + created_when = UNSET + else: + created_when = isoparse(_created_when) + + _updated_when = d.pop("updatedWhen", UNSET) + updated_when: Union[Unset, None, datetime.datetime] + if _updated_when is None: + updated_when = None + elif isinstance(_updated_when, Unset): + updated_when = UNSET + else: + updated_when = isoparse(_updated_when) + + _published_when = d.pop("publishedWhen", UNSET) + published_when: Union[Unset, None, datetime.datetime] + if _published_when is None: + published_when = None + elif isinstance(_published_when, Unset): + published_when = UNSET + else: + published_when = isoparse(_published_when) + + _presentation = d.pop("presentation", UNSET) + presentation: Union[Unset, None, CompanyUserProfilePresentationModel] + if _presentation is None: + presentation = None + elif isinstance(_presentation, Unset): + presentation = UNSET + else: + presentation = CompanyUserProfilePresentationModel.from_dict(_presentation) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_base_model = cls( + id=id, + company_id=company_id, + company_user_id=company_user_id, + created_when=created_when, + updated_when=updated_when, + published_when=published_when, + presentation=presentation, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + translations=translations, + links=links, + ) + + return company_user_profile_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_add_edit_model.py new file mode 100644 index 0000000..7f9d274 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_add_edit_model.py @@ -0,0 +1,102 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileCommitmentAddEditModel") + + +@_attrs_define +class CompanyUserProfileCommitmentAddEditModel: + """ + Attributes: + title (str): + description (Union[Unset, None, str]): + is_current (Union[Unset, None, bool]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + url (Union[Unset, None, str]): + """ + + title: str + description: Union[Unset, None, str] = UNSET + is_current: Union[Unset, None, bool] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + url: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + description = self.description + is_current = self.is_current + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + url = self.url + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if description is not UNSET: + field_dict["description"] = description + if is_current is not UNSET: + field_dict["isCurrent"] = is_current + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + description = d.pop("description", UNSET) + + is_current = d.pop("isCurrent", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + url = d.pop("url", UNSET) + + company_user_profile_commitment_add_edit_model = cls( + title=title, + description=description, + is_current=is_current, + start_date=start_date, + end_date=end_date, + url=url, + ) + + return company_user_profile_commitment_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_model.py new file mode 100644 index 0000000..ee57085 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_model.py @@ -0,0 +1,163 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_commitment_translation_model import CompanyUserProfileCommitmentTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileCommitmentModel") + + +@_attrs_define +class CompanyUserProfileCommitmentModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + translations (Union[Unset, None, List['CompanyUserProfileCommitmentTranslationModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileCommitmentTranslationModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if translations is not UNSET: + field_dict["translations"] = translations + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_commitment_translation_model import ( + CompanyUserProfileCommitmentTranslationModel, + ) + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileCommitmentTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_commitment_model = cls( + profile_id=profile_id, + start_date=start_date, + end_date=end_date, + translations=translations, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_commitment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_translation_model.py new file mode 100644 index 0000000..3ac6f49 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_commitment_translation_model.py @@ -0,0 +1,85 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileCommitmentTranslationModel") + + +@_attrs_define +class CompanyUserProfileCommitmentTranslationModel: + """ + Attributes: + profile_commitment_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_commitment_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_commitment_id = self.profile_commitment_id + title = self.title + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_commitment_id is not UNSET: + field_dict["profileCommitmentId"] = profile_commitment_id + if title is not UNSET: + field_dict["title"] = title + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_commitment_id = d.pop("profileCommitmentId", UNSET) + + title = d.pop("title", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_commitment_translation_model = cls( + profile_commitment_id=profile_commitment_id, + title=title, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_commitment_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_add_edit_model.py new file mode 100644 index 0000000..05e70ee --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_add_edit_model.py @@ -0,0 +1,141 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.location_model import LocationModel + + +T = TypeVar("T", bound="CompanyUserProfileEducationAddEditModel") + + +@_attrs_define +class CompanyUserProfileEducationAddEditModel: + """ + Attributes: + school_name (str): + program_name (str): + degree (Union[Unset, None, str]): + description (Union[Unset, None, str]): + location (Union[Unset, None, LocationModel]): + is_current (Union[Unset, None, bool]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + url (Union[Unset, None, str]): + """ + + school_name: str + program_name: str + degree: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + location: Union[Unset, None, "LocationModel"] = UNSET + is_current: Union[Unset, None, bool] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + url: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + school_name = self.school_name + program_name = self.program_name + degree = self.degree + description = self.description + location: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.location, Unset): + location = self.location.to_dict() if self.location else None + + is_current = self.is_current + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + url = self.url + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "schoolName": school_name, + "programName": program_name, + } + ) + if degree is not UNSET: + field_dict["degree"] = degree + if description is not UNSET: + field_dict["description"] = description + if location is not UNSET: + field_dict["location"] = location + if is_current is not UNSET: + field_dict["isCurrent"] = is_current + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.location_model import LocationModel + + d = src_dict.copy() + school_name = d.pop("schoolName") + + program_name = d.pop("programName") + + degree = d.pop("degree", UNSET) + + description = d.pop("description", UNSET) + + _location = d.pop("location", UNSET) + location: Union[Unset, None, LocationModel] + if _location is None: + location = None + elif isinstance(_location, Unset): + location = UNSET + else: + location = LocationModel.from_dict(_location) + + is_current = d.pop("isCurrent", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + url = d.pop("url", UNSET) + + company_user_profile_education_add_edit_model = cls( + school_name=school_name, + program_name=program_name, + degree=degree, + description=description, + location=location, + is_current=is_current, + start_date=start_date, + end_date=end_date, + url=url, + ) + + return company_user_profile_education_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_model.py new file mode 100644 index 0000000..3bda4d6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_model.py @@ -0,0 +1,171 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_education_translation_model import CompanyUserProfileEducationTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileEducationModel") + + +@_attrs_define +class CompanyUserProfileEducationModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + location_id (Union[Unset, None, int]): + translations (Union[Unset, None, List['CompanyUserProfileEducationTranslationModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + location_id: Union[Unset, None, int] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileEducationTranslationModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + location_id = self.location_id + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if location_id is not UNSET: + field_dict["locationId"] = location_id + if translations is not UNSET: + field_dict["translations"] = translations + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_education_translation_model import ( + CompanyUserProfileEducationTranslationModel, + ) + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + location_id = d.pop("locationId", UNSET) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileEducationTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_education_model = cls( + profile_id=profile_id, + start_date=start_date, + end_date=end_date, + location_id=location_id, + translations=translations, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_education_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_translation_model.py new file mode 100644 index 0000000..f98393a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_education_translation_model.py @@ -0,0 +1,109 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileEducationTranslationModel") + + +@_attrs_define +class CompanyUserProfileEducationTranslationModel: + """ + Attributes: + profile_education_id (Union[Unset, None, int]): + school_name (Union[Unset, None, str]): + program_name (Union[Unset, None, str]): + degree (Union[Unset, None, str]): + description (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_education_id: Union[Unset, None, int] = UNSET + school_name: Union[Unset, None, str] = UNSET + program_name: Union[Unset, None, str] = UNSET + degree: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_education_id = self.profile_education_id + school_name = self.school_name + program_name = self.program_name + degree = self.degree + description = self.description + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_education_id is not UNSET: + field_dict["profileEducationId"] = profile_education_id + if school_name is not UNSET: + field_dict["schoolName"] = school_name + if program_name is not UNSET: + field_dict["programName"] = program_name + if degree is not UNSET: + field_dict["degree"] = degree + if description is not UNSET: + field_dict["description"] = description + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_education_id = d.pop("profileEducationId", UNSET) + + school_name = d.pop("schoolName", UNSET) + + program_name = d.pop("programName", UNSET) + + degree = d.pop("degree", UNSET) + + description = d.pop("description", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_education_translation_model = cls( + profile_education_id=profile_education_id, + school_name=school_name, + program_name=program_name, + degree=degree, + description=description, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_education_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_add_edit_model.py new file mode 100644 index 0000000..2312079 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_add_edit_model.py @@ -0,0 +1,110 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileEmployerAddEditModel") + + +@_attrs_define +class CompanyUserProfileEmployerAddEditModel: + """ + Attributes: + name (str): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + is_current (Union[Unset, None, bool]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + url (Union[Unset, None, str]): + """ + + name: str + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + is_current: Union[Unset, None, bool] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + url: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + title = self.title + description = self.description + is_current = self.is_current + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + url = self.url + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "name": name, + } + ) + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if is_current is not UNSET: + field_dict["isCurrent"] = is_current + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + is_current = d.pop("isCurrent", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + url = d.pop("url", UNSET) + + company_user_profile_employer_add_edit_model = cls( + name=name, + title=title, + description=description, + is_current=is_current, + start_date=start_date, + end_date=end_date, + url=url, + ) + + return company_user_profile_employer_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_model.py new file mode 100644 index 0000000..ed8111d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_model.py @@ -0,0 +1,169 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_employer_translation_model import CompanyUserProfileEmployerTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileEmployerModel") + + +@_attrs_define +class CompanyUserProfileEmployerModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + is_current (Union[Unset, bool]): + translations (Union[Unset, None, List['CompanyUserProfileEmployerTranslationModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + is_current: Union[Unset, bool] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileEmployerTranslationModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + is_current = self.is_current + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if is_current is not UNSET: + field_dict["isCurrent"] = is_current + if translations is not UNSET: + field_dict["translations"] = translations + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_employer_translation_model import CompanyUserProfileEmployerTranslationModel + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + is_current = d.pop("isCurrent", UNSET) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileEmployerTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_employer_model = cls( + profile_id=profile_id, + start_date=start_date, + end_date=end_date, + is_current=is_current, + translations=translations, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_employer_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_translation_model.py new file mode 100644 index 0000000..3f1a83b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_employer_translation_model.py @@ -0,0 +1,101 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileEmployerTranslationModel") + + +@_attrs_define +class CompanyUserProfileEmployerTranslationModel: + """ + Attributes: + profile_employer_id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_employer_id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_employer_id = self.profile_employer_id + name = self.name + title = self.title + description = self.description + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_employer_id is not UNSET: + field_dict["profileEmployerId"] = profile_employer_id + if name is not UNSET: + field_dict["name"] = name + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_employer_id = d.pop("profileEmployerId", UNSET) + + name = d.pop("name", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_employer_translation_model = cls( + profile_employer_id=profile_employer_id, + name=name, + title=title, + description=description, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_employer_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_add_edit_model.py new file mode 100644 index 0000000..4c43960 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_add_edit_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="CompanyUserProfileExtSkillAddEditModel") + + +@_attrs_define +class CompanyUserProfileExtSkillAddEditModel: + """ + Attributes: + title (str): + """ + + title: str + + def to_dict(self) -> Dict[str, Any]: + title = self.title + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + company_user_profile_ext_skill_add_edit_model = cls( + title=title, + ) + + return company_user_profile_ext_skill_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_model.py new file mode 100644 index 0000000..f1a8c6f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_model.py @@ -0,0 +1,123 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_ext_skill_translation_model import CompanyUserProfileExtSkillTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileExtSkillModel") + + +@_attrs_define +class CompanyUserProfileExtSkillModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + translations (Union[Unset, None, List['CompanyUserProfileExtSkillTranslationModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileExtSkillTranslationModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if translations is not UNSET: + field_dict["translations"] = translations + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_ext_skill_translation_model import CompanyUserProfileExtSkillTranslationModel + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileExtSkillTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_ext_skill_model = cls( + profile_id=profile_id, + translations=translations, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_ext_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_translation_model.py new file mode 100644 index 0000000..57bae12 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_ext_skill_translation_model.py @@ -0,0 +1,85 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileExtSkillTranslationModel") + + +@_attrs_define +class CompanyUserProfileExtSkillTranslationModel: + """ + Attributes: + profile_ext_skill_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_ext_skill_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_ext_skill_id = self.profile_ext_skill_id + title = self.title + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_ext_skill_id is not UNSET: + field_dict["profileExtSkillId"] = profile_ext_skill_id + if title is not UNSET: + field_dict["title"] = title + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_ext_skill_id = d.pop("profileExtSkillId", UNSET) + + title = d.pop("title", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_ext_skill_translation_model = cls( + profile_ext_skill_id=profile_ext_skill_id, + title=title, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_ext_skill_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_full_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_full_model.py new file mode 100644 index 0000000..cd25a31 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_full_model.py @@ -0,0 +1,442 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_commitment_model import CompanyUserProfileCommitmentModel + from ..models.company_user_profile_education_model import CompanyUserProfileEducationModel + from ..models.company_user_profile_employer_model import CompanyUserProfileEmployerModel + from ..models.company_user_profile_ext_skill_model import CompanyUserProfileExtSkillModel + from ..models.company_user_profile_language_model import CompanyUserProfileLanguageModel + from ..models.company_user_profile_presentation_model import CompanyUserProfilePresentationModel + from ..models.company_user_profile_reference_model import CompanyUserProfileReferenceModel + from ..models.company_user_profile_skill_model import CompanyUserProfileSkillModel + from ..models.company_user_profile_training_model import CompanyUserProfileTrainingModel + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + from ..models.company_user_profile_work_experience_model import CompanyUserProfileWorkExperienceModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileFullModel") + + +@_attrs_define +class CompanyUserProfileFullModel: + """ + Attributes: + employers (Union[Unset, None, List['CompanyUserProfileEmployerModel']]): + work_experience (Union[Unset, None, List['CompanyUserProfileWorkExperienceModel']]): + education (Union[Unset, None, List['CompanyUserProfileEducationModel']]): + training (Union[Unset, None, List['CompanyUserProfileTrainingModel']]): + references (Union[Unset, None, List['CompanyUserProfileReferenceModel']]): + skills (Union[Unset, None, List['CompanyUserProfileSkillModel']]): + ext_skills (Union[Unset, None, List['CompanyUserProfileExtSkillModel']]): + commitments (Union[Unset, None, List['CompanyUserProfileCommitmentModel']]): + languages (Union[Unset, None, List['CompanyUserProfileLanguageModel']]): + user_id (Union[Unset, None, str]): + id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + created_when (Union[Unset, None, datetime.datetime]): + updated_when (Union[Unset, None, datetime.datetime]): + published_when (Union[Unset, None, datetime.datetime]): + presentation (Union[Unset, None, CompanyUserProfilePresentationModel]): + profile_translation_id (Union[Unset, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + translations (Union[Unset, None, List['CompanyUserProfileTranslationModel']]): + links (Union[Unset, None, List['Link']]): + """ + + employers: Union[Unset, None, List["CompanyUserProfileEmployerModel"]] = UNSET + work_experience: Union[Unset, None, List["CompanyUserProfileWorkExperienceModel"]] = UNSET + education: Union[Unset, None, List["CompanyUserProfileEducationModel"]] = UNSET + training: Union[Unset, None, List["CompanyUserProfileTrainingModel"]] = UNSET + references: Union[Unset, None, List["CompanyUserProfileReferenceModel"]] = UNSET + skills: Union[Unset, None, List["CompanyUserProfileSkillModel"]] = UNSET + ext_skills: Union[Unset, None, List["CompanyUserProfileExtSkillModel"]] = UNSET + commitments: Union[Unset, None, List["CompanyUserProfileCommitmentModel"]] = UNSET + languages: Union[Unset, None, List["CompanyUserProfileLanguageModel"]] = UNSET + user_id: Union[Unset, None, str] = UNSET + id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + created_when: Union[Unset, None, datetime.datetime] = UNSET + updated_when: Union[Unset, None, datetime.datetime] = UNSET + published_when: Union[Unset, None, datetime.datetime] = UNSET + presentation: Union[Unset, None, "CompanyUserProfilePresentationModel"] = UNSET + profile_translation_id: Union[Unset, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileTranslationModel"]] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + employers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.employers, Unset): + if self.employers is None: + employers = None + else: + employers = [] + for employers_item_data in self.employers: + employers_item = employers_item_data.to_dict() + + employers.append(employers_item) + + work_experience: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.work_experience, Unset): + if self.work_experience is None: + work_experience = None + else: + work_experience = [] + for work_experience_item_data in self.work_experience: + work_experience_item = work_experience_item_data.to_dict() + + work_experience.append(work_experience_item) + + education: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.education, Unset): + if self.education is None: + education = None + else: + education = [] + for education_item_data in self.education: + education_item = education_item_data.to_dict() + + education.append(education_item) + + training: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.training, Unset): + if self.training is None: + training = None + else: + training = [] + for training_item_data in self.training: + training_item = training_item_data.to_dict() + + training.append(training_item) + + references: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.references, Unset): + if self.references is None: + references = None + else: + references = [] + for references_item_data in self.references: + references_item = references_item_data.to_dict() + + references.append(references_item) + + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + ext_skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.ext_skills, Unset): + if self.ext_skills is None: + ext_skills = None + else: + ext_skills = [] + for ext_skills_item_data in self.ext_skills: + ext_skills_item = ext_skills_item_data.to_dict() + + ext_skills.append(ext_skills_item) + + commitments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.commitments, Unset): + if self.commitments is None: + commitments = None + else: + commitments = [] + for commitments_item_data in self.commitments: + commitments_item = commitments_item_data.to_dict() + + commitments.append(commitments_item) + + languages: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.languages, Unset): + if self.languages is None: + languages = None + else: + languages = [] + for languages_item_data in self.languages: + languages_item = languages_item_data.to_dict() + + languages.append(languages_item) + + user_id = self.user_id + id = self.id + company_id = self.company_id + company_user_id = self.company_user_id + created_when: Union[Unset, None, str] = UNSET + if not isinstance(self.created_when, Unset): + created_when = self.created_when.isoformat() if self.created_when else None + + updated_when: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_when, Unset): + updated_when = self.updated_when.isoformat() if self.updated_when else None + + published_when: Union[Unset, None, str] = UNSET + if not isinstance(self.published_when, Unset): + published_when = self.published_when.isoformat() if self.published_when else None + + presentation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.presentation, Unset): + presentation = self.presentation.to_dict() if self.presentation else None + + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if employers is not UNSET: + field_dict["employers"] = employers + if work_experience is not UNSET: + field_dict["workExperience"] = work_experience + if education is not UNSET: + field_dict["education"] = education + if training is not UNSET: + field_dict["training"] = training + if references is not UNSET: + field_dict["references"] = references + if skills is not UNSET: + field_dict["skills"] = skills + if ext_skills is not UNSET: + field_dict["extSkills"] = ext_skills + if commitments is not UNSET: + field_dict["commitments"] = commitments + if languages is not UNSET: + field_dict["languages"] = languages + if user_id is not UNSET: + field_dict["userId"] = user_id + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if created_when is not UNSET: + field_dict["createdWhen"] = created_when + if updated_when is not UNSET: + field_dict["updatedWhen"] = updated_when + if published_when is not UNSET: + field_dict["publishedWhen"] = published_when + if presentation is not UNSET: + field_dict["presentation"] = presentation + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + if translations is not UNSET: + field_dict["translations"] = translations + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_commitment_model import CompanyUserProfileCommitmentModel + from ..models.company_user_profile_education_model import CompanyUserProfileEducationModel + from ..models.company_user_profile_employer_model import CompanyUserProfileEmployerModel + from ..models.company_user_profile_ext_skill_model import CompanyUserProfileExtSkillModel + from ..models.company_user_profile_language_model import CompanyUserProfileLanguageModel + from ..models.company_user_profile_presentation_model import CompanyUserProfilePresentationModel + from ..models.company_user_profile_reference_model import CompanyUserProfileReferenceModel + from ..models.company_user_profile_skill_model import CompanyUserProfileSkillModel + from ..models.company_user_profile_training_model import CompanyUserProfileTrainingModel + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + from ..models.company_user_profile_work_experience_model import CompanyUserProfileWorkExperienceModel + from ..models.link import Link + + d = src_dict.copy() + employers = [] + _employers = d.pop("employers", UNSET) + for employers_item_data in _employers or []: + employers_item = CompanyUserProfileEmployerModel.from_dict(employers_item_data) + + employers.append(employers_item) + + work_experience = [] + _work_experience = d.pop("workExperience", UNSET) + for work_experience_item_data in _work_experience or []: + work_experience_item = CompanyUserProfileWorkExperienceModel.from_dict(work_experience_item_data) + + work_experience.append(work_experience_item) + + education = [] + _education = d.pop("education", UNSET) + for education_item_data in _education or []: + education_item = CompanyUserProfileEducationModel.from_dict(education_item_data) + + education.append(education_item) + + training = [] + _training = d.pop("training", UNSET) + for training_item_data in _training or []: + training_item = CompanyUserProfileTrainingModel.from_dict(training_item_data) + + training.append(training_item) + + references = [] + _references = d.pop("references", UNSET) + for references_item_data in _references or []: + references_item = CompanyUserProfileReferenceModel.from_dict(references_item_data) + + references.append(references_item) + + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = CompanyUserProfileSkillModel.from_dict(skills_item_data) + + skills.append(skills_item) + + ext_skills = [] + _ext_skills = d.pop("extSkills", UNSET) + for ext_skills_item_data in _ext_skills or []: + ext_skills_item = CompanyUserProfileExtSkillModel.from_dict(ext_skills_item_data) + + ext_skills.append(ext_skills_item) + + commitments = [] + _commitments = d.pop("commitments", UNSET) + for commitments_item_data in _commitments or []: + commitments_item = CompanyUserProfileCommitmentModel.from_dict(commitments_item_data) + + commitments.append(commitments_item) + + languages = [] + _languages = d.pop("languages", UNSET) + for languages_item_data in _languages or []: + languages_item = CompanyUserProfileLanguageModel.from_dict(languages_item_data) + + languages.append(languages_item) + + user_id = d.pop("userId", UNSET) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + _created_when = d.pop("createdWhen", UNSET) + created_when: Union[Unset, None, datetime.datetime] + if _created_when is None: + created_when = None + elif isinstance(_created_when, Unset): + created_when = UNSET + else: + created_when = isoparse(_created_when) + + _updated_when = d.pop("updatedWhen", UNSET) + updated_when: Union[Unset, None, datetime.datetime] + if _updated_when is None: + updated_when = None + elif isinstance(_updated_when, Unset): + updated_when = UNSET + else: + updated_when = isoparse(_updated_when) + + _published_when = d.pop("publishedWhen", UNSET) + published_when: Union[Unset, None, datetime.datetime] + if _published_when is None: + published_when = None + elif isinstance(_published_when, Unset): + published_when = UNSET + else: + published_when = isoparse(_published_when) + + _presentation = d.pop("presentation", UNSET) + presentation: Union[Unset, None, CompanyUserProfilePresentationModel] + if _presentation is None: + presentation = None + elif isinstance(_presentation, Unset): + presentation = UNSET + else: + presentation = CompanyUserProfilePresentationModel.from_dict(_presentation) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_full_model = cls( + employers=employers, + work_experience=work_experience, + education=education, + training=training, + references=references, + skills=skills, + ext_skills=ext_skills, + commitments=commitments, + languages=languages, + user_id=user_id, + id=id, + company_id=company_id, + company_user_id=company_user_id, + created_when=created_when, + updated_when=updated_when, + published_when=published_when, + presentation=presentation, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + translations=translations, + links=links, + ) + + return company_user_profile_full_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_add_edit_model.py new file mode 100644 index 0000000..e15780a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_add_edit_model.py @@ -0,0 +1,66 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.language_level import LanguageLevel +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileLanguageAddEditModel") + + +@_attrs_define +class CompanyUserProfileLanguageAddEditModel: + """ + Attributes: + language_id (int): + level (Union[Unset, LanguageLevel]): + + Enstaka ord och fraser = 0 + + Grundläggande kunskaper = 1 + + Goda kunskaper = 2 + + Flytande = 3 + + Modersmål = 4 + """ + + language_id: int + level: Union[Unset, LanguageLevel] = UNSET + + def to_dict(self) -> Dict[str, Any]: + language_id = self.language_id + level: Union[Unset, int] = UNSET + if not isinstance(self.level, Unset): + level = self.level.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "languageId": language_id, + } + ) + if level is not UNSET: + field_dict["level"] = level + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + language_id = d.pop("languageId") + + _level = d.pop("level", UNSET) + level: Union[Unset, LanguageLevel] + if isinstance(_level, Unset): + level = UNSET + else: + level = LanguageLevel(_level) + + company_user_profile_language_add_edit_model = cls( + language_id=language_id, + level=level, + ) + + return company_user_profile_language_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_branch_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_branch_model.py new file mode 100644 index 0000000..c180bc2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_branch_model.py @@ -0,0 +1,78 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.profile_language_model import ProfileLanguageModel + + +T = TypeVar("T", bound="CompanyUserProfileLanguageBranchModel") + + +@_attrs_define +class CompanyUserProfileLanguageBranchModel: + """ + Attributes: + id (Union[Unset, None, int]): + language_id (Union[Unset, None, int]): + language (Union[Unset, None, ProfileLanguageModel]): + enabled (Union[Unset, bool]): + """ + + id: Union[Unset, None, int] = UNSET + language_id: Union[Unset, None, int] = UNSET + language: Union[Unset, None, "ProfileLanguageModel"] = UNSET + enabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + language_id = self.language_id + language: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language, Unset): + language = self.language.to_dict() if self.language else None + + enabled = self.enabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if language_id is not UNSET: + field_dict["languageId"] = language_id + if language is not UNSET: + field_dict["language"] = language + if enabled is not UNSET: + field_dict["enabled"] = enabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.profile_language_model import ProfileLanguageModel + + d = src_dict.copy() + id = d.pop("id", UNSET) + + language_id = d.pop("languageId", UNSET) + + _language = d.pop("language", UNSET) + language: Union[Unset, None, ProfileLanguageModel] + if _language is None: + language = None + elif isinstance(_language, Unset): + language = UNSET + else: + language = ProfileLanguageModel.from_dict(_language) + + enabled = d.pop("enabled", UNSET) + + company_user_profile_language_branch_model = cls( + id=id, + language_id=language_id, + language=language, + enabled=enabled, + ) + + return company_user_profile_language_branch_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_model.py new file mode 100644 index 0000000..001cf82 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_language_model.py @@ -0,0 +1,126 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + from ..models.profile_language_model import ProfileLanguageModel + + +T = TypeVar("T", bound="CompanyUserProfileLanguageModel") + + +@_attrs_define +class CompanyUserProfileLanguageModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + language (Union[Unset, None, ProfileLanguageModel]): + level (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + language: Union[Unset, None, "ProfileLanguageModel"] = UNSET + level: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + language: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language, Unset): + language = self.language.to_dict() if self.language else None + + level = self.level + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if language is not UNSET: + field_dict["language"] = language + if level is not UNSET: + field_dict["level"] = level + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + from ..models.profile_language_model import ProfileLanguageModel + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + _language = d.pop("language", UNSET) + language: Union[Unset, None, ProfileLanguageModel] + if _language is None: + language = None + elif isinstance(_language, Unset): + language = UNSET + else: + language = ProfileLanguageModel.from_dict(_language) + + level = d.pop("level", UNSET) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_language_model = cls( + profile_id=profile_id, + language=language, + level=level, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_language_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_edit_model.py new file mode 100644 index 0000000..e0255ef --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_edit_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfilePresentationEditModel") + + +@_attrs_define +class CompanyUserProfilePresentationEditModel: + """ + Attributes: + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + personal_description (Union[Unset, None, str]): + """ + + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + personal_description: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + description = self.description + personal_description = self.personal_description + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if personal_description is not UNSET: + field_dict["personalDescription"] = personal_description + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + personal_description = d.pop("personalDescription", UNSET) + + company_user_profile_presentation_edit_model = cls( + title=title, + description=description, + personal_description=personal_description, + ) + + return company_user_profile_presentation_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_model.py new file mode 100644 index 0000000..981e110 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_model.py @@ -0,0 +1,119 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_presentation_translation_model import ( + CompanyUserProfilePresentationTranslationModel, + ) + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfilePresentationModel") + + +@_attrs_define +class CompanyUserProfilePresentationModel: + """ + Attributes: + translations (Union[Unset, None, List['CompanyUserProfilePresentationTranslationModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + translations: Union[Unset, None, List["CompanyUserProfilePresentationTranslationModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if translations is not UNSET: + field_dict["translations"] = translations + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_presentation_translation_model import ( + CompanyUserProfilePresentationTranslationModel, + ) + from ..models.link import Link + + d = src_dict.copy() + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfilePresentationTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_presentation_model = cls( + translations=translations, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_presentation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_translation_model.py new file mode 100644 index 0000000..1019089 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_presentation_translation_model.py @@ -0,0 +1,93 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfilePresentationTranslationModel") + + +@_attrs_define +class CompanyUserProfilePresentationTranslationModel: + """ + Attributes: + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + personal_description (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + personal_description: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + description = self.description + personal_description = self.personal_description + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if personal_description is not UNSET: + field_dict["personalDescription"] = personal_description + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + personal_description = d.pop("personalDescription", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_presentation_translation_model = cls( + title=title, + description=description, + personal_description=personal_description, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_presentation_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_add_edit_model.py new file mode 100644 index 0000000..58a6956 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_add_edit_model.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileReferenceAddEditModel") + + +@_attrs_define +class CompanyUserProfileReferenceAddEditModel: + """ + Attributes: + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + email (Union[Unset, None, str]): + telephone (Union[Unset, None, str]): + company (Union[Unset, None, str]): + position (Union[Unset, None, str]): + text (Union[Unset, None, str]): + profile_work_experience_id (Union[Unset, None, int]): + """ + + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + telephone: Union[Unset, None, str] = UNSET + company: Union[Unset, None, str] = UNSET + position: Union[Unset, None, str] = UNSET + text: Union[Unset, None, str] = UNSET + profile_work_experience_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + first_name = self.first_name + last_name = self.last_name + email = self.email + telephone = self.telephone + company = self.company + position = self.position + text = self.text + profile_work_experience_id = self.profile_work_experience_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if email is not UNSET: + field_dict["email"] = email + if telephone is not UNSET: + field_dict["telephone"] = telephone + if company is not UNSET: + field_dict["company"] = company + if position is not UNSET: + field_dict["position"] = position + if text is not UNSET: + field_dict["text"] = text + if profile_work_experience_id is not UNSET: + field_dict["profileWorkExperienceId"] = profile_work_experience_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + email = d.pop("email", UNSET) + + telephone = d.pop("telephone", UNSET) + + company = d.pop("company", UNSET) + + position = d.pop("position", UNSET) + + text = d.pop("text", UNSET) + + profile_work_experience_id = d.pop("profileWorkExperienceId", UNSET) + + company_user_profile_reference_add_edit_model = cls( + first_name=first_name, + last_name=last_name, + email=email, + telephone=telephone, + company=company, + position=position, + text=text, + profile_work_experience_id=profile_work_experience_id, + ) + + return company_user_profile_reference_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_model.py new file mode 100644 index 0000000..0432584 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_model.py @@ -0,0 +1,165 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_reference_translation_model import CompanyUserProfileReferenceTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileReferenceModel") + + +@_attrs_define +class CompanyUserProfileReferenceModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + email (Union[Unset, None, str]): + telephone (Union[Unset, None, str]): + profile_work_experience_id (Union[Unset, None, int]): + translations (Union[Unset, None, List['CompanyUserProfileReferenceTranslationModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + telephone: Union[Unset, None, str] = UNSET + profile_work_experience_id: Union[Unset, None, int] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileReferenceTranslationModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + first_name = self.first_name + last_name = self.last_name + email = self.email + telephone = self.telephone + profile_work_experience_id = self.profile_work_experience_id + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if email is not UNSET: + field_dict["email"] = email + if telephone is not UNSET: + field_dict["telephone"] = telephone + if profile_work_experience_id is not UNSET: + field_dict["profileWorkExperienceId"] = profile_work_experience_id + if translations is not UNSET: + field_dict["translations"] = translations + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_reference_translation_model import ( + CompanyUserProfileReferenceTranslationModel, + ) + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + email = d.pop("email", UNSET) + + telephone = d.pop("telephone", UNSET) + + profile_work_experience_id = d.pop("profileWorkExperienceId", UNSET) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileReferenceTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_reference_model = cls( + profile_id=profile_id, + first_name=first_name, + last_name=last_name, + email=email, + telephone=telephone, + profile_work_experience_id=profile_work_experience_id, + translations=translations, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_reference_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_translation_model.py new file mode 100644 index 0000000..fe5b648 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_reference_translation_model.py @@ -0,0 +1,101 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileReferenceTranslationModel") + + +@_attrs_define +class CompanyUserProfileReferenceTranslationModel: + """ + Attributes: + profile_reference_id (Union[Unset, None, int]): + company (Union[Unset, None, str]): + position (Union[Unset, None, str]): + text (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_reference_id: Union[Unset, None, int] = UNSET + company: Union[Unset, None, str] = UNSET + position: Union[Unset, None, str] = UNSET + text: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_reference_id = self.profile_reference_id + company = self.company + position = self.position + text = self.text + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_reference_id is not UNSET: + field_dict["profileReferenceId"] = profile_reference_id + if company is not UNSET: + field_dict["company"] = company + if position is not UNSET: + field_dict["position"] = position + if text is not UNSET: + field_dict["text"] = text + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_reference_id = d.pop("profileReferenceId", UNSET) + + company = d.pop("company", UNSET) + + position = d.pop("position", UNSET) + + text = d.pop("text", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_reference_translation_model = cls( + profile_reference_id=profile_reference_id, + company=company, + position=position, + text=text, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_reference_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_add_model.py new file mode 100644 index 0000000..a477755 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_add_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileSkillAddModel") + + +@_attrs_define +class CompanyUserProfileSkillAddModel: + """ + Attributes: + keyword_synonym_id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + level (Union[Unset, None, int]): + """ + + keyword_synonym_id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + level: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_synonym_id = self.keyword_synonym_id + name = self.name + level = self.level + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if name is not UNSET: + field_dict["name"] = name + if level is not UNSET: + field_dict["level"] = level + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + name = d.pop("name", UNSET) + + level = d.pop("level", UNSET) + + company_user_profile_skill_add_model = cls( + keyword_synonym_id=keyword_synonym_id, + name=name, + level=level, + ) + + return company_user_profile_skill_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_edit_model.py new file mode 100644 index 0000000..35168f5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_edit_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileSkillEditModel") + + +@_attrs_define +class CompanyUserProfileSkillEditModel: + """ + Attributes: + keyword_synonym_id (Union[Unset, None, int]): + level (Union[Unset, int]): + """ + + keyword_synonym_id: Union[Unset, None, int] = UNSET + level: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_synonym_id = self.keyword_synonym_id + level = self.level + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if level is not UNSET: + field_dict["level"] = level + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + level = d.pop("level", UNSET) + + company_user_profile_skill_edit_model = cls( + keyword_synonym_id=keyword_synonym_id, + level=level, + ) + + return company_user_profile_skill_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_history_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_history_model.py new file mode 100644 index 0000000..9eb288e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_history_model.py @@ -0,0 +1,90 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileSkillHistoryModel") + + +@_attrs_define +class CompanyUserProfileSkillHistoryModel: + """ + Attributes: + id (Union[Unset, None, int]): + change_date_time (Union[Unset, None, datetime.datetime]): + level (Union[Unset, None, int]): + profile_id (Union[Unset, None, int]): + keyword_id (Union[Unset, None, int]): + favourite (Union[Unset, bool]): + """ + + id: Union[Unset, None, int] = UNSET + change_date_time: Union[Unset, None, datetime.datetime] = UNSET + level: Union[Unset, None, int] = UNSET + profile_id: Union[Unset, None, int] = UNSET + keyword_id: Union[Unset, None, int] = UNSET + favourite: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + change_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.change_date_time, Unset): + change_date_time = self.change_date_time.isoformat() if self.change_date_time else None + + level = self.level + profile_id = self.profile_id + keyword_id = self.keyword_id + favourite = self.favourite + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if change_date_time is not UNSET: + field_dict["changeDateTime"] = change_date_time + if level is not UNSET: + field_dict["level"] = level + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if favourite is not UNSET: + field_dict["favourite"] = favourite + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + _change_date_time = d.pop("changeDateTime", UNSET) + change_date_time: Union[Unset, None, datetime.datetime] + if _change_date_time is None: + change_date_time = None + elif isinstance(_change_date_time, Unset): + change_date_time = UNSET + else: + change_date_time = isoparse(_change_date_time) + + level = d.pop("level", UNSET) + + profile_id = d.pop("profileId", UNSET) + + keyword_id = d.pop("keywordId", UNSET) + + favourite = d.pop("favourite", UNSET) + + company_user_profile_skill_history_model = cls( + id=id, + change_date_time=change_date_time, + level=level, + profile_id=profile_id, + keyword_id=keyword_id, + favourite=favourite, + ) + + return company_user_profile_skill_history_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_model.py new file mode 100644 index 0000000..5be0128 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_model.py @@ -0,0 +1,220 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_skill_history_model import CompanyUserProfileSkillHistoryModel + from ..models.company_user_profile_skill_translation_model import CompanyUserProfileSkillTranslationModel + from ..models.keyword_model import KeywordModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileSkillModel") + + +@_attrs_define +class CompanyUserProfileSkillModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + level (Union[Unset, None, int]): + level_goal (Union[Unset, None, int]): + level_goal_deadline (Union[Unset, None, datetime.datetime]): + keyword (Union[Unset, None, KeywordModel]): + change_history (Union[Unset, None, List['CompanyUserProfileSkillHistoryModel']]): + translations (Union[Unset, None, List['CompanyUserProfileSkillTranslationModel']]): + favourite (Union[Unset, bool]): + number_of_days_work_experience (Union[Unset, int]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + level: Union[Unset, None, int] = UNSET + level_goal: Union[Unset, None, int] = UNSET + level_goal_deadline: Union[Unset, None, datetime.datetime] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + change_history: Union[Unset, None, List["CompanyUserProfileSkillHistoryModel"]] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileSkillTranslationModel"]] = UNSET + favourite: Union[Unset, bool] = UNSET + number_of_days_work_experience: Union[Unset, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + level = self.level + level_goal = self.level_goal + level_goal_deadline: Union[Unset, None, str] = UNSET + if not isinstance(self.level_goal_deadline, Unset): + level_goal_deadline = self.level_goal_deadline.isoformat() if self.level_goal_deadline else None + + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + change_history: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.change_history, Unset): + if self.change_history is None: + change_history = None + else: + change_history = [] + for change_history_item_data in self.change_history: + change_history_item = change_history_item_data.to_dict() + + change_history.append(change_history_item) + + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + favourite = self.favourite + number_of_days_work_experience = self.number_of_days_work_experience + company_id = self.company_id + company_user_id = self.company_user_id + id = self.id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if level is not UNSET: + field_dict["level"] = level + if level_goal is not UNSET: + field_dict["levelGoal"] = level_goal + if level_goal_deadline is not UNSET: + field_dict["levelGoalDeadline"] = level_goal_deadline + if keyword is not UNSET: + field_dict["keyword"] = keyword + if change_history is not UNSET: + field_dict["changeHistory"] = change_history + if translations is not UNSET: + field_dict["translations"] = translations + if favourite is not UNSET: + field_dict["favourite"] = favourite + if number_of_days_work_experience is not UNSET: + field_dict["numberOfDaysWorkExperience"] = number_of_days_work_experience + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if id is not UNSET: + field_dict["id"] = id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_skill_history_model import CompanyUserProfileSkillHistoryModel + from ..models.company_user_profile_skill_translation_model import CompanyUserProfileSkillTranslationModel + from ..models.keyword_model import KeywordModel + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + level = d.pop("level", UNSET) + + level_goal = d.pop("levelGoal", UNSET) + + _level_goal_deadline = d.pop("levelGoalDeadline", UNSET) + level_goal_deadline: Union[Unset, None, datetime.datetime] + if _level_goal_deadline is None: + level_goal_deadline = None + elif isinstance(_level_goal_deadline, Unset): + level_goal_deadline = UNSET + else: + level_goal_deadline = isoparse(_level_goal_deadline) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + change_history = [] + _change_history = d.pop("changeHistory", UNSET) + for change_history_item_data in _change_history or []: + change_history_item = CompanyUserProfileSkillHistoryModel.from_dict(change_history_item_data) + + change_history.append(change_history_item) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileSkillTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + favourite = d.pop("favourite", UNSET) + + number_of_days_work_experience = d.pop("numberOfDaysWorkExperience", UNSET) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + id = d.pop("id", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_skill_model = cls( + profile_id=profile_id, + level=level, + level_goal=level_goal, + level_goal_deadline=level_goal_deadline, + keyword=keyword, + change_history=change_history, + translations=translations, + favourite=favourite, + number_of_days_work_experience=number_of_days_work_experience, + company_id=company_id, + company_user_id=company_user_id, + id=id, + url=url, + links=links, + ) + + return company_user_profile_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_translation_model.py new file mode 100644 index 0000000..518b216 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_skill_translation_model.py @@ -0,0 +1,125 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + from ..models.keyword_model import KeywordModel + from ..models.keyword_synonym_model import KeywordSynonymModel + + +T = TypeVar("T", bound="CompanyUserProfileSkillTranslationModel") + + +@_attrs_define +class CompanyUserProfileSkillTranslationModel: + """ + Attributes: + keyword_id (Union[Unset, None, int]): + keyword_synonym_id (Union[Unset, None, int]): + keyword_synonym (Union[Unset, None, KeywordSynonymModel]): + keyword (Union[Unset, None, KeywordModel]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + keyword_id: Union[Unset, None, int] = UNSET + keyword_synonym_id: Union[Unset, None, int] = UNSET + keyword_synonym: Union[Unset, None, "KeywordSynonymModel"] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_id = self.keyword_id + keyword_synonym_id = self.keyword_synonym_id + keyword_synonym: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword_synonym, Unset): + keyword_synonym = self.keyword_synonym.to_dict() if self.keyword_synonym else None + + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if keyword_synonym is not UNSET: + field_dict["keywordSynonym"] = keyword_synonym + if keyword is not UNSET: + field_dict["keyword"] = keyword + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + from ..models.keyword_model import KeywordModel + from ..models.keyword_synonym_model import KeywordSynonymModel + + d = src_dict.copy() + keyword_id = d.pop("keywordId", UNSET) + + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + _keyword_synonym = d.pop("keywordSynonym", UNSET) + keyword_synonym: Union[Unset, None, KeywordSynonymModel] + if _keyword_synonym is None: + keyword_synonym = None + elif isinstance(_keyword_synonym, Unset): + keyword_synonym = UNSET + else: + keyword_synonym = KeywordSynonymModel.from_dict(_keyword_synonym) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_skill_translation_model = cls( + keyword_id=keyword_id, + keyword_synonym_id=keyword_synonym_id, + keyword_synonym=keyword_synonym, + keyword=keyword, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_skill_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_add_edit_model.py new file mode 100644 index 0000000..8c89bd0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_add_edit_model.py @@ -0,0 +1,126 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.training_type import TrainingType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserProfileTrainingAddEditModel") + + +@_attrs_define +class CompanyUserProfileTrainingAddEditModel: + """ + Attributes: + title (Union[Unset, None, str]): + year (Union[Unset, int]): + issuer (Union[Unset, None, str]): + supplier (Union[Unset, None, str]): + code (Union[Unset, None, str]): + description (Union[Unset, None, str]): + training_type (Union[Unset, TrainingType]): + + Kurs = 0 + + Certifiering = 1 + url (Union[Unset, None, str]): + expire_date (Union[Unset, None, datetime.datetime]): + """ + + title: Union[Unset, None, str] = UNSET + year: Union[Unset, int] = UNSET + issuer: Union[Unset, None, str] = UNSET + supplier: Union[Unset, None, str] = UNSET + code: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + training_type: Union[Unset, TrainingType] = UNSET + url: Union[Unset, None, str] = UNSET + expire_date: Union[Unset, None, datetime.datetime] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + year = self.year + issuer = self.issuer + supplier = self.supplier + code = self.code + description = self.description + training_type: Union[Unset, int] = UNSET + if not isinstance(self.training_type, Unset): + training_type = self.training_type.value + + url = self.url + expire_date: Union[Unset, None, str] = UNSET + if not isinstance(self.expire_date, Unset): + expire_date = self.expire_date.isoformat() if self.expire_date else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if year is not UNSET: + field_dict["year"] = year + if issuer is not UNSET: + field_dict["issuer"] = issuer + if supplier is not UNSET: + field_dict["supplier"] = supplier + if code is not UNSET: + field_dict["code"] = code + if description is not UNSET: + field_dict["description"] = description + if training_type is not UNSET: + field_dict["trainingType"] = training_type + if url is not UNSET: + field_dict["url"] = url + if expire_date is not UNSET: + field_dict["expireDate"] = expire_date + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title", UNSET) + + year = d.pop("year", UNSET) + + issuer = d.pop("issuer", UNSET) + + supplier = d.pop("supplier", UNSET) + + code = d.pop("code", UNSET) + + description = d.pop("description", UNSET) + + _training_type = d.pop("trainingType", UNSET) + training_type: Union[Unset, TrainingType] + if isinstance(_training_type, Unset): + training_type = UNSET + else: + training_type = TrainingType(_training_type) + + url = d.pop("url", UNSET) + + _expire_date = d.pop("expireDate", UNSET) + expire_date: Union[Unset, None, datetime.datetime] + if _expire_date is None: + expire_date = None + elif isinstance(_expire_date, Unset): + expire_date = UNSET + else: + expire_date = isoparse(_expire_date) + + company_user_profile_training_add_edit_model = cls( + title=title, + year=year, + issuer=issuer, + supplier=supplier, + code=code, + description=description, + training_type=training_type, + url=url, + expire_date=expire_date, + ) + + return company_user_profile_training_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_model.py new file mode 100644 index 0000000..e71e3bd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_model.py @@ -0,0 +1,182 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.training_type import TrainingType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_training_translation_model import CompanyUserProfileTrainingTranslationModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileTrainingModel") + + +@_attrs_define +class CompanyUserProfileTrainingModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + training_type (Union[Unset, None, TrainingType]): + + Kurs = 0 + + Certifiering = 1 + year (Union[Unset, None, int]): + code (Union[Unset, None, str]): + translations (Union[Unset, None, List['CompanyUserProfileTrainingTranslationModel']]): + expire_date (Union[Unset, None, datetime.datetime]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + training_type: Union[Unset, None, TrainingType] = UNSET + year: Union[Unset, None, int] = UNSET + code: Union[Unset, None, str] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileTrainingTranslationModel"]] = UNSET + expire_date: Union[Unset, None, datetime.datetime] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + id = self.id + training_type: Union[Unset, None, int] = UNSET + if not isinstance(self.training_type, Unset): + training_type = self.training_type.value if self.training_type else None + + year = self.year + code = self.code + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + expire_date: Union[Unset, None, str] = UNSET + if not isinstance(self.expire_date, Unset): + expire_date = self.expire_date.isoformat() if self.expire_date else None + + company_id = self.company_id + company_user_id = self.company_user_id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if id is not UNSET: + field_dict["id"] = id + if training_type is not UNSET: + field_dict["trainingType"] = training_type + if year is not UNSET: + field_dict["year"] = year + if code is not UNSET: + field_dict["code"] = code + if translations is not UNSET: + field_dict["translations"] = translations + if expire_date is not UNSET: + field_dict["expireDate"] = expire_date + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_training_translation_model import CompanyUserProfileTrainingTranslationModel + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + id = d.pop("id", UNSET) + + _training_type = d.pop("trainingType", UNSET) + training_type: Union[Unset, None, TrainingType] + if _training_type is None: + training_type = None + elif isinstance(_training_type, Unset): + training_type = UNSET + else: + training_type = TrainingType(_training_type) + + year = d.pop("year", UNSET) + + code = d.pop("code", UNSET) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileTrainingTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + _expire_date = d.pop("expireDate", UNSET) + expire_date: Union[Unset, None, datetime.datetime] + if _expire_date is None: + expire_date = None + elif isinstance(_expire_date, Unset): + expire_date = UNSET + else: + expire_date = isoparse(_expire_date) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_training_model = cls( + profile_id=profile_id, + id=id, + training_type=training_type, + year=year, + code=code, + translations=translations, + expire_date=expire_date, + company_id=company_id, + company_user_id=company_user_id, + url=url, + links=links, + ) + + return company_user_profile_training_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_translation_model.py new file mode 100644 index 0000000..375e4a9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_training_translation_model.py @@ -0,0 +1,109 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileTrainingTranslationModel") + + +@_attrs_define +class CompanyUserProfileTrainingTranslationModel: + """ + Attributes: + profile_training_id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + issuer (Union[Unset, None, str]): + supplier (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_training_id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + issuer: Union[Unset, None, str] = UNSET + supplier: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_training_id = self.profile_training_id + title = self.title + description = self.description + issuer = self.issuer + supplier = self.supplier + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_training_id is not UNSET: + field_dict["profileTrainingId"] = profile_training_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if issuer is not UNSET: + field_dict["issuer"] = issuer + if supplier is not UNSET: + field_dict["supplier"] = supplier + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_training_id = d.pop("profileTrainingId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + issuer = d.pop("issuer", UNSET) + + supplier = d.pop("supplier", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_training_translation_model = cls( + profile_training_id=profile_training_id, + title=title, + description=description, + issuer=issuer, + supplier=supplier, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_training_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_translation_model.py new file mode 100644 index 0000000..8f79630 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_translation_model.py @@ -0,0 +1,77 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_language_branch_model import CompanyUserProfileLanguageBranchModel + + +T = TypeVar("T", bound="CompanyUserProfileTranslationModel") + + +@_attrs_define +class CompanyUserProfileTranslationModel: + """ + Attributes: + profile_translation_id (Union[Unset, None, int]): + profile_id (Union[Unset, None, int]): + language_branch_id (Union[Unset, None, int]): + language_branch (Union[Unset, None, CompanyUserProfileLanguageBranchModel]): + """ + + profile_translation_id: Union[Unset, None, int] = UNSET + profile_id: Union[Unset, None, int] = UNSET + language_branch_id: Union[Unset, None, int] = UNSET + language_branch: Union[Unset, None, "CompanyUserProfileLanguageBranchModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_translation_id = self.profile_translation_id + profile_id = self.profile_id + language_branch_id = self.language_branch_id + language_branch: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language_branch, Unset): + language_branch = self.language_branch.to_dict() if self.language_branch else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if language_branch_id is not UNSET: + field_dict["languageBranchId"] = language_branch_id + if language_branch is not UNSET: + field_dict["languageBranch"] = language_branch + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_language_branch_model import CompanyUserProfileLanguageBranchModel + + d = src_dict.copy() + profile_translation_id = d.pop("profileTranslationId", UNSET) + + profile_id = d.pop("profileId", UNSET) + + language_branch_id = d.pop("languageBranchId", UNSET) + + _language_branch = d.pop("languageBranch", UNSET) + language_branch: Union[Unset, None, CompanyUserProfileLanguageBranchModel] + if _language_branch is None: + language_branch = None + elif isinstance(_language_branch, Unset): + language_branch = UNSET + else: + language_branch = CompanyUserProfileLanguageBranchModel.from_dict(_language_branch) + + company_user_profile_translation_model = cls( + profile_translation_id=profile_translation_id, + profile_id=profile_id, + language_branch_id=language_branch_id, + language_branch=language_branch, + ) + + return company_user_profile_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_add_edit_model.py new file mode 100644 index 0000000..38e3f22 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_add_edit_model.py @@ -0,0 +1,150 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_work_experience_skill_add_model import ( + CompanyUserProfileWorkExperienceSkillAddModel, + ) + from ..models.location_model import LocationModel + + +T = TypeVar("T", bound="CompanyUserProfileWorkExperienceAddEditModel") + + +@_attrs_define +class CompanyUserProfileWorkExperienceAddEditModel: + """ + Attributes: + title (str): + description (str): + employer (str): + start_date (datetime.datetime): + end_date (Union[Unset, None, datetime.datetime]): + is_current (Union[Unset, None, bool]): + location (Union[Unset, None, LocationModel]): + url (Union[Unset, None, str]): + skills (Union[Unset, None, List['CompanyUserProfileWorkExperienceSkillAddModel']]): + """ + + title: str + description: str + employer: str + start_date: datetime.datetime + end_date: Union[Unset, None, datetime.datetime] = UNSET + is_current: Union[Unset, None, bool] = UNSET + location: Union[Unset, None, "LocationModel"] = UNSET + url: Union[Unset, None, str] = UNSET + skills: Union[Unset, None, List["CompanyUserProfileWorkExperienceSkillAddModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + description = self.description + employer = self.employer + start_date = self.start_date.isoformat() + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + is_current = self.is_current + location: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.location, Unset): + location = self.location.to_dict() if self.location else None + + url = self.url + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + "description": description, + "employer": employer, + "startDate": start_date, + } + ) + if end_date is not UNSET: + field_dict["endDate"] = end_date + if is_current is not UNSET: + field_dict["isCurrent"] = is_current + if location is not UNSET: + field_dict["location"] = location + if url is not UNSET: + field_dict["url"] = url + if skills is not UNSET: + field_dict["skills"] = skills + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_work_experience_skill_add_model import ( + CompanyUserProfileWorkExperienceSkillAddModel, + ) + from ..models.location_model import LocationModel + + d = src_dict.copy() + title = d.pop("title") + + description = d.pop("description") + + employer = d.pop("employer") + + start_date = isoparse(d.pop("startDate")) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + is_current = d.pop("isCurrent", UNSET) + + _location = d.pop("location", UNSET) + location: Union[Unset, None, LocationModel] + if _location is None: + location = None + elif isinstance(_location, Unset): + location = UNSET + else: + location = LocationModel.from_dict(_location) + + url = d.pop("url", UNSET) + + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = CompanyUserProfileWorkExperienceSkillAddModel.from_dict(skills_item_data) + + skills.append(skills_item) + + company_user_profile_work_experience_add_edit_model = cls( + title=title, + description=description, + employer=employer, + start_date=start_date, + end_date=end_date, + is_current=is_current, + location=location, + url=url, + skills=skills, + ) + + return company_user_profile_work_experience_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_model.py new file mode 100644 index 0000000..bf7af5f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_model.py @@ -0,0 +1,206 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_skill_model import CompanyUserProfileSkillModel + from ..models.company_user_profile_work_experience_translation_model import ( + CompanyUserProfileWorkExperienceTranslationModel, + ) + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserProfileWorkExperienceModel") + + +@_attrs_define +class CompanyUserProfileWorkExperienceModel: + """ + Attributes: + profile_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + is_current (Union[Unset, None, bool]): + translations (Union[Unset, None, List['CompanyUserProfileWorkExperienceTranslationModel']]): + location_id (Union[Unset, None, int]): + skills (Union[Unset, None, List['CompanyUserProfileSkillModel']]): + company_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + url (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + profile_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + is_current: Union[Unset, None, bool] = UNSET + translations: Union[Unset, None, List["CompanyUserProfileWorkExperienceTranslationModel"]] = UNSET + location_id: Union[Unset, None, int] = UNSET + skills: Union[Unset, None, List["CompanyUserProfileSkillModel"]] = UNSET + company_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + url: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_id = self.profile_id + id = self.id + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + is_current = self.is_current + translations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.translations, Unset): + if self.translations is None: + translations = None + else: + translations = [] + for translations_item_data in self.translations: + translations_item = translations_item_data.to_dict() + + translations.append(translations_item) + + location_id = self.location_id + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + company_id = self.company_id + company_user_id = self.company_user_id + url = self.url + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if id is not UNSET: + field_dict["id"] = id + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if is_current is not UNSET: + field_dict["isCurrent"] = is_current + if translations is not UNSET: + field_dict["translations"] = translations + if location_id is not UNSET: + field_dict["locationId"] = location_id + if skills is not UNSET: + field_dict["skills"] = skills + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if url is not UNSET: + field_dict["url"] = url + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_skill_model import CompanyUserProfileSkillModel + from ..models.company_user_profile_work_experience_translation_model import ( + CompanyUserProfileWorkExperienceTranslationModel, + ) + from ..models.link import Link + + d = src_dict.copy() + profile_id = d.pop("profileId", UNSET) + + id = d.pop("id", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + is_current = d.pop("isCurrent", UNSET) + + translations = [] + _translations = d.pop("translations", UNSET) + for translations_item_data in _translations or []: + translations_item = CompanyUserProfileWorkExperienceTranslationModel.from_dict(translations_item_data) + + translations.append(translations_item) + + location_id = d.pop("locationId", UNSET) + + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = CompanyUserProfileSkillModel.from_dict(skills_item_data) + + skills.append(skills_item) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + url = d.pop("url", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_profile_work_experience_model = cls( + profile_id=profile_id, + id=id, + start_date=start_date, + end_date=end_date, + is_current=is_current, + translations=translations, + location_id=location_id, + skills=skills, + company_id=company_id, + company_user_id=company_user_id, + url=url, + links=links, + ) + + return company_user_profile_work_experience_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_skill_add_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_skill_add_model.py new file mode 100644 index 0000000..3333a32 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_skill_add_model.py @@ -0,0 +1,45 @@ +from typing import Any, Dict, Type, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="CompanyUserProfileWorkExperienceSkillAddModel") + + +@_attrs_define +class CompanyUserProfileWorkExperienceSkillAddModel: + """ + Attributes: + keyword_synonym_id (int): + name (str): + """ + + keyword_synonym_id: int + name: str + + def to_dict(self) -> Dict[str, Any]: + keyword_synonym_id = self.keyword_synonym_id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "keywordSynonymId": keyword_synonym_id, + "name": name, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + keyword_synonym_id = d.pop("keywordSynonymId") + + name = d.pop("name") + + company_user_profile_work_experience_skill_add_model = cls( + keyword_synonym_id=keyword_synonym_id, + name=name, + ) + + return company_user_profile_work_experience_skill_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_translation_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_translation_model.py new file mode 100644 index 0000000..e4e6bee --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_profile_work_experience_translation_model.py @@ -0,0 +1,101 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + +T = TypeVar("T", bound="CompanyUserProfileWorkExperienceTranslationModel") + + +@_attrs_define +class CompanyUserProfileWorkExperienceTranslationModel: + """ + Attributes: + profile_work_experience_id (Union[Unset, None, int]): + employer (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + profile_id (Union[Unset, None, int]): + profile_translation_id (Union[Unset, None, int]): + profile_translation (Union[Unset, None, CompanyUserProfileTranslationModel]): + """ + + profile_work_experience_id: Union[Unset, None, int] = UNSET + employer: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + profile_id: Union[Unset, None, int] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + profile_translation: Union[Unset, None, "CompanyUserProfileTranslationModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile_work_experience_id = self.profile_work_experience_id + employer = self.employer + title = self.title + description = self.description + profile_id = self.profile_id + profile_translation_id = self.profile_translation_id + profile_translation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_translation, Unset): + profile_translation = self.profile_translation.to_dict() if self.profile_translation else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile_work_experience_id is not UNSET: + field_dict["profileWorkExperienceId"] = profile_work_experience_id + if employer is not UNSET: + field_dict["employer"] = employer + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if profile_translation is not UNSET: + field_dict["profileTranslation"] = profile_translation + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_translation_model import CompanyUserProfileTranslationModel + + d = src_dict.copy() + profile_work_experience_id = d.pop("profileWorkExperienceId", UNSET) + + employer = d.pop("employer", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + profile_id = d.pop("profileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _profile_translation = d.pop("profileTranslation", UNSET) + profile_translation: Union[Unset, None, CompanyUserProfileTranslationModel] + if _profile_translation is None: + profile_translation = None + elif isinstance(_profile_translation, Unset): + profile_translation = UNSET + else: + profile_translation = CompanyUserProfileTranslationModel.from_dict(_profile_translation) + + company_user_profile_work_experience_translation_model = cls( + profile_work_experience_id=profile_work_experience_id, + employer=employer, + title=title, + description=description, + profile_id=profile_id, + profile_translation_id=profile_translation_id, + profile_translation=profile_translation, + ) + + return company_user_profile_work_experience_translation_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_project_assignment_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_project_assignment_model.py new file mode 100644 index 0000000..b2959b0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_project_assignment_model.py @@ -0,0 +1,81 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + + +T = TypeVar("T", bound="CompanyUserProjectAssignmentModel") + + +@_attrs_define +class CompanyUserProjectAssignmentModel: + """ + Attributes: + assigned (Union[Unset, None, List['ProjectAssignmentBaseModel']]): + prospect (Union[Unset, None, List['ProjectAssignmentBaseModel']]): + """ + + assigned: Union[Unset, None, List["ProjectAssignmentBaseModel"]] = UNSET + prospect: Union[Unset, None, List["ProjectAssignmentBaseModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + assigned: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.assigned, Unset): + if self.assigned is None: + assigned = None + else: + assigned = [] + for assigned_item_data in self.assigned: + assigned_item = assigned_item_data.to_dict() + + assigned.append(assigned_item) + + prospect: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.prospect, Unset): + if self.prospect is None: + prospect = None + else: + prospect = [] + for prospect_item_data in self.prospect: + prospect_item = prospect_item_data.to_dict() + + prospect.append(prospect_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if assigned is not UNSET: + field_dict["assigned"] = assigned + if prospect is not UNSET: + field_dict["prospect"] = prospect + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + + d = src_dict.copy() + assigned = [] + _assigned = d.pop("assigned", UNSET) + for assigned_item_data in _assigned or []: + assigned_item = ProjectAssignmentBaseModel.from_dict(assigned_item_data) + + assigned.append(assigned_item) + + prospect = [] + _prospect = d.pop("prospect", UNSET) + for prospect_item_data in _prospect or []: + prospect_item = ProjectAssignmentBaseModel.from_dict(prospect_item_data) + + prospect.append(prospect_item) + + company_user_project_assignment_model = cls( + assigned=assigned, + prospect=prospect, + ) + + return company_user_project_assignment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_query_sort.py b/src/cinode-py-client/cinode_api_client/models/company_user_query_sort.py new file mode 100644 index 0000000..18e7d63 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_query_sort.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class CompanyUserQuerySort(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_query_sort_page_and_sort_by_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_query_sort_page_and_sort_by_model.py new file mode 100644 index 0000000..69bd7c6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_query_sort_page_and_sort_by_model.py @@ -0,0 +1,91 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_query_sort import CompanyUserQuerySort +from ..models.sort_order import SortOrder +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserQuerySortPageAndSortByModel") + + +@_attrs_define +class CompanyUserQuerySortPageAndSortByModel: + """ + Attributes: + sort_by (Union[Unset, CompanyUserQuerySort]): + + CreatedDateTime = 0 + + FirstName = 1 + + LastName = 2 + + Email = 3 + + UpdatedDateTime = 4 + sort_order (Union[Unset, SortOrder]): 0 - Ascending, + 1 - Descending + page (Union[Unset, int]): Default: 1. + items_per_page (Union[Unset, int]): Default: 15. + """ + + sort_by: Union[Unset, CompanyUserQuerySort] = UNSET + sort_order: Union[Unset, SortOrder] = UNSET + page: Union[Unset, int] = 1 + items_per_page: Union[Unset, int] = 15 + + def to_dict(self) -> Dict[str, Any]: + sort_by: Union[Unset, int] = UNSET + if not isinstance(self.sort_by, Unset): + sort_by = self.sort_by.value + + sort_order: Union[Unset, int] = UNSET + if not isinstance(self.sort_order, Unset): + sort_order = self.sort_order.value + + page = self.page + items_per_page = self.items_per_page + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if sort_by is not UNSET: + field_dict["sortBy"] = sort_by + if sort_order is not UNSET: + field_dict["sortOrder"] = sort_order + if page is not UNSET: + field_dict["page"] = page + if items_per_page is not UNSET: + field_dict["itemsPerPage"] = items_per_page + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _sort_by = d.pop("sortBy", UNSET) + sort_by: Union[Unset, CompanyUserQuerySort] + if isinstance(_sort_by, Unset): + sort_by = UNSET + else: + sort_by = CompanyUserQuerySort(_sort_by) + + _sort_order = d.pop("sortOrder", UNSET) + sort_order: Union[Unset, SortOrder] + if isinstance(_sort_order, Unset): + sort_order = UNSET + else: + sort_order = SortOrder(_sort_order) + + page = d.pop("page", UNSET) + + items_per_page = d.pop("itemsPerPage", UNSET) + + company_user_query_sort_page_and_sort_by_model = cls( + sort_by=sort_by, + sort_order=sort_order, + page=page, + items_per_page=items_per_page, + ) + + return company_user_query_sort_page_and_sort_by_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_resume_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_resume_base_model.py new file mode 100644 index 0000000..401fdf8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_resume_base_model.py @@ -0,0 +1,194 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_resume_template_base_model import CompanyResumeTemplateBaseModel + from ..models.company_resume_template_language_model import CompanyResumeTemplateLanguageModel + from ..models.created_model import CreatedModel + from ..models.link import Link + from ..models.updated_model import UpdatedModel + + +T = TypeVar("T", bound="CompanyUserResumeBaseModel") + + +@_attrs_define +class CompanyUserResumeBaseModel: + """ + Attributes: + id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + created (Union[Unset, None, CreatedModel]): + updated (Union[Unset, None, UpdatedModel]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + slug (Union[Unset, None, str]): + language (Union[Unset, None, CompanyResumeTemplateLanguageModel]): + template (Union[Unset, None, CompanyResumeTemplateBaseModel]): + is_public (Union[Unset, bool]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + created: Union[Unset, None, "CreatedModel"] = UNSET + updated: Union[Unset, None, "UpdatedModel"] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + slug: Union[Unset, None, str] = UNSET + language: Union[Unset, None, "CompanyResumeTemplateLanguageModel"] = UNSET + template: Union[Unset, None, "CompanyResumeTemplateBaseModel"] = UNSET + is_public: Union[Unset, bool] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_user_id = self.company_user_id + company_id = self.company_id + created: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.created, Unset): + created = self.created.to_dict() if self.created else None + + updated: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.to_dict() if self.updated else None + + title = self.title + description = self.description + slug = self.slug + language: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language, Unset): + language = self.language.to_dict() if self.language else None + + template: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.template, Unset): + template = self.template.to_dict() if self.template else None + + is_public = self.is_public + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if slug is not UNSET: + field_dict["slug"] = slug + if language is not UNSET: + field_dict["language"] = language + if template is not UNSET: + field_dict["template"] = template + if is_public is not UNSET: + field_dict["isPublic"] = is_public + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_resume_template_base_model import CompanyResumeTemplateBaseModel + from ..models.company_resume_template_language_model import CompanyResumeTemplateLanguageModel + from ..models.created_model import CreatedModel + from ..models.link import Link + from ..models.updated_model import UpdatedModel + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, None, CreatedModel] + if _created is None: + created = None + elif isinstance(_created, Unset): + created = UNSET + else: + created = CreatedModel.from_dict(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, UpdatedModel] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = UpdatedModel.from_dict(_updated) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + slug = d.pop("slug", UNSET) + + _language = d.pop("language", UNSET) + language: Union[Unset, None, CompanyResumeTemplateLanguageModel] + if _language is None: + language = None + elif isinstance(_language, Unset): + language = UNSET + else: + language = CompanyResumeTemplateLanguageModel.from_dict(_language) + + _template = d.pop("template", UNSET) + template: Union[Unset, None, CompanyResumeTemplateBaseModel] + if _template is None: + template = None + elif isinstance(_template, Unset): + template = UNSET + else: + template = CompanyResumeTemplateBaseModel.from_dict(_template) + + is_public = d.pop("isPublic", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_resume_base_model = cls( + id=id, + company_user_id=company_user_id, + company_id=company_id, + created=created, + updated=updated, + title=title, + description=description, + slug=slug, + language=language, + template=template, + is_public=is_public, + links=links, + ) + + return company_user_resume_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_search_skill_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_search_skill_model.py new file mode 100644 index 0000000..197a47c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_search_skill_model.py @@ -0,0 +1,248 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_status import CompanyUserStatus +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_subcontractor_group_base_model import CompanySubcontractorGroupBaseModel + from ..models.skill_result_model import SkillResultModel + from ..models.team_base_model import TeamBaseModel + + +T = TypeVar("T", bound="CompanyUserSearchSkillModel") + + +@_attrs_define +class CompanyUserSearchSkillModel: + """ + Attributes: + company_id (Union[Unset, int]): + company_user_id (Union[Unset, None, int]): + firstname (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + lastname (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + title (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + address_id (Union[Unset, None, int]): + address_display_name (Union[Unset, None, str]): + teams (Union[Unset, None, List['TeamBaseModel']]): + skills (Union[Unset, None, List['SkillResultModel']]): + status (Union[Unset, None, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + company_candidate_id (Union[Unset, None, int]): + groups (Union[Unset, None, List['CompanySubcontractorGroupBaseModel']]): + company_user_type (Union[Unset, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + """ + + company_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + firstname: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + lastname: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + address_id: Union[Unset, None, int] = UNSET + address_display_name: Union[Unset, None, str] = UNSET + teams: Union[Unset, None, List["TeamBaseModel"]] = UNSET + skills: Union[Unset, None, List["SkillResultModel"]] = UNSET + status: Union[Unset, None, CompanyUserStatus] = UNSET + company_candidate_id: Union[Unset, None, int] = UNSET + groups: Union[Unset, None, List["CompanySubcontractorGroupBaseModel"]] = UNSET + company_user_type: Union[Unset, CompanyUserType] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + company_user_id = self.company_user_id + firstname = self.firstname + first_name = self.first_name + lastname = self.lastname + last_name = self.last_name + title = self.title + seo_id = self.seo_id + address_id = self.address_id + address_display_name = self.address_display_name + teams: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.teams, Unset): + if self.teams is None: + teams = None + else: + teams = [] + for teams_item_data in self.teams: + teams_item = teams_item_data.to_dict() + + teams.append(teams_item) + + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + company_candidate_id = self.company_candidate_id + groups: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.groups, Unset): + if self.groups is None: + groups = None + else: + groups = [] + for groups_item_data in self.groups: + groups_item = groups_item_data.to_dict() + + groups.append(groups_item) + + company_user_type: Union[Unset, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if firstname is not UNSET: + field_dict["firstname"] = firstname + if first_name is not UNSET: + field_dict["firstName"] = first_name + if lastname is not UNSET: + field_dict["lastname"] = lastname + if last_name is not UNSET: + field_dict["lastName"] = last_name + if title is not UNSET: + field_dict["title"] = title + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if address_id is not UNSET: + field_dict["addressId"] = address_id + if address_display_name is not UNSET: + field_dict["addressDisplayName"] = address_display_name + if teams is not UNSET: + field_dict["teams"] = teams + if skills is not UNSET: + field_dict["skills"] = skills + if status is not UNSET: + field_dict["status"] = status + if company_candidate_id is not UNSET: + field_dict["companyCandidateId"] = company_candidate_id + if groups is not UNSET: + field_dict["groups"] = groups + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_subcontractor_group_base_model import CompanySubcontractorGroupBaseModel + from ..models.skill_result_model import SkillResultModel + from ..models.team_base_model import TeamBaseModel + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + firstname = d.pop("firstname", UNSET) + + first_name = d.pop("firstName", UNSET) + + lastname = d.pop("lastname", UNSET) + + last_name = d.pop("lastName", UNSET) + + title = d.pop("title", UNSET) + + seo_id = d.pop("seoId", UNSET) + + address_id = d.pop("addressId", UNSET) + + address_display_name = d.pop("addressDisplayName", UNSET) + + teams = [] + _teams = d.pop("teams", UNSET) + for teams_item_data in _teams or []: + teams_item = TeamBaseModel.from_dict(teams_item_data) + + teams.append(teams_item) + + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = SkillResultModel.from_dict(skills_item_data) + + skills.append(skills_item) + + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + company_candidate_id = d.pop("companyCandidateId", UNSET) + + groups = [] + _groups = d.pop("groups", UNSET) + for groups_item_data in _groups or []: + groups_item = CompanySubcontractorGroupBaseModel.from_dict(groups_item_data) + + groups.append(groups_item) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, CompanyUserType] + if isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + company_user_search_skill_model = cls( + company_id=company_id, + company_user_id=company_user_id, + firstname=firstname, + first_name=first_name, + lastname=lastname, + last_name=last_name, + title=title, + seo_id=seo_id, + address_id=address_id, + address_display_name=address_display_name, + teams=teams, + skills=skills, + status=status, + company_candidate_id=company_candidate_id, + groups=groups, + company_user_type=company_user_type, + ) + + return company_user_search_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_skill_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_skill_model.py new file mode 100644 index 0000000..ab06cc8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_skill_model.py @@ -0,0 +1,162 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.keyword_model import KeywordModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserSkillModel") + + +@_attrs_define +class CompanyUserSkillModel: + """ + Attributes: + company_id (Union[Unset, int]): + company_user_id (Union[Unset, int]): + number_of_days_work_experience (Union[Unset, int]): + profile_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + level (Union[Unset, None, int]): + level_goal (Union[Unset, None, int]): + level_goal_deadline (Union[Unset, None, datetime.datetime]): + keyword (Union[Unset, None, KeywordModel]): + favourite (Union[Unset, bool]): + links (Union[Unset, None, List['Link']]): + """ + + company_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + number_of_days_work_experience: Union[Unset, int] = UNSET + profile_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + level: Union[Unset, None, int] = UNSET + level_goal: Union[Unset, None, int] = UNSET + level_goal_deadline: Union[Unset, None, datetime.datetime] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + favourite: Union[Unset, bool] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + company_user_id = self.company_user_id + number_of_days_work_experience = self.number_of_days_work_experience + profile_id = self.profile_id + id = self.id + level = self.level + level_goal = self.level_goal + level_goal_deadline: Union[Unset, None, str] = UNSET + if not isinstance(self.level_goal_deadline, Unset): + level_goal_deadline = self.level_goal_deadline.isoformat() if self.level_goal_deadline else None + + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + favourite = self.favourite + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if number_of_days_work_experience is not UNSET: + field_dict["numberOfDaysWorkExperience"] = number_of_days_work_experience + if profile_id is not UNSET: + field_dict["profileId"] = profile_id + if id is not UNSET: + field_dict["id"] = id + if level is not UNSET: + field_dict["level"] = level + if level_goal is not UNSET: + field_dict["levelGoal"] = level_goal + if level_goal_deadline is not UNSET: + field_dict["levelGoalDeadline"] = level_goal_deadline + if keyword is not UNSET: + field_dict["keyword"] = keyword + if favourite is not UNSET: + field_dict["favourite"] = favourite + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.keyword_model import KeywordModel + from ..models.link import Link + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + number_of_days_work_experience = d.pop("numberOfDaysWorkExperience", UNSET) + + profile_id = d.pop("profileId", UNSET) + + id = d.pop("id", UNSET) + + level = d.pop("level", UNSET) + + level_goal = d.pop("levelGoal", UNSET) + + _level_goal_deadline = d.pop("levelGoalDeadline", UNSET) + level_goal_deadline: Union[Unset, None, datetime.datetime] + if _level_goal_deadline is None: + level_goal_deadline = None + elif isinstance(_level_goal_deadline, Unset): + level_goal_deadline = UNSET + else: + level_goal_deadline = isoparse(_level_goal_deadline) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + favourite = d.pop("favourite", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_skill_model = cls( + company_id=company_id, + company_user_id=company_user_id, + number_of_days_work_experience=number_of_days_work_experience, + profile_id=profile_id, + id=id, + level=level, + level_goal=level_goal, + level_goal_deadline=level_goal_deadline, + keyword=keyword, + favourite=favourite, + links=links, + ) + + return company_user_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_status.py b/src/cinode-py-client/cinode_api_client/models/company_user_status.py new file mode 100644 index 0000000..5c09f8f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_status.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class CompanyUserStatus(IntEnum): + VALUE_0 = 0 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_add_edit_model.py new file mode 100644 index 0000000..897d1c4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_add_edit_model.py @@ -0,0 +1,194 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.user_gender import UserGender +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CompanyUserSubcontractorAddEditModel") + + +@_attrs_define +class CompanyUserSubcontractorAddEditModel: + """ + Attributes: + first_name (str): + last_name (str): + email (str): + password (str): + password_confirm (str): + gender (UserGender): + + Ej angiven = 0 + + Man = 1 + + Kvinna = 2 + language_id (int): + title (Union[Unset, None, str]): + profile_language_id (Union[Unset, None, int]): + create_profile (Union[Unset, bool]): + tariff (Union[Unset, None, int]): + phone (Union[Unset, None, str]): + currency_id (Union[Unset, None, int]): + company_calendar_id (Union[Unset, None, int]): + company_address_id (Union[Unset, None, int]): + company_name (Union[Unset, None, str]): + company_identifier (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + rating (Union[Unset, None, int]): + """ + + first_name: str + last_name: str + email: str + password: str + password_confirm: str + gender: UserGender + language_id: int + title: Union[Unset, None, str] = UNSET + profile_language_id: Union[Unset, None, int] = UNSET + create_profile: Union[Unset, bool] = UNSET + tariff: Union[Unset, None, int] = UNSET + phone: Union[Unset, None, str] = UNSET + currency_id: Union[Unset, None, int] = UNSET + company_calendar_id: Union[Unset, None, int] = UNSET + company_address_id: Union[Unset, None, int] = UNSET + company_name: Union[Unset, None, str] = UNSET + company_identifier: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + rating: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + first_name = self.first_name + last_name = self.last_name + email = self.email + password = self.password + password_confirm = self.password_confirm + gender = self.gender.value + + language_id = self.language_id + title = self.title + profile_language_id = self.profile_language_id + create_profile = self.create_profile + tariff = self.tariff + phone = self.phone + currency_id = self.currency_id + company_calendar_id = self.company_calendar_id + company_address_id = self.company_address_id + company_name = self.company_name + company_identifier = self.company_identifier + internal_identifier = self.internal_identifier + linked_in = self.linked_in + rating = self.rating + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "firstName": first_name, + "lastName": last_name, + "email": email, + "password": password, + "passwordConfirm": password_confirm, + "gender": gender, + "languageId": language_id, + } + ) + if title is not UNSET: + field_dict["title"] = title + if profile_language_id is not UNSET: + field_dict["profileLanguageId"] = profile_language_id + if create_profile is not UNSET: + field_dict["createProfile"] = create_profile + if tariff is not UNSET: + field_dict["tariff"] = tariff + if phone is not UNSET: + field_dict["phone"] = phone + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if company_calendar_id is not UNSET: + field_dict["companyCalendarId"] = company_calendar_id + if company_address_id is not UNSET: + field_dict["companyAddressId"] = company_address_id + if company_name is not UNSET: + field_dict["companyName"] = company_name + if company_identifier is not UNSET: + field_dict["companyIdentifier"] = company_identifier + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if rating is not UNSET: + field_dict["rating"] = rating + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + first_name = d.pop("firstName") + + last_name = d.pop("lastName") + + email = d.pop("email") + + password = d.pop("password") + + password_confirm = d.pop("passwordConfirm") + + gender = UserGender(d.pop("gender")) + + language_id = d.pop("languageId") + + title = d.pop("title", UNSET) + + profile_language_id = d.pop("profileLanguageId", UNSET) + + create_profile = d.pop("createProfile", UNSET) + + tariff = d.pop("tariff", UNSET) + + phone = d.pop("phone", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + company_calendar_id = d.pop("companyCalendarId", UNSET) + + company_address_id = d.pop("companyAddressId", UNSET) + + company_name = d.pop("companyName", UNSET) + + company_identifier = d.pop("companyIdentifier", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + rating = d.pop("rating", UNSET) + + company_user_subcontractor_add_edit_model = cls( + first_name=first_name, + last_name=last_name, + email=email, + password=password, + password_confirm=password_confirm, + gender=gender, + language_id=language_id, + title=title, + profile_language_id=profile_language_id, + create_profile=create_profile, + tariff=tariff, + phone=phone, + currency_id=currency_id, + company_calendar_id=company_calendar_id, + company_address_id=company_address_id, + company_name=company_name, + company_identifier=company_identifier, + internal_identifier=internal_identifier, + linked_in=linked_in, + rating=rating, + ) + + return company_user_subcontractor_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_attachment_model.py new file mode 100644 index 0000000..68d09bc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_attachment_model.py @@ -0,0 +1,119 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserSubcontractorAttachmentModel") + + +@_attrs_define +class CompanyUserSubcontractorAttachmentModel: + """ + Attributes: + company_user_id (Union[Unset, int]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, None, int]): + id (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, int] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + id = self.id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_subcontractor_attachment_model = cls( + company_user_id=company_user_id, + attachment_type=attachment_type, + company_id=company_id, + id=id, + title=title, + description=description, + links=links, + ) + + return company_user_subcontractor_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_base_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_base_model.py new file mode 100644 index 0000000..6c64728 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_base_model.py @@ -0,0 +1,306 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_subcontractor_status import CompanyUserSubcontractorStatus +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.link import Link + from ..models.location_model import LocationModel + + +T = TypeVar("T", bound="CompanyUserSubcontractorBaseModel") + + +@_attrs_define +class CompanyUserSubcontractorBaseModel: + """ + Attributes: + status (Union[Unset, None, CompanyUserSubcontractorStatus]): + + Frånkopplad = 0 + + Aktiv = 1 + rating (Union[Unset, None, int]): + email (Union[Unset, None, str]): + company_name (Union[Unset, None, str]): + company_identifier (Union[Unset, None, str]): + company_address (Union[Unset, None, CompanyAddressModel]): + home_address (Union[Unset, None, LocationModel]): + image (Union[Unset, None, CompanyUserImageModel]): + desired_assignment (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + twitter (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + blog (Union[Unset, None, str]): + git_hub (Union[Unset, None, str]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + status: Union[Unset, None, CompanyUserSubcontractorStatus] = UNSET + rating: Union[Unset, None, int] = UNSET + email: Union[Unset, None, str] = UNSET + company_name: Union[Unset, None, str] = UNSET + company_identifier: Union[Unset, None, str] = UNSET + company_address: Union[Unset, None, "CompanyAddressModel"] = UNSET + home_address: Union[Unset, None, "LocationModel"] = UNSET + image: Union[Unset, None, "CompanyUserImageModel"] = UNSET + desired_assignment: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + twitter: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + blog: Union[Unset, None, str] = UNSET + git_hub: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + rating = self.rating + email = self.email + company_name = self.company_name + company_identifier = self.company_identifier + company_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_address, Unset): + company_address = self.company_address.to_dict() if self.company_address else None + + home_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.home_address, Unset): + home_address = self.home_address.to_dict() if self.home_address else None + + image: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.image, Unset): + image = self.image.to_dict() if self.image else None + + desired_assignment = self.desired_assignment + internal_identifier = self.internal_identifier + twitter = self.twitter + linked_in = self.linked_in + homepage = self.homepage + blog = self.blog + git_hub = self.git_hub + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if status is not UNSET: + field_dict["status"] = status + if rating is not UNSET: + field_dict["rating"] = rating + if email is not UNSET: + field_dict["email"] = email + if company_name is not UNSET: + field_dict["companyName"] = company_name + if company_identifier is not UNSET: + field_dict["companyIdentifier"] = company_identifier + if company_address is not UNSET: + field_dict["companyAddress"] = company_address + if home_address is not UNSET: + field_dict["homeAddress"] = home_address + if image is not UNSET: + field_dict["image"] = image + if desired_assignment is not UNSET: + field_dict["desiredAssignment"] = desired_assignment + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if twitter is not UNSET: + field_dict["twitter"] = twitter + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if homepage is not UNSET: + field_dict["homepage"] = homepage + if blog is not UNSET: + field_dict["blog"] = blog + if git_hub is not UNSET: + field_dict["gitHub"] = git_hub + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.link import Link + from ..models.location_model import LocationModel + + d = src_dict.copy() + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserSubcontractorStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserSubcontractorStatus(_status) + + rating = d.pop("rating", UNSET) + + email = d.pop("email", UNSET) + + company_name = d.pop("companyName", UNSET) + + company_identifier = d.pop("companyIdentifier", UNSET) + + _company_address = d.pop("companyAddress", UNSET) + company_address: Union[Unset, None, CompanyAddressModel] + if _company_address is None: + company_address = None + elif isinstance(_company_address, Unset): + company_address = UNSET + else: + company_address = CompanyAddressModel.from_dict(_company_address) + + _home_address = d.pop("homeAddress", UNSET) + home_address: Union[Unset, None, LocationModel] + if _home_address is None: + home_address = None + elif isinstance(_home_address, Unset): + home_address = UNSET + else: + home_address = LocationModel.from_dict(_home_address) + + _image = d.pop("image", UNSET) + image: Union[Unset, None, CompanyUserImageModel] + if _image is None: + image = None + elif isinstance(_image, Unset): + image = UNSET + else: + image = CompanyUserImageModel.from_dict(_image) + + desired_assignment = d.pop("desiredAssignment", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + twitter = d.pop("twitter", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + homepage = d.pop("homepage", UNSET) + + blog = d.pop("blog", UNSET) + + git_hub = d.pop("gitHub", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_subcontractor_base_model = cls( + status=status, + rating=rating, + email=email, + company_name=company_name, + company_identifier=company_identifier, + company_address=company_address, + home_address=home_address, + image=image, + desired_assignment=desired_assignment, + internal_identifier=internal_identifier, + twitter=twitter, + linked_in=linked_in, + homepage=homepage, + blog=blog, + git_hub=git_hub, + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_user_subcontractor_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_list_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_list_model.py new file mode 100644 index 0000000..b09fd4f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_list_model.py @@ -0,0 +1,101 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_subcontractor_file_attachment_model import CompanyUserSubcontractorFileAttachmentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserSubcontractorFileAttachmentListModel") + + +@_attrs_define +class CompanyUserSubcontractorFileAttachmentListModel: + """ + Attributes: + company_user_id (Union[Unset, int]): + company_id (Union[Unset, int]): + attachments (Union[Unset, None, List['CompanyUserSubcontractorFileAttachmentModel']]): + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + attachments: Union[Unset, None, List["CompanyUserSubcontractorFileAttachmentModel"]] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + company_id = self.company_id + attachments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.attachments, Unset): + if self.attachments is None: + attachments = None + else: + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + + attachments.append(attachments_item) + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if attachments is not UNSET: + field_dict["attachments"] = attachments + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_subcontractor_file_attachment_model import ( + CompanyUserSubcontractorFileAttachmentModel, + ) + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + attachments = [] + _attachments = d.pop("attachments", UNSET) + for attachments_item_data in _attachments or []: + attachments_item = CompanyUserSubcontractorFileAttachmentModel.from_dict(attachments_item_data) + + attachments.append(attachments_item) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_subcontractor_file_attachment_list_model = cls( + company_user_id=company_user_id, + company_id=company_id, + attachments=attachments, + links=links, + ) + + return company_user_subcontractor_file_attachment_list_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_model.py new file mode 100644 index 0000000..bda17d2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_file_attachment_model.py @@ -0,0 +1,135 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CompanyUserSubcontractorFileAttachmentModel") + + +@_attrs_define +class CompanyUserSubcontractorFileAttachmentModel: + """ + Attributes: + file_name (Union[Unset, None, str]): + extension (Union[Unset, None, str]): + company_user_id (Union[Unset, int]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, None, int]): + id (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + file_name: Union[Unset, None, str] = UNSET + extension: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, int] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + file_name = self.file_name + extension = self.extension + company_user_id = self.company_user_id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + id = self.id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if file_name is not UNSET: + field_dict["fileName"] = file_name + if extension is not UNSET: + field_dict["extension"] = extension + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + file_name = d.pop("fileName", UNSET) + + extension = d.pop("extension", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_subcontractor_file_attachment_model = cls( + file_name=file_name, + extension=extension, + company_user_id=company_user_id, + attachment_type=attachment_type, + company_id=company_id, + id=id, + title=title, + description=description, + links=links, + ) + + return company_user_subcontractor_file_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_model.py new file mode 100644 index 0000000..00ec429 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_model.py @@ -0,0 +1,460 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_subcontractor_status import CompanyUserSubcontractorStatus +from ..models.company_user_type import CompanyUserType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_subcontractor_group_base_model import CompanySubcontractorGroupBaseModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.company_user_resume_base_model import CompanyUserResumeBaseModel + from ..models.company_user_subcontractor_attachment_model import CompanyUserSubcontractorAttachmentModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.location_model import LocationModel + + +T = TypeVar("T", bound="CompanyUserSubcontractorModel") + + +@_attrs_define +class CompanyUserSubcontractorModel: + """ + Attributes: + resumes (Union[Unset, None, List['CompanyUserResumeBaseModel']]): + default_currency (Union[Unset, None, CurrencyModel]): + tariff (Union[Unset, None, int]): + created_date_time (Union[Unset, datetime.datetime]): + groups (Union[Unset, None, List['CompanySubcontractorGroupBaseModel']]): + phone (Union[Unset, None, str]): + tags (Union[Unset, None, List['CompanyTagBaseModel']]): + attachments (Union[Unset, None, List['CompanyUserSubcontractorAttachmentModel']]): + status (Union[Unset, None, CompanyUserSubcontractorStatus]): + + Frånkopplad = 0 + + Aktiv = 1 + rating (Union[Unset, None, int]): + email (Union[Unset, None, str]): + company_name (Union[Unset, None, str]): + company_identifier (Union[Unset, None, str]): + company_address (Union[Unset, None, CompanyAddressModel]): + home_address (Union[Unset, None, LocationModel]): + image (Union[Unset, None, CompanyUserImageModel]): + desired_assignment (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + twitter (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + blog (Union[Unset, None, str]): + git_hub (Union[Unset, None, str]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + id (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + resumes: Union[Unset, None, List["CompanyUserResumeBaseModel"]] = UNSET + default_currency: Union[Unset, None, "CurrencyModel"] = UNSET + tariff: Union[Unset, None, int] = UNSET + created_date_time: Union[Unset, datetime.datetime] = UNSET + groups: Union[Unset, None, List["CompanySubcontractorGroupBaseModel"]] = UNSET + phone: Union[Unset, None, str] = UNSET + tags: Union[Unset, None, List["CompanyTagBaseModel"]] = UNSET + attachments: Union[Unset, None, List["CompanyUserSubcontractorAttachmentModel"]] = UNSET + status: Union[Unset, None, CompanyUserSubcontractorStatus] = UNSET + rating: Union[Unset, None, int] = UNSET + email: Union[Unset, None, str] = UNSET + company_name: Union[Unset, None, str] = UNSET + company_identifier: Union[Unset, None, str] = UNSET + company_address: Union[Unset, None, "CompanyAddressModel"] = UNSET + home_address: Union[Unset, None, "LocationModel"] = UNSET + image: Union[Unset, None, "CompanyUserImageModel"] = UNSET + desired_assignment: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + twitter: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + blog: Union[Unset, None, str] = UNSET + git_hub: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + id: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + resumes: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.resumes, Unset): + if self.resumes is None: + resumes = None + else: + resumes = [] + for resumes_item_data in self.resumes: + resumes_item = resumes_item_data.to_dict() + + resumes.append(resumes_item) + + default_currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.default_currency, Unset): + default_currency = self.default_currency.to_dict() if self.default_currency else None + + tariff = self.tariff + created_date_time: Union[Unset, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() + + groups: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.groups, Unset): + if self.groups is None: + groups = None + else: + groups = [] + for groups_item_data in self.groups: + groups_item = groups_item_data.to_dict() + + groups.append(groups_item) + + phone = self.phone + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + attachments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.attachments, Unset): + if self.attachments is None: + attachments = None + else: + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + + attachments.append(attachments_item) + + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + rating = self.rating + email = self.email + company_name = self.company_name + company_identifier = self.company_identifier + company_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_address, Unset): + company_address = self.company_address.to_dict() if self.company_address else None + + home_address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.home_address, Unset): + home_address = self.home_address.to_dict() if self.home_address else None + + image: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.image, Unset): + image = self.image.to_dict() if self.image else None + + desired_assignment = self.desired_assignment + internal_identifier = self.internal_identifier + twitter = self.twitter + linked_in = self.linked_in + homepage = self.homepage + blog = self.blog + git_hub = self.git_hub + company_user_id = self.company_user_id + company_id = self.company_id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + id = self.id + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if resumes is not UNSET: + field_dict["resumes"] = resumes + if default_currency is not UNSET: + field_dict["defaultCurrency"] = default_currency + if tariff is not UNSET: + field_dict["tariff"] = tariff + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if groups is not UNSET: + field_dict["groups"] = groups + if phone is not UNSET: + field_dict["phone"] = phone + if tags is not UNSET: + field_dict["tags"] = tags + if attachments is not UNSET: + field_dict["attachments"] = attachments + if status is not UNSET: + field_dict["status"] = status + if rating is not UNSET: + field_dict["rating"] = rating + if email is not UNSET: + field_dict["email"] = email + if company_name is not UNSET: + field_dict["companyName"] = company_name + if company_identifier is not UNSET: + field_dict["companyIdentifier"] = company_identifier + if company_address is not UNSET: + field_dict["companyAddress"] = company_address + if home_address is not UNSET: + field_dict["homeAddress"] = home_address + if image is not UNSET: + field_dict["image"] = image + if desired_assignment is not UNSET: + field_dict["desiredAssignment"] = desired_assignment + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if twitter is not UNSET: + field_dict["twitter"] = twitter + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if homepage is not UNSET: + field_dict["homepage"] = homepage + if blog is not UNSET: + field_dict["blog"] = blog + if git_hub is not UNSET: + field_dict["gitHub"] = git_hub + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if id is not UNSET: + field_dict["id"] = id + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_address_model import CompanyAddressModel + from ..models.company_subcontractor_group_base_model import CompanySubcontractorGroupBaseModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.company_user_image_model import CompanyUserImageModel + from ..models.company_user_resume_base_model import CompanyUserResumeBaseModel + from ..models.company_user_subcontractor_attachment_model import CompanyUserSubcontractorAttachmentModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.location_model import LocationModel + + d = src_dict.copy() + resumes = [] + _resumes = d.pop("resumes", UNSET) + for resumes_item_data in _resumes or []: + resumes_item = CompanyUserResumeBaseModel.from_dict(resumes_item_data) + + resumes.append(resumes_item) + + _default_currency = d.pop("defaultCurrency", UNSET) + default_currency: Union[Unset, None, CurrencyModel] + if _default_currency is None: + default_currency = None + elif isinstance(_default_currency, Unset): + default_currency = UNSET + else: + default_currency = CurrencyModel.from_dict(_default_currency) + + tariff = d.pop("tariff", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, datetime.datetime] + if isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + groups = [] + _groups = d.pop("groups", UNSET) + for groups_item_data in _groups or []: + groups_item = CompanySubcontractorGroupBaseModel.from_dict(groups_item_data) + + groups.append(groups_item) + + phone = d.pop("phone", UNSET) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagBaseModel.from_dict(tags_item_data) + + tags.append(tags_item) + + attachments = [] + _attachments = d.pop("attachments", UNSET) + for attachments_item_data in _attachments or []: + attachments_item = CompanyUserSubcontractorAttachmentModel.from_dict(attachments_item_data) + + attachments.append(attachments_item) + + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserSubcontractorStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserSubcontractorStatus(_status) + + rating = d.pop("rating", UNSET) + + email = d.pop("email", UNSET) + + company_name = d.pop("companyName", UNSET) + + company_identifier = d.pop("companyIdentifier", UNSET) + + _company_address = d.pop("companyAddress", UNSET) + company_address: Union[Unset, None, CompanyAddressModel] + if _company_address is None: + company_address = None + elif isinstance(_company_address, Unset): + company_address = UNSET + else: + company_address = CompanyAddressModel.from_dict(_company_address) + + _home_address = d.pop("homeAddress", UNSET) + home_address: Union[Unset, None, LocationModel] + if _home_address is None: + home_address = None + elif isinstance(_home_address, Unset): + home_address = UNSET + else: + home_address = LocationModel.from_dict(_home_address) + + _image = d.pop("image", UNSET) + image: Union[Unset, None, CompanyUserImageModel] + if _image is None: + image = None + elif isinstance(_image, Unset): + image = UNSET + else: + image = CompanyUserImageModel.from_dict(_image) + + desired_assignment = d.pop("desiredAssignment", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + twitter = d.pop("twitter", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + homepage = d.pop("homepage", UNSET) + + blog = d.pop("blog", UNSET) + + git_hub = d.pop("gitHub", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + id = d.pop("id", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + company_user_subcontractor_model = cls( + resumes=resumes, + default_currency=default_currency, + tariff=tariff, + created_date_time=created_date_time, + groups=groups, + phone=phone, + tags=tags, + attachments=attachments, + status=status, + rating=rating, + email=email, + company_name=company_name, + company_identifier=company_identifier, + company_address=company_address, + home_address=home_address, + image=image, + desired_assignment=desired_assignment, + internal_identifier=internal_identifier, + twitter=twitter, + linked_in=linked_in, + homepage=homepage, + blog=blog, + git_hub=git_hub, + company_user_id=company_user_id, + company_id=company_id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + id=id, + links=links, + ) + + return company_user_subcontractor_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_role_member_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_role_member_model.py new file mode 100644 index 0000000..fdd16f9 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_role_member_model.py @@ -0,0 +1,109 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.currency_model import CurrencyModel + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + from ..models.project_assignment_member_state_history_model import ProjectAssignmentMemberStateHistoryModel + + +T = TypeVar("T", bound="CompanyUserSubcontractorRoleMemberModel") + + +@_attrs_define +class CompanyUserSubcontractorRoleMemberModel: + """ + Attributes: + project_assignment_id (Union[Unset, int]): + assignment_tariff (Union[Unset, None, int]): + currency (Union[Unset, None, CurrencyModel]): + current_state (Union[Unset, None, ProjectAssignmentMemberStateHistoryModel]): + project_assignment (Union[Unset, None, ProjectAssignmentBaseModel]): + """ + + project_assignment_id: Union[Unset, int] = UNSET + assignment_tariff: Union[Unset, None, int] = UNSET + currency: Union[Unset, None, "CurrencyModel"] = UNSET + current_state: Union[Unset, None, "ProjectAssignmentMemberStateHistoryModel"] = UNSET + project_assignment: Union[Unset, None, "ProjectAssignmentBaseModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + project_assignment_id = self.project_assignment_id + assignment_tariff = self.assignment_tariff + currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.to_dict() if self.currency else None + + current_state: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.current_state, Unset): + current_state = self.current_state.to_dict() if self.current_state else None + + project_assignment: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.project_assignment, Unset): + project_assignment = self.project_assignment.to_dict() if self.project_assignment else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if project_assignment_id is not UNSET: + field_dict["projectAssignmentId"] = project_assignment_id + if assignment_tariff is not UNSET: + field_dict["assignmentTariff"] = assignment_tariff + if currency is not UNSET: + field_dict["currency"] = currency + if current_state is not UNSET: + field_dict["currentState"] = current_state + if project_assignment is not UNSET: + field_dict["projectAssignment"] = project_assignment + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.currency_model import CurrencyModel + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + from ..models.project_assignment_member_state_history_model import ProjectAssignmentMemberStateHistoryModel + + d = src_dict.copy() + project_assignment_id = d.pop("projectAssignmentId", UNSET) + + assignment_tariff = d.pop("assignmentTariff", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Union[Unset, None, CurrencyModel] + if _currency is None: + currency = None + elif isinstance(_currency, Unset): + currency = UNSET + else: + currency = CurrencyModel.from_dict(_currency) + + _current_state = d.pop("currentState", UNSET) + current_state: Union[Unset, None, ProjectAssignmentMemberStateHistoryModel] + if _current_state is None: + current_state = None + elif isinstance(_current_state, Unset): + current_state = UNSET + else: + current_state = ProjectAssignmentMemberStateHistoryModel.from_dict(_current_state) + + _project_assignment = d.pop("projectAssignment", UNSET) + project_assignment: Union[Unset, None, ProjectAssignmentBaseModel] + if _project_assignment is None: + project_assignment = None + elif isinstance(_project_assignment, Unset): + project_assignment = UNSET + else: + project_assignment = ProjectAssignmentBaseModel.from_dict(_project_assignment) + + company_user_subcontractor_role_member_model = cls( + project_assignment_id=project_assignment_id, + assignment_tariff=assignment_tariff, + currency=currency, + current_state=current_state, + project_assignment=project_assignment, + ) + + return company_user_subcontractor_role_member_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_roles_model.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_roles_model.py new file mode 100644 index 0000000..e855952 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_roles_model.py @@ -0,0 +1,81 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_subcontractor_role_member_model import CompanyUserSubcontractorRoleMemberModel + + +T = TypeVar("T", bound="CompanyUserSubcontractorRolesModel") + + +@_attrs_define +class CompanyUserSubcontractorRolesModel: + """ + Attributes: + assigned (Union[Unset, None, List['CompanyUserSubcontractorRoleMemberModel']]): + prospect (Union[Unset, None, List['CompanyUserSubcontractorRoleMemberModel']]): + """ + + assigned: Union[Unset, None, List["CompanyUserSubcontractorRoleMemberModel"]] = UNSET + prospect: Union[Unset, None, List["CompanyUserSubcontractorRoleMemberModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + assigned: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.assigned, Unset): + if self.assigned is None: + assigned = None + else: + assigned = [] + for assigned_item_data in self.assigned: + assigned_item = assigned_item_data.to_dict() + + assigned.append(assigned_item) + + prospect: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.prospect, Unset): + if self.prospect is None: + prospect = None + else: + prospect = [] + for prospect_item_data in self.prospect: + prospect_item = prospect_item_data.to_dict() + + prospect.append(prospect_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if assigned is not UNSET: + field_dict["assigned"] = assigned + if prospect is not UNSET: + field_dict["prospect"] = prospect + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_subcontractor_role_member_model import CompanyUserSubcontractorRoleMemberModel + + d = src_dict.copy() + assigned = [] + _assigned = d.pop("assigned", UNSET) + for assigned_item_data in _assigned or []: + assigned_item = CompanyUserSubcontractorRoleMemberModel.from_dict(assigned_item_data) + + assigned.append(assigned_item) + + prospect = [] + _prospect = d.pop("prospect", UNSET) + for prospect_item_data in _prospect or []: + prospect_item = CompanyUserSubcontractorRoleMemberModel.from_dict(prospect_item_data) + + prospect.append(prospect_item) + + company_user_subcontractor_roles_model = cls( + assigned=assigned, + prospect=prospect, + ) + + return company_user_subcontractor_roles_model diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_status.py b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_status.py new file mode 100644 index 0000000..a06c0ef --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_subcontractor_status.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class CompanyUserSubcontractorStatus(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/company_user_type.py b/src/cinode-py-client/cinode_api_client/models/company_user_type.py new file mode 100644 index 0000000..900cbdd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/company_user_type.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class CompanyUserType(IntEnum): + VALUE_0 = 0 + VALUE_10 = 10 + VALUE_20 = 20 + VALUE_30 = 30 + VALUE_40 = 40 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/contract_type.py b/src/cinode-py-client/cinode_api_client/models/contract_type.py new file mode 100644 index 0000000..2e892a7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/contract_type.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class ContractType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/convert_company_user_to_aad_account_model.py b/src/cinode-py-client/cinode_api_client/models/convert_company_user_to_aad_account_model.py new file mode 100644 index 0000000..aced333 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/convert_company_user_to_aad_account_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ConvertCompanyUserToAadAccountModel") + + +@_attrs_define +class ConvertCompanyUserToAadAccountModel: + """ + Attributes: + object_identifier (str): + """ + + object_identifier: str + + def to_dict(self) -> Dict[str, Any]: + object_identifier = self.object_identifier + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "objectIdentifier": object_identifier, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + object_identifier = d.pop("objectIdentifier") + + convert_company_user_to_aad_account_model = cls( + object_identifier=object_identifier, + ) + + return convert_company_user_to_aad_account_model diff --git a/src/cinode-py-client/cinode_api_client/models/country_model.py b/src/cinode-py-client/cinode_api_client/models/country_model.py new file mode 100644 index 0000000..2a7a020 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/country_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CountryModel") + + +@_attrs_define +class CountryModel: + """ + Attributes: + country_id (Union[Unset, int]): + code (Union[Unset, None, str]): + name (Union[Unset, None, str]): + """ + + country_id: Union[Unset, int] = UNSET + code: Union[Unset, None, str] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + country_id = self.country_id + code = self.code + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if country_id is not UNSET: + field_dict["countryId"] = country_id + if code is not UNSET: + field_dict["code"] = code + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + country_id = d.pop("countryId", UNSET) + + code = d.pop("code", UNSET) + + name = d.pop("name", UNSET) + + country_model = cls( + country_id=country_id, + code=code, + name=name, + ) + + return country_model diff --git a/src/cinode-py-client/cinode_api_client/models/create_company_user_profile_import_multipart_data.py b/src/cinode-py-client/cinode_api_client/models/create_company_user_profile_import_multipart_data.py new file mode 100644 index 0000000..d6aa8bc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/create_company_user_profile_import_multipart_data.py @@ -0,0 +1,93 @@ +from io import BytesIO +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, File, Unset + +T = TypeVar("T", bound="CreateCompanyUserProfileImportMultipartData") + + +@_attrs_define +class CreateCompanyUserProfileImportMultipartData: + """ + Attributes: + file (File): + map_skill_experience_years_to_level (Union[Unset, bool]): + """ + + file: File + map_skill_experience_years_to_level: Union[Unset, bool] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + file = self.file.to_tuple() + + map_skill_experience_years_to_level = self.map_skill_experience_years_to_level + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "File": file, + } + ) + if map_skill_experience_years_to_level is not UNSET: + field_dict["MapSkillExperienceYearsToLevel"] = map_skill_experience_years_to_level + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + file = self.file.to_tuple() + + map_skill_experience_years_to_level = ( + self.map_skill_experience_years_to_level + if isinstance(self.map_skill_experience_years_to_level, Unset) + else (None, str(self.map_skill_experience_years_to_level).encode(), "text/plain") + ) + + field_dict: Dict[str, Any] = {} + field_dict.update( + {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} + ) + field_dict.update( + { + "File": file, + } + ) + if map_skill_experience_years_to_level is not UNSET: + field_dict["MapSkillExperienceYearsToLevel"] = map_skill_experience_years_to_level + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + file = File(payload=BytesIO(d.pop("File"))) + + map_skill_experience_years_to_level = d.pop("MapSkillExperienceYearsToLevel", UNSET) + + create_company_user_profile_import_multipart_data = cls( + file=file, + map_skill_experience_years_to_level=map_skill_experience_years_to_level, + ) + + create_company_user_profile_import_multipart_data.additional_properties = d + return create_company_user_profile_import_multipart_data + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/created_model.py b/src/cinode-py-client/cinode_api_client/models/created_model.py new file mode 100644 index 0000000..97b235e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/created_model.py @@ -0,0 +1,73 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CreatedModel") + + +@_attrs_define +class CreatedModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + time (Union[Unset, None, datetime.datetime]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + time: Union[Unset, None, datetime.datetime] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + first_name = self.first_name + last_name = self.last_name + time: Union[Unset, None, str] = UNSET + if not isinstance(self.time, Unset): + time = self.time.isoformat() if self.time else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if time is not UNSET: + field_dict["time"] = time + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _time = d.pop("time", UNSET) + time: Union[Unset, None, datetime.datetime] + if _time is None: + time = None + elif isinstance(_time, Unset): + time = UNSET + else: + time = isoparse(_time) + + created_model = cls( + company_user_id=company_user_id, + first_name=first_name, + last_name=last_name, + time=time, + ) + + return created_model diff --git a/src/cinode-py-client/cinode_api_client/models/currency_model.py b/src/cinode-py-client/cinode_api_client/models/currency_model.py new file mode 100644 index 0000000..9b71a43 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/currency_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CurrencyModel") + + +@_attrs_define +class CurrencyModel: + """ + Attributes: + id (Union[Unset, int]): + currency_code (Union[Unset, None, str]): + description (Union[Unset, None, str]): + """ + + id: Union[Unset, int] = UNSET + currency_code: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + currency_code = self.currency_code + description = self.description + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if currency_code is not UNSET: + field_dict["currencyCode"] = currency_code + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + currency_code = d.pop("currencyCode", UNSET) + + description = d.pop("description", UNSET) + + currency_model = cls( + id=id, + currency_code=currency_code, + description=description, + ) + + return currency_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_base_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_base_model.py new file mode 100644 index 0000000..49b6322 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_base_model.py @@ -0,0 +1,141 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="CustomerEventBaseModel") + + +@_attrs_define +class CustomerEventBaseModel: + """ + Attributes: + customer_id (Union[Unset, None, int]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_id: Union[Unset, None, int] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_id = self.customer_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + customer_id = d.pop("customerId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + customer_event_base_model = cls( + customer_id=customer_id, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return customer_event_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_meeting_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_meeting_add_edit_model.py new file mode 100644 index 0000000..442feb0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_meeting_add_edit_model.py @@ -0,0 +1,180 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CustomerEventMeetingAddEditModel") + + +@_attrs_define +class CustomerEventMeetingAddEditModel: + """ + Attributes: + title (str): + customer_contact_id (Union[Unset, None, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for StartDateTime and EndDateTime + properties. Valid timezone ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + customer_contact_id: Union[Unset, None, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_contact_id = self.customer_contact_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if customer_contact_id is not UNSET: + field_dict["customerContactId"] = customer_contact_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + customer_contact_id = d.pop("customerContactId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + customer_event_meeting_add_edit_model = cls( + title=title, + customer_contact_id=customer_contact_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return customer_event_meeting_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_meeting_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_meeting_model.py new file mode 100644 index 0000000..c033e34 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_meeting_model.py @@ -0,0 +1,320 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CustomerEventMeetingModel") + + +@_attrs_define +class CustomerEventMeetingModel: + """ + Attributes: + customer_contact_id (Union[Unset, None, int]): + customer_id (Union[Unset, None, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + location (Union[Unset, None, str]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_contact_id: Union[Unset, None, int] = UNSET + customer_id: Union[Unset, None, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + location: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_contact_id = self.customer_contact_id + customer_id = self.customer_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + location = self.location + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_contact_id is not UNSET: + field_dict["customerContactId"] = customer_contact_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if location is not UNSET: + field_dict["location"] = location + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_contact_id = d.pop("customerContactId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + location = d.pop("location", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + customer_event_meeting_model = cls( + customer_contact_id=customer_contact_id, + customer_id=customer_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + location=location, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return customer_event_meeting_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_model.py new file mode 100644 index 0000000..3c80dba --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_model.py @@ -0,0 +1,237 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CustomerEventModel") + + +@_attrs_define +class CustomerEventModel: + """ + Attributes: + customer_id (Union[Unset, None, int]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_id: Union[Unset, None, int] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_id = self.customer_id + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_id = d.pop("customerId", UNSET) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + customer_event_model = cls( + customer_id=customer_id, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return customer_event_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_note_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_note_add_edit_model.py new file mode 100644 index 0000000..018bc7e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_note_add_edit_model.py @@ -0,0 +1,156 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CustomerEventNoteAddEditModel") + + +@_attrs_define +class CustomerEventNoteAddEditModel: + """ + Attributes: + title (str): + customer_contact_id (Union[Unset, None, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for NoteDate property. Valid timezone ids + can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + customer_contact_id: Union[Unset, None, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_contact_id = self.customer_contact_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + timezone_id = self.timezone_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if customer_contact_id is not UNSET: + field_dict["customerContactId"] = customer_contact_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + customer_contact_id = d.pop("customerContactId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + timezone_id = d.pop("timezoneId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + customer_event_note_add_edit_model = cls( + title=title, + customer_contact_id=customer_contact_id, + note_type=note_type, + note_date=note_date, + timezone_id=timezone_id, + type=type, + description=description, + visibility=visibility, + ) + + return customer_event_note_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_note_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_note_model.py new file mode 100644 index 0000000..6f86438 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_note_model.py @@ -0,0 +1,288 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CustomerEventNoteModel") + + +@_attrs_define +class CustomerEventNoteModel: + """ + Attributes: + customer_contact_id (Union[Unset, None, int]): + customer_id (Union[Unset, None, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_contact_id: Union[Unset, None, int] = UNSET + customer_id: Union[Unset, None, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_contact_id = self.customer_contact_id + customer_id = self.customer_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_contact_id is not UNSET: + field_dict["customerContactId"] = customer_contact_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_contact_id = d.pop("customerContactId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + customer_event_note_model = cls( + customer_contact_id=customer_contact_id, + customer_id=customer_id, + note_type=note_type, + note_date=note_date, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return customer_event_note_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_task_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_task_add_edit_model.py new file mode 100644 index 0000000..cd90809 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_task_add_edit_model.py @@ -0,0 +1,199 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="CustomerEventTaskAddEditModel") + + +@_attrs_define +class CustomerEventTaskAddEditModel: + """ + Attributes: + title (str): + customer_contact_id (Union[Unset, None, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for DueDateTime property. Valid timezone + ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + customer_contact_id: Union[Unset, None, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_contact_id = self.customer_contact_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if customer_contact_id is not UNSET: + field_dict["customerContactId"] = customer_contact_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + customer_contact_id = d.pop("customerContactId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + customer_event_task_add_edit_model = cls( + title=title, + customer_contact_id=customer_contact_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return customer_event_task_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/customer_event_task_model.py b/src/cinode-py-client/cinode_api_client/models/customer_event_task_model.py new file mode 100644 index 0000000..400cafc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/customer_event_task_model.py @@ -0,0 +1,331 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="CustomerEventTaskModel") + + +@_attrs_define +class CustomerEventTaskModel: + """ + Attributes: + customer_contact_id (Union[Unset, None, int]): + customer_id (Union[Unset, None, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_contact_id: Union[Unset, None, int] = UNSET + customer_id: Union[Unset, None, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_contact_id = self.customer_contact_id + customer_id = self.customer_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_contact_id is not UNSET: + field_dict["customerContactId"] = customer_contact_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_contact_id = d.pop("customerContactId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + customer_event_task_model = cls( + customer_contact_id=customer_contact_id, + customer_id=customer_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return customer_event_task_model diff --git a/src/cinode-py-client/cinode_api_client/models/dynamic_company_user_resume_model.py b/src/cinode-py-client/cinode_api_client/models/dynamic_company_user_resume_model.py new file mode 100644 index 0000000..6136803 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/dynamic_company_user_resume_model.py @@ -0,0 +1,246 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_resume_template_base_model import CompanyResumeTemplateBaseModel + from ..models.company_resume_template_language_model import CompanyResumeTemplateLanguageModel + from ..models.created_model import CreatedModel + from ..models.dynamic_template_view_model import DynamicTemplateViewModel + from ..models.link import Link + from ..models.updated_model import UpdatedModel + + +T = TypeVar("T", bound="DynamicCompanyUserResumeModel") + + +@_attrs_define +class DynamicCompanyUserResumeModel: + """ + Attributes: + image_id (Union[Unset, None, int]): + parent_profile_id (Union[Unset, int]): + profile_translation_id (Union[Unset, int]): + parent_company_user_resume_id (Union[Unset, None, int]): + resume (Union[Unset, None, DynamicTemplateViewModel]): + id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + created (Union[Unset, None, CreatedModel]): + updated (Union[Unset, None, UpdatedModel]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + slug (Union[Unset, None, str]): + language (Union[Unset, None, CompanyResumeTemplateLanguageModel]): + template (Union[Unset, None, CompanyResumeTemplateBaseModel]): + is_public (Union[Unset, bool]): + links (Union[Unset, None, List['Link']]): + """ + + image_id: Union[Unset, None, int] = UNSET + parent_profile_id: Union[Unset, int] = UNSET + profile_translation_id: Union[Unset, int] = UNSET + parent_company_user_resume_id: Union[Unset, None, int] = UNSET + resume: Union[Unset, None, "DynamicTemplateViewModel"] = UNSET + id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + created: Union[Unset, None, "CreatedModel"] = UNSET + updated: Union[Unset, None, "UpdatedModel"] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + slug: Union[Unset, None, str] = UNSET + language: Union[Unset, None, "CompanyResumeTemplateLanguageModel"] = UNSET + template: Union[Unset, None, "CompanyResumeTemplateBaseModel"] = UNSET + is_public: Union[Unset, bool] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + image_id = self.image_id + parent_profile_id = self.parent_profile_id + profile_translation_id = self.profile_translation_id + parent_company_user_resume_id = self.parent_company_user_resume_id + resume: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.resume, Unset): + resume = self.resume.to_dict() if self.resume else None + + id = self.id + company_user_id = self.company_user_id + company_id = self.company_id + created: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.created, Unset): + created = self.created.to_dict() if self.created else None + + updated: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.to_dict() if self.updated else None + + title = self.title + description = self.description + slug = self.slug + language: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language, Unset): + language = self.language.to_dict() if self.language else None + + template: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.template, Unset): + template = self.template.to_dict() if self.template else None + + is_public = self.is_public + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if image_id is not UNSET: + field_dict["imageId"] = image_id + if parent_profile_id is not UNSET: + field_dict["parentProfileId"] = parent_profile_id + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if parent_company_user_resume_id is not UNSET: + field_dict["parentCompanyUserResumeId"] = parent_company_user_resume_id + if resume is not UNSET: + field_dict["resume"] = resume + if id is not UNSET: + field_dict["id"] = id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if slug is not UNSET: + field_dict["slug"] = slug + if language is not UNSET: + field_dict["language"] = language + if template is not UNSET: + field_dict["template"] = template + if is_public is not UNSET: + field_dict["isPublic"] = is_public + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_resume_template_base_model import CompanyResumeTemplateBaseModel + from ..models.company_resume_template_language_model import CompanyResumeTemplateLanguageModel + from ..models.created_model import CreatedModel + from ..models.dynamic_template_view_model import DynamicTemplateViewModel + from ..models.link import Link + from ..models.updated_model import UpdatedModel + + d = src_dict.copy() + image_id = d.pop("imageId", UNSET) + + parent_profile_id = d.pop("parentProfileId", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + parent_company_user_resume_id = d.pop("parentCompanyUserResumeId", UNSET) + + _resume = d.pop("resume", UNSET) + resume: Union[Unset, None, DynamicTemplateViewModel] + if _resume is None: + resume = None + elif isinstance(_resume, Unset): + resume = UNSET + else: + resume = DynamicTemplateViewModel.from_dict(_resume) + + id = d.pop("id", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, None, CreatedModel] + if _created is None: + created = None + elif isinstance(_created, Unset): + created = UNSET + else: + created = CreatedModel.from_dict(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, UpdatedModel] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = UpdatedModel.from_dict(_updated) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + slug = d.pop("slug", UNSET) + + _language = d.pop("language", UNSET) + language: Union[Unset, None, CompanyResumeTemplateLanguageModel] + if _language is None: + language = None + elif isinstance(_language, Unset): + language = UNSET + else: + language = CompanyResumeTemplateLanguageModel.from_dict(_language) + + _template = d.pop("template", UNSET) + template: Union[Unset, None, CompanyResumeTemplateBaseModel] + if _template is None: + template = None + elif isinstance(_template, Unset): + template = UNSET + else: + template = CompanyResumeTemplateBaseModel.from_dict(_template) + + is_public = d.pop("isPublic", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + dynamic_company_user_resume_model = cls( + image_id=image_id, + parent_profile_id=parent_profile_id, + profile_translation_id=profile_translation_id, + parent_company_user_resume_id=parent_company_user_resume_id, + resume=resume, + id=id, + company_user_id=company_user_id, + company_id=company_id, + created=created, + updated=updated, + title=title, + description=description, + slug=slug, + language=language, + template=template, + is_public=is_public, + links=links, + ) + + return dynamic_company_user_resume_model diff --git a/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model.py b/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model.py new file mode 100644 index 0000000..68862fc --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model.py @@ -0,0 +1,744 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.image_size import ImageSize +from ..models.pdf_engine_type import PdfEngineType +from ..models.pdf_orientation import PdfOrientation +from ..models.template_asset_type import TemplateAssetType +from ..models.word_engine_type import WordEngineType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_info_block_view_model import CompanyUserInfoBlockViewModel + from ..models.dynamic_template_view_model_primary_script_assets import DynamicTemplateViewModelPrimaryScriptAssets + from ..models.dynamic_template_view_model_primary_style_assets import DynamicTemplateViewModelPrimaryStyleAssets + from ..models.i_contact_info_view_model import IContactInfoViewModel + from ..models.i_dynamic_block_view_model import IDynamicBlockViewModel + from ..models.i_template_company import ITemplateCompany + from ..models.i_template_image import ITemplateImage + from ..models.i_template_logotype import ITemplateLogotype + from ..models.i_template_shared_asset_view_model import ITemplateSharedAssetViewModel + from ..models.i_template_style_asset_view_model import ITemplateStyleAssetViewModel + from ..models.i_template_user_info import ITemplateUserInfo + + +T = TypeVar("T", bound="DynamicTemplateViewModel") + + +@_attrs_define +class DynamicTemplateViewModel: + """ + Attributes: + title (str): + blocks (Union[Unset, None, List['IDynamicBlockViewModel']]): + logotype (Union[Unset, None, ITemplateLogotype]): + id (Union[Unset, int]): + resume_template_id (Union[Unset, int]): + company_id (Union[Unset, int]): + company_user_id (Union[Unset, int]): + slug (Union[Unset, None, str]): + description (Union[Unset, None, str]): + logotype_id (Union[Unset, None, int]): + word_enabled (Union[Unset, bool]): + profile_image_size (Union[Unset, ImageSize]): + + Original = 0 + + H40W40 = 1 + + H100W100 = 2 + + H200W200 = 3 + + H300W300 = 4 + + W100 = 5 + + H60 = 6 + + H100 = 7 + + H40 = 8 + + W340 = 9 + + W1800 = 10 + + H750W1800 = 11 + + H250 = 12 + + H400W400 = 13 + + W150 = 14 + + W1200 = 15 + allow_no_profile_image (Union[Unset, bool]): + hide_profile_image_in_edit (Union[Unset, bool]): + company_logotype_image_size (Union[Unset, ImageSize]): + + Original = 0 + + H40W40 = 1 + + H100W100 = 2 + + H200W200 = 3 + + H300W300 = 4 + + W100 = 5 + + H60 = 6 + + H100 = 7 + + H40 = 8 + + W340 = 9 + + W1800 = 10 + + H750W1800 = 11 + + H250 = 12 + + H400W400 = 13 + + W150 = 14 + + W1200 = 15 + pdf_engine_type (Union[Unset, PdfEngineType]): + + WkHtmlToPdf = 0 + + Puppeteer = 2 + word_engine_type (Union[Unset, WordEngineType]): + + None = 0 + + GroupDocs = 1 + + Aspose = 2 + pdf_orientation (Union[Unset, PdfOrientation]): + + Portrait = 0 + + Landscape = 1 + pdf_margin_top (Union[Unset, int]): + pdf_margin_right (Union[Unset, int]): + pdf_margin_bottom (Union[Unset, int]): + pdf_margin_left (Union[Unset, int]): + custom_footer_for_wkhtml (Union[Unset, bool]): + pdf_footer (Union[Unset, bool]): + show_preview_toggle (Union[Unset, bool]): + contact_info_id (Union[Unset, None, int]): + contact_info (Union[Unset, None, IContactInfoViewModel]): + user_info (Union[Unset, None, ITemplateUserInfo]): + company_user_info (Union[Unset, None, CompanyUserInfoBlockViewModel]): + profile_image (Union[Unset, None, ITemplateImage]): + company (Union[Unset, None, ITemplateCompany]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + language_branch_id (Union[Unset, None, int]): + is_public (Union[Unset, bool]): + locked (Union[Unset, bool]): + current_language (Union[Unset, None, str]): + style_assets (Union[Unset, None, List['ITemplateStyleAssetViewModel']]): + customer_managed_style_asset (Union[Unset, None, ITemplateStyleAssetViewModel]): + shared_style_assets (Union[Unset, None, List['ITemplateSharedAssetViewModel']]): + shared_script_assets (Union[Unset, None, List['ITemplateSharedAssetViewModel']]): + shared_font_assets (Union[Unset, None, List['ITemplateSharedAssetViewModel']]): + primary_style_assets (Union[Unset, None, DynamicTemplateViewModelPrimaryStyleAssets]): + primary_script_assets (Union[Unset, None, DynamicTemplateViewModelPrimaryScriptAssets]): + template_asset_types (Union[Unset, None, List[TemplateAssetType]]): + """ + + title: str + blocks: Union[Unset, None, List["IDynamicBlockViewModel"]] = UNSET + logotype: Union[Unset, None, "ITemplateLogotype"] = UNSET + id: Union[Unset, int] = UNSET + resume_template_id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + slug: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + logotype_id: Union[Unset, None, int] = UNSET + word_enabled: Union[Unset, bool] = UNSET + profile_image_size: Union[Unset, ImageSize] = UNSET + allow_no_profile_image: Union[Unset, bool] = UNSET + hide_profile_image_in_edit: Union[Unset, bool] = UNSET + company_logotype_image_size: Union[Unset, ImageSize] = UNSET + pdf_engine_type: Union[Unset, PdfEngineType] = UNSET + word_engine_type: Union[Unset, WordEngineType] = UNSET + pdf_orientation: Union[Unset, PdfOrientation] = UNSET + pdf_margin_top: Union[Unset, int] = UNSET + pdf_margin_right: Union[Unset, int] = UNSET + pdf_margin_bottom: Union[Unset, int] = UNSET + pdf_margin_left: Union[Unset, int] = UNSET + custom_footer_for_wkhtml: Union[Unset, bool] = UNSET + pdf_footer: Union[Unset, bool] = UNSET + show_preview_toggle: Union[Unset, bool] = UNSET + contact_info_id: Union[Unset, None, int] = UNSET + contact_info: Union[Unset, None, "IContactInfoViewModel"] = UNSET + user_info: Union[Unset, None, "ITemplateUserInfo"] = UNSET + company_user_info: Union[Unset, None, "CompanyUserInfoBlockViewModel"] = UNSET + profile_image: Union[Unset, None, "ITemplateImage"] = UNSET + company: Union[Unset, None, "ITemplateCompany"] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + language_branch_id: Union[Unset, None, int] = UNSET + is_public: Union[Unset, bool] = UNSET + locked: Union[Unset, bool] = UNSET + current_language: Union[Unset, None, str] = UNSET + style_assets: Union[Unset, None, List["ITemplateStyleAssetViewModel"]] = UNSET + customer_managed_style_asset: Union[Unset, None, "ITemplateStyleAssetViewModel"] = UNSET + shared_style_assets: Union[Unset, None, List["ITemplateSharedAssetViewModel"]] = UNSET + shared_script_assets: Union[Unset, None, List["ITemplateSharedAssetViewModel"]] = UNSET + shared_font_assets: Union[Unset, None, List["ITemplateSharedAssetViewModel"]] = UNSET + primary_style_assets: Union[Unset, None, "DynamicTemplateViewModelPrimaryStyleAssets"] = UNSET + primary_script_assets: Union[Unset, None, "DynamicTemplateViewModelPrimaryScriptAssets"] = UNSET + template_asset_types: Union[Unset, None, List[TemplateAssetType]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + blocks: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.blocks, Unset): + if self.blocks is None: + blocks = None + else: + blocks = [] + for blocks_item_data in self.blocks: + blocks_item = blocks_item_data.to_dict() + + blocks.append(blocks_item) + + logotype: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.logotype, Unset): + logotype = self.logotype.to_dict() if self.logotype else None + + id = self.id + resume_template_id = self.resume_template_id + company_id = self.company_id + company_user_id = self.company_user_id + slug = self.slug + description = self.description + logotype_id = self.logotype_id + word_enabled = self.word_enabled + profile_image_size: Union[Unset, int] = UNSET + if not isinstance(self.profile_image_size, Unset): + profile_image_size = self.profile_image_size.value + + allow_no_profile_image = self.allow_no_profile_image + hide_profile_image_in_edit = self.hide_profile_image_in_edit + company_logotype_image_size: Union[Unset, int] = UNSET + if not isinstance(self.company_logotype_image_size, Unset): + company_logotype_image_size = self.company_logotype_image_size.value + + pdf_engine_type: Union[Unset, int] = UNSET + if not isinstance(self.pdf_engine_type, Unset): + pdf_engine_type = self.pdf_engine_type.value + + word_engine_type: Union[Unset, int] = UNSET + if not isinstance(self.word_engine_type, Unset): + word_engine_type = self.word_engine_type.value + + pdf_orientation: Union[Unset, int] = UNSET + if not isinstance(self.pdf_orientation, Unset): + pdf_orientation = self.pdf_orientation.value + + pdf_margin_top = self.pdf_margin_top + pdf_margin_right = self.pdf_margin_right + pdf_margin_bottom = self.pdf_margin_bottom + pdf_margin_left = self.pdf_margin_left + custom_footer_for_wkhtml = self.custom_footer_for_wkhtml + pdf_footer = self.pdf_footer + show_preview_toggle = self.show_preview_toggle + contact_info_id = self.contact_info_id + contact_info: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.contact_info, Unset): + contact_info = self.contact_info.to_dict() if self.contact_info else None + + user_info: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.user_info, Unset): + user_info = self.user_info.to_dict() if self.user_info else None + + company_user_info: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_user_info, Unset): + company_user_info = self.company_user_info.to_dict() if self.company_user_info else None + + profile_image: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile_image, Unset): + profile_image = self.profile_image.to_dict() if self.profile_image else None + + company: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company, Unset): + company = self.company.to_dict() if self.company else None + + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + language_branch_id = self.language_branch_id + is_public = self.is_public + locked = self.locked + current_language = self.current_language + style_assets: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.style_assets, Unset): + if self.style_assets is None: + style_assets = None + else: + style_assets = [] + for style_assets_item_data in self.style_assets: + style_assets_item = style_assets_item_data.to_dict() + + style_assets.append(style_assets_item) + + customer_managed_style_asset: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.customer_managed_style_asset, Unset): + customer_managed_style_asset = ( + self.customer_managed_style_asset.to_dict() if self.customer_managed_style_asset else None + ) + + shared_style_assets: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.shared_style_assets, Unset): + if self.shared_style_assets is None: + shared_style_assets = None + else: + shared_style_assets = [] + for shared_style_assets_item_data in self.shared_style_assets: + shared_style_assets_item = shared_style_assets_item_data.to_dict() + + shared_style_assets.append(shared_style_assets_item) + + shared_script_assets: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.shared_script_assets, Unset): + if self.shared_script_assets is None: + shared_script_assets = None + else: + shared_script_assets = [] + for shared_script_assets_item_data in self.shared_script_assets: + shared_script_assets_item = shared_script_assets_item_data.to_dict() + + shared_script_assets.append(shared_script_assets_item) + + shared_font_assets: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.shared_font_assets, Unset): + if self.shared_font_assets is None: + shared_font_assets = None + else: + shared_font_assets = [] + for shared_font_assets_item_data in self.shared_font_assets: + shared_font_assets_item = shared_font_assets_item_data.to_dict() + + shared_font_assets.append(shared_font_assets_item) + + primary_style_assets: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.primary_style_assets, Unset): + primary_style_assets = self.primary_style_assets.to_dict() if self.primary_style_assets else None + + primary_script_assets: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.primary_script_assets, Unset): + primary_script_assets = self.primary_script_assets.to_dict() if self.primary_script_assets else None + + template_asset_types: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.template_asset_types, Unset): + if self.template_asset_types is None: + template_asset_types = None + else: + template_asset_types = [] + for template_asset_types_item_data in self.template_asset_types: + template_asset_types_item = template_asset_types_item_data.value + + template_asset_types.append(template_asset_types_item) + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if blocks is not UNSET: + field_dict["blocks"] = blocks + if logotype is not UNSET: + field_dict["logotype"] = logotype + if id is not UNSET: + field_dict["id"] = id + if resume_template_id is not UNSET: + field_dict["resumeTemplateId"] = resume_template_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if slug is not UNSET: + field_dict["slug"] = slug + if description is not UNSET: + field_dict["description"] = description + if logotype_id is not UNSET: + field_dict["logotypeId"] = logotype_id + if word_enabled is not UNSET: + field_dict["wordEnabled"] = word_enabled + if profile_image_size is not UNSET: + field_dict["profileImageSize"] = profile_image_size + if allow_no_profile_image is not UNSET: + field_dict["allowNoProfileImage"] = allow_no_profile_image + if hide_profile_image_in_edit is not UNSET: + field_dict["hideProfileImageInEdit"] = hide_profile_image_in_edit + if company_logotype_image_size is not UNSET: + field_dict["companyLogotypeImageSize"] = company_logotype_image_size + if pdf_engine_type is not UNSET: + field_dict["pdfEngineType"] = pdf_engine_type + if word_engine_type is not UNSET: + field_dict["wordEngineType"] = word_engine_type + if pdf_orientation is not UNSET: + field_dict["pdfOrientation"] = pdf_orientation + if pdf_margin_top is not UNSET: + field_dict["pdfMarginTop"] = pdf_margin_top + if pdf_margin_right is not UNSET: + field_dict["pdfMarginRight"] = pdf_margin_right + if pdf_margin_bottom is not UNSET: + field_dict["pdfMarginBottom"] = pdf_margin_bottom + if pdf_margin_left is not UNSET: + field_dict["pdfMarginLeft"] = pdf_margin_left + if custom_footer_for_wkhtml is not UNSET: + field_dict["customFooterForWkhtml"] = custom_footer_for_wkhtml + if pdf_footer is not UNSET: + field_dict["pdfFooter"] = pdf_footer + if show_preview_toggle is not UNSET: + field_dict["showPreviewToggle"] = show_preview_toggle + if contact_info_id is not UNSET: + field_dict["contactInfoId"] = contact_info_id + if contact_info is not UNSET: + field_dict["contactInfo"] = contact_info + if user_info is not UNSET: + field_dict["userInfo"] = user_info + if company_user_info is not UNSET: + field_dict["companyUserInfo"] = company_user_info + if profile_image is not UNSET: + field_dict["profileImage"] = profile_image + if company is not UNSET: + field_dict["company"] = company + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if language_branch_id is not UNSET: + field_dict["languageBranchId"] = language_branch_id + if is_public is not UNSET: + field_dict["isPublic"] = is_public + if locked is not UNSET: + field_dict["locked"] = locked + if current_language is not UNSET: + field_dict["currentLanguage"] = current_language + if style_assets is not UNSET: + field_dict["styleAssets"] = style_assets + if customer_managed_style_asset is not UNSET: + field_dict["customerManagedStyleAsset"] = customer_managed_style_asset + if shared_style_assets is not UNSET: + field_dict["sharedStyleAssets"] = shared_style_assets + if shared_script_assets is not UNSET: + field_dict["sharedScriptAssets"] = shared_script_assets + if shared_font_assets is not UNSET: + field_dict["sharedFontAssets"] = shared_font_assets + if primary_style_assets is not UNSET: + field_dict["primaryStyleAssets"] = primary_style_assets + if primary_script_assets is not UNSET: + field_dict["primaryScriptAssets"] = primary_script_assets + if template_asset_types is not UNSET: + field_dict["templateAssetTypes"] = template_asset_types + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_info_block_view_model import CompanyUserInfoBlockViewModel + from ..models.dynamic_template_view_model_primary_script_assets import ( + DynamicTemplateViewModelPrimaryScriptAssets, + ) + from ..models.dynamic_template_view_model_primary_style_assets import DynamicTemplateViewModelPrimaryStyleAssets + from ..models.i_contact_info_view_model import IContactInfoViewModel + from ..models.i_dynamic_block_view_model import IDynamicBlockViewModel + from ..models.i_template_company import ITemplateCompany + from ..models.i_template_image import ITemplateImage + from ..models.i_template_logotype import ITemplateLogotype + from ..models.i_template_shared_asset_view_model import ITemplateSharedAssetViewModel + from ..models.i_template_style_asset_view_model import ITemplateStyleAssetViewModel + from ..models.i_template_user_info import ITemplateUserInfo + + d = src_dict.copy() + title = d.pop("title") + + blocks = [] + _blocks = d.pop("blocks", UNSET) + for blocks_item_data in _blocks or []: + blocks_item = IDynamicBlockViewModel.from_dict(blocks_item_data) + + blocks.append(blocks_item) + + _logotype = d.pop("logotype", UNSET) + logotype: Union[Unset, None, ITemplateLogotype] + if _logotype is None: + logotype = None + elif isinstance(_logotype, Unset): + logotype = UNSET + else: + logotype = ITemplateLogotype.from_dict(_logotype) + + id = d.pop("id", UNSET) + + resume_template_id = d.pop("resumeTemplateId", UNSET) + + company_id = d.pop("companyId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + slug = d.pop("slug", UNSET) + + description = d.pop("description", UNSET) + + logotype_id = d.pop("logotypeId", UNSET) + + word_enabled = d.pop("wordEnabled", UNSET) + + _profile_image_size = d.pop("profileImageSize", UNSET) + profile_image_size: Union[Unset, ImageSize] + if isinstance(_profile_image_size, Unset): + profile_image_size = UNSET + else: + profile_image_size = ImageSize(_profile_image_size) + + allow_no_profile_image = d.pop("allowNoProfileImage", UNSET) + + hide_profile_image_in_edit = d.pop("hideProfileImageInEdit", UNSET) + + _company_logotype_image_size = d.pop("companyLogotypeImageSize", UNSET) + company_logotype_image_size: Union[Unset, ImageSize] + if isinstance(_company_logotype_image_size, Unset): + company_logotype_image_size = UNSET + else: + company_logotype_image_size = ImageSize(_company_logotype_image_size) + + _pdf_engine_type = d.pop("pdfEngineType", UNSET) + pdf_engine_type: Union[Unset, PdfEngineType] + if isinstance(_pdf_engine_type, Unset): + pdf_engine_type = UNSET + else: + pdf_engine_type = PdfEngineType(_pdf_engine_type) + + _word_engine_type = d.pop("wordEngineType", UNSET) + word_engine_type: Union[Unset, WordEngineType] + if isinstance(_word_engine_type, Unset): + word_engine_type = UNSET + else: + word_engine_type = WordEngineType(_word_engine_type) + + _pdf_orientation = d.pop("pdfOrientation", UNSET) + pdf_orientation: Union[Unset, PdfOrientation] + if isinstance(_pdf_orientation, Unset): + pdf_orientation = UNSET + else: + pdf_orientation = PdfOrientation(_pdf_orientation) + + pdf_margin_top = d.pop("pdfMarginTop", UNSET) + + pdf_margin_right = d.pop("pdfMarginRight", UNSET) + + pdf_margin_bottom = d.pop("pdfMarginBottom", UNSET) + + pdf_margin_left = d.pop("pdfMarginLeft", UNSET) + + custom_footer_for_wkhtml = d.pop("customFooterForWkhtml", UNSET) + + pdf_footer = d.pop("pdfFooter", UNSET) + + show_preview_toggle = d.pop("showPreviewToggle", UNSET) + + contact_info_id = d.pop("contactInfoId", UNSET) + + _contact_info = d.pop("contactInfo", UNSET) + contact_info: Union[Unset, None, IContactInfoViewModel] + if _contact_info is None: + contact_info = None + elif isinstance(_contact_info, Unset): + contact_info = UNSET + else: + contact_info = IContactInfoViewModel.from_dict(_contact_info) + + _user_info = d.pop("userInfo", UNSET) + user_info: Union[Unset, None, ITemplateUserInfo] + if _user_info is None: + user_info = None + elif isinstance(_user_info, Unset): + user_info = UNSET + else: + user_info = ITemplateUserInfo.from_dict(_user_info) + + _company_user_info = d.pop("companyUserInfo", UNSET) + company_user_info: Union[Unset, None, CompanyUserInfoBlockViewModel] + if _company_user_info is None: + company_user_info = None + elif isinstance(_company_user_info, Unset): + company_user_info = UNSET + else: + company_user_info = CompanyUserInfoBlockViewModel.from_dict(_company_user_info) + + _profile_image = d.pop("profileImage", UNSET) + profile_image: Union[Unset, None, ITemplateImage] + if _profile_image is None: + profile_image = None + elif isinstance(_profile_image, Unset): + profile_image = UNSET + else: + profile_image = ITemplateImage.from_dict(_profile_image) + + _company = d.pop("company", UNSET) + company: Union[Unset, None, ITemplateCompany] + if _company is None: + company = None + elif isinstance(_company, Unset): + company = UNSET + else: + company = ITemplateCompany.from_dict(_company) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + language_branch_id = d.pop("languageBranchId", UNSET) + + is_public = d.pop("isPublic", UNSET) + + locked = d.pop("locked", UNSET) + + current_language = d.pop("currentLanguage", UNSET) + + style_assets = [] + _style_assets = d.pop("styleAssets", UNSET) + for style_assets_item_data in _style_assets or []: + style_assets_item = ITemplateStyleAssetViewModel.from_dict(style_assets_item_data) + + style_assets.append(style_assets_item) + + _customer_managed_style_asset = d.pop("customerManagedStyleAsset", UNSET) + customer_managed_style_asset: Union[Unset, None, ITemplateStyleAssetViewModel] + if _customer_managed_style_asset is None: + customer_managed_style_asset = None + elif isinstance(_customer_managed_style_asset, Unset): + customer_managed_style_asset = UNSET + else: + customer_managed_style_asset = ITemplateStyleAssetViewModel.from_dict(_customer_managed_style_asset) + + shared_style_assets = [] + _shared_style_assets = d.pop("sharedStyleAssets", UNSET) + for shared_style_assets_item_data in _shared_style_assets or []: + shared_style_assets_item = ITemplateSharedAssetViewModel.from_dict(shared_style_assets_item_data) + + shared_style_assets.append(shared_style_assets_item) + + shared_script_assets = [] + _shared_script_assets = d.pop("sharedScriptAssets", UNSET) + for shared_script_assets_item_data in _shared_script_assets or []: + shared_script_assets_item = ITemplateSharedAssetViewModel.from_dict(shared_script_assets_item_data) + + shared_script_assets.append(shared_script_assets_item) + + shared_font_assets = [] + _shared_font_assets = d.pop("sharedFontAssets", UNSET) + for shared_font_assets_item_data in _shared_font_assets or []: + shared_font_assets_item = ITemplateSharedAssetViewModel.from_dict(shared_font_assets_item_data) + + shared_font_assets.append(shared_font_assets_item) + + _primary_style_assets = d.pop("primaryStyleAssets", UNSET) + primary_style_assets: Union[Unset, None, DynamicTemplateViewModelPrimaryStyleAssets] + if _primary_style_assets is None: + primary_style_assets = None + elif isinstance(_primary_style_assets, Unset): + primary_style_assets = UNSET + else: + primary_style_assets = DynamicTemplateViewModelPrimaryStyleAssets.from_dict(_primary_style_assets) + + _primary_script_assets = d.pop("primaryScriptAssets", UNSET) + primary_script_assets: Union[Unset, None, DynamicTemplateViewModelPrimaryScriptAssets] + if _primary_script_assets is None: + primary_script_assets = None + elif isinstance(_primary_script_assets, Unset): + primary_script_assets = UNSET + else: + primary_script_assets = DynamicTemplateViewModelPrimaryScriptAssets.from_dict(_primary_script_assets) + + template_asset_types = [] + _template_asset_types = d.pop("templateAssetTypes", UNSET) + for template_asset_types_item_data in _template_asset_types or []: + template_asset_types_item = TemplateAssetType(template_asset_types_item_data) + + template_asset_types.append(template_asset_types_item) + + dynamic_template_view_model = cls( + title=title, + blocks=blocks, + logotype=logotype, + id=id, + resume_template_id=resume_template_id, + company_id=company_id, + company_user_id=company_user_id, + slug=slug, + description=description, + logotype_id=logotype_id, + word_enabled=word_enabled, + profile_image_size=profile_image_size, + allow_no_profile_image=allow_no_profile_image, + hide_profile_image_in_edit=hide_profile_image_in_edit, + company_logotype_image_size=company_logotype_image_size, + pdf_engine_type=pdf_engine_type, + word_engine_type=word_engine_type, + pdf_orientation=pdf_orientation, + pdf_margin_top=pdf_margin_top, + pdf_margin_right=pdf_margin_right, + pdf_margin_bottom=pdf_margin_bottom, + pdf_margin_left=pdf_margin_left, + custom_footer_for_wkhtml=custom_footer_for_wkhtml, + pdf_footer=pdf_footer, + show_preview_toggle=show_preview_toggle, + contact_info_id=contact_info_id, + contact_info=contact_info, + user_info=user_info, + company_user_info=company_user_info, + profile_image=profile_image, + company=company, + created=created, + updated=updated, + language_branch_id=language_branch_id, + is_public=is_public, + locked=locked, + current_language=current_language, + style_assets=style_assets, + customer_managed_style_asset=customer_managed_style_asset, + shared_style_assets=shared_style_assets, + shared_script_assets=shared_script_assets, + shared_font_assets=shared_font_assets, + primary_style_assets=primary_style_assets, + primary_script_assets=primary_script_assets, + template_asset_types=template_asset_types, + ) + + return dynamic_template_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_script_assets.py b/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_script_assets.py new file mode 100644 index 0000000..22dc815 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_script_assets.py @@ -0,0 +1,239 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.i_template_shared_asset_view_model import ITemplateSharedAssetViewModel + + +T = TypeVar("T", bound="DynamicTemplateViewModelPrimaryScriptAssets") + + +@_attrs_define +class DynamicTemplateViewModelPrimaryScriptAssets: + """ + Attributes: + none (Union[Unset, List['ITemplateSharedAssetViewModel']]): + primary (Union[Unset, List['ITemplateSharedAssetViewModel']]): + classic (Union[Unset, List['ITemplateSharedAssetViewModel']]): + dynamic (Union[Unset, List['ITemplateSharedAssetViewModel']]): + page_flow (Union[Unset, List['ITemplateSharedAssetViewModel']]): + cinode_premium_3_page_flow (Union[Unset, List['ITemplateSharedAssetViewModel']]): + cinode_premium_2_page_flow (Union[Unset, List['ITemplateSharedAssetViewModel']]): + block_work_experience (Union[Unset, List['ITemplateSharedAssetViewModel']]): + block_skills_by_level (Union[Unset, List['ITemplateSharedAssetViewModel']]): + template_type (Union[Unset, List['ITemplateSharedAssetViewModel']]): + """ + + none: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + primary: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + classic: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + dynamic: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + page_flow: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + cinode_premium_3_page_flow: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + cinode_premium_2_page_flow: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + block_work_experience: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + block_skills_by_level: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + template_type: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + none: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.none, Unset): + none = [] + for none_item_data in self.none: + none_item = none_item_data.to_dict() + + none.append(none_item) + + primary: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.primary, Unset): + primary = [] + for primary_item_data in self.primary: + primary_item = primary_item_data.to_dict() + + primary.append(primary_item) + + classic: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.classic, Unset): + classic = [] + for classic_item_data in self.classic: + classic_item = classic_item_data.to_dict() + + classic.append(classic_item) + + dynamic: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.dynamic, Unset): + dynamic = [] + for dynamic_item_data in self.dynamic: + dynamic_item = dynamic_item_data.to_dict() + + dynamic.append(dynamic_item) + + page_flow: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.page_flow, Unset): + page_flow = [] + for page_flow_item_data in self.page_flow: + page_flow_item = page_flow_item_data.to_dict() + + page_flow.append(page_flow_item) + + cinode_premium_3_page_flow: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.cinode_premium_3_page_flow, Unset): + cinode_premium_3_page_flow = [] + for cinode_premium_3_page_flow_item_data in self.cinode_premium_3_page_flow: + cinode_premium_3_page_flow_item = cinode_premium_3_page_flow_item_data.to_dict() + + cinode_premium_3_page_flow.append(cinode_premium_3_page_flow_item) + + cinode_premium_2_page_flow: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.cinode_premium_2_page_flow, Unset): + cinode_premium_2_page_flow = [] + for cinode_premium_2_page_flow_item_data in self.cinode_premium_2_page_flow: + cinode_premium_2_page_flow_item = cinode_premium_2_page_flow_item_data.to_dict() + + cinode_premium_2_page_flow.append(cinode_premium_2_page_flow_item) + + block_work_experience: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.block_work_experience, Unset): + block_work_experience = [] + for block_work_experience_item_data in self.block_work_experience: + block_work_experience_item = block_work_experience_item_data.to_dict() + + block_work_experience.append(block_work_experience_item) + + block_skills_by_level: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.block_skills_by_level, Unset): + block_skills_by_level = [] + for block_skills_by_level_item_data in self.block_skills_by_level: + block_skills_by_level_item = block_skills_by_level_item_data.to_dict() + + block_skills_by_level.append(block_skills_by_level_item) + + template_type: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.template_type, Unset): + template_type = [] + for template_type_item_data in self.template_type: + template_type_item = template_type_item_data.to_dict() + + template_type.append(template_type_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if none is not UNSET: + field_dict["None"] = none + if primary is not UNSET: + field_dict["Primary"] = primary + if classic is not UNSET: + field_dict["Classic"] = classic + if dynamic is not UNSET: + field_dict["Dynamic"] = dynamic + if page_flow is not UNSET: + field_dict["PageFlow"] = page_flow + if cinode_premium_3_page_flow is not UNSET: + field_dict["CinodePremium3PageFlow"] = cinode_premium_3_page_flow + if cinode_premium_2_page_flow is not UNSET: + field_dict["CinodePremium2PageFlow"] = cinode_premium_2_page_flow + if block_work_experience is not UNSET: + field_dict["BlockWorkExperience"] = block_work_experience + if block_skills_by_level is not UNSET: + field_dict["BlockSkillsByLevel"] = block_skills_by_level + if template_type is not UNSET: + field_dict["TemplateType"] = template_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.i_template_shared_asset_view_model import ITemplateSharedAssetViewModel + + d = src_dict.copy() + none = [] + _none = d.pop("None", UNSET) + for none_item_data in _none or []: + none_item = ITemplateSharedAssetViewModel.from_dict(none_item_data) + + none.append(none_item) + + primary = [] + _primary = d.pop("Primary", UNSET) + for primary_item_data in _primary or []: + primary_item = ITemplateSharedAssetViewModel.from_dict(primary_item_data) + + primary.append(primary_item) + + classic = [] + _classic = d.pop("Classic", UNSET) + for classic_item_data in _classic or []: + classic_item = ITemplateSharedAssetViewModel.from_dict(classic_item_data) + + classic.append(classic_item) + + dynamic = [] + _dynamic = d.pop("Dynamic", UNSET) + for dynamic_item_data in _dynamic or []: + dynamic_item = ITemplateSharedAssetViewModel.from_dict(dynamic_item_data) + + dynamic.append(dynamic_item) + + page_flow = [] + _page_flow = d.pop("PageFlow", UNSET) + for page_flow_item_data in _page_flow or []: + page_flow_item = ITemplateSharedAssetViewModel.from_dict(page_flow_item_data) + + page_flow.append(page_flow_item) + + cinode_premium_3_page_flow = [] + _cinode_premium_3_page_flow = d.pop("CinodePremium3PageFlow", UNSET) + for cinode_premium_3_page_flow_item_data in _cinode_premium_3_page_flow or []: + cinode_premium_3_page_flow_item = ITemplateSharedAssetViewModel.from_dict( + cinode_premium_3_page_flow_item_data + ) + + cinode_premium_3_page_flow.append(cinode_premium_3_page_flow_item) + + cinode_premium_2_page_flow = [] + _cinode_premium_2_page_flow = d.pop("CinodePremium2PageFlow", UNSET) + for cinode_premium_2_page_flow_item_data in _cinode_premium_2_page_flow or []: + cinode_premium_2_page_flow_item = ITemplateSharedAssetViewModel.from_dict( + cinode_premium_2_page_flow_item_data + ) + + cinode_premium_2_page_flow.append(cinode_premium_2_page_flow_item) + + block_work_experience = [] + _block_work_experience = d.pop("BlockWorkExperience", UNSET) + for block_work_experience_item_data in _block_work_experience or []: + block_work_experience_item = ITemplateSharedAssetViewModel.from_dict(block_work_experience_item_data) + + block_work_experience.append(block_work_experience_item) + + block_skills_by_level = [] + _block_skills_by_level = d.pop("BlockSkillsByLevel", UNSET) + for block_skills_by_level_item_data in _block_skills_by_level or []: + block_skills_by_level_item = ITemplateSharedAssetViewModel.from_dict(block_skills_by_level_item_data) + + block_skills_by_level.append(block_skills_by_level_item) + + template_type = [] + _template_type = d.pop("TemplateType", UNSET) + for template_type_item_data in _template_type or []: + template_type_item = ITemplateSharedAssetViewModel.from_dict(template_type_item_data) + + template_type.append(template_type_item) + + dynamic_template_view_model_primary_script_assets = cls( + none=none, + primary=primary, + classic=classic, + dynamic=dynamic, + page_flow=page_flow, + cinode_premium_3_page_flow=cinode_premium_3_page_flow, + cinode_premium_2_page_flow=cinode_premium_2_page_flow, + block_work_experience=block_work_experience, + block_skills_by_level=block_skills_by_level, + template_type=template_type, + ) + + return dynamic_template_view_model_primary_script_assets diff --git a/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_style_assets.py b/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_style_assets.py new file mode 100644 index 0000000..b3b2b84 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/dynamic_template_view_model_primary_style_assets.py @@ -0,0 +1,239 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.i_template_shared_asset_view_model import ITemplateSharedAssetViewModel + + +T = TypeVar("T", bound="DynamicTemplateViewModelPrimaryStyleAssets") + + +@_attrs_define +class DynamicTemplateViewModelPrimaryStyleAssets: + """ + Attributes: + none (Union[Unset, List['ITemplateSharedAssetViewModel']]): + primary (Union[Unset, List['ITemplateSharedAssetViewModel']]): + classic (Union[Unset, List['ITemplateSharedAssetViewModel']]): + dynamic (Union[Unset, List['ITemplateSharedAssetViewModel']]): + page_flow (Union[Unset, List['ITemplateSharedAssetViewModel']]): + cinode_premium_3_page_flow (Union[Unset, List['ITemplateSharedAssetViewModel']]): + cinode_premium_2_page_flow (Union[Unset, List['ITemplateSharedAssetViewModel']]): + block_work_experience (Union[Unset, List['ITemplateSharedAssetViewModel']]): + block_skills_by_level (Union[Unset, List['ITemplateSharedAssetViewModel']]): + template_type (Union[Unset, List['ITemplateSharedAssetViewModel']]): + """ + + none: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + primary: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + classic: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + dynamic: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + page_flow: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + cinode_premium_3_page_flow: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + cinode_premium_2_page_flow: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + block_work_experience: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + block_skills_by_level: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + template_type: Union[Unset, List["ITemplateSharedAssetViewModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + none: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.none, Unset): + none = [] + for none_item_data in self.none: + none_item = none_item_data.to_dict() + + none.append(none_item) + + primary: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.primary, Unset): + primary = [] + for primary_item_data in self.primary: + primary_item = primary_item_data.to_dict() + + primary.append(primary_item) + + classic: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.classic, Unset): + classic = [] + for classic_item_data in self.classic: + classic_item = classic_item_data.to_dict() + + classic.append(classic_item) + + dynamic: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.dynamic, Unset): + dynamic = [] + for dynamic_item_data in self.dynamic: + dynamic_item = dynamic_item_data.to_dict() + + dynamic.append(dynamic_item) + + page_flow: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.page_flow, Unset): + page_flow = [] + for page_flow_item_data in self.page_flow: + page_flow_item = page_flow_item_data.to_dict() + + page_flow.append(page_flow_item) + + cinode_premium_3_page_flow: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.cinode_premium_3_page_flow, Unset): + cinode_premium_3_page_flow = [] + for cinode_premium_3_page_flow_item_data in self.cinode_premium_3_page_flow: + cinode_premium_3_page_flow_item = cinode_premium_3_page_flow_item_data.to_dict() + + cinode_premium_3_page_flow.append(cinode_premium_3_page_flow_item) + + cinode_premium_2_page_flow: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.cinode_premium_2_page_flow, Unset): + cinode_premium_2_page_flow = [] + for cinode_premium_2_page_flow_item_data in self.cinode_premium_2_page_flow: + cinode_premium_2_page_flow_item = cinode_premium_2_page_flow_item_data.to_dict() + + cinode_premium_2_page_flow.append(cinode_premium_2_page_flow_item) + + block_work_experience: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.block_work_experience, Unset): + block_work_experience = [] + for block_work_experience_item_data in self.block_work_experience: + block_work_experience_item = block_work_experience_item_data.to_dict() + + block_work_experience.append(block_work_experience_item) + + block_skills_by_level: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.block_skills_by_level, Unset): + block_skills_by_level = [] + for block_skills_by_level_item_data in self.block_skills_by_level: + block_skills_by_level_item = block_skills_by_level_item_data.to_dict() + + block_skills_by_level.append(block_skills_by_level_item) + + template_type: Union[Unset, List[Dict[str, Any]]] = UNSET + if not isinstance(self.template_type, Unset): + template_type = [] + for template_type_item_data in self.template_type: + template_type_item = template_type_item_data.to_dict() + + template_type.append(template_type_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if none is not UNSET: + field_dict["None"] = none + if primary is not UNSET: + field_dict["Primary"] = primary + if classic is not UNSET: + field_dict["Classic"] = classic + if dynamic is not UNSET: + field_dict["Dynamic"] = dynamic + if page_flow is not UNSET: + field_dict["PageFlow"] = page_flow + if cinode_premium_3_page_flow is not UNSET: + field_dict["CinodePremium3PageFlow"] = cinode_premium_3_page_flow + if cinode_premium_2_page_flow is not UNSET: + field_dict["CinodePremium2PageFlow"] = cinode_premium_2_page_flow + if block_work_experience is not UNSET: + field_dict["BlockWorkExperience"] = block_work_experience + if block_skills_by_level is not UNSET: + field_dict["BlockSkillsByLevel"] = block_skills_by_level + if template_type is not UNSET: + field_dict["TemplateType"] = template_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.i_template_shared_asset_view_model import ITemplateSharedAssetViewModel + + d = src_dict.copy() + none = [] + _none = d.pop("None", UNSET) + for none_item_data in _none or []: + none_item = ITemplateSharedAssetViewModel.from_dict(none_item_data) + + none.append(none_item) + + primary = [] + _primary = d.pop("Primary", UNSET) + for primary_item_data in _primary or []: + primary_item = ITemplateSharedAssetViewModel.from_dict(primary_item_data) + + primary.append(primary_item) + + classic = [] + _classic = d.pop("Classic", UNSET) + for classic_item_data in _classic or []: + classic_item = ITemplateSharedAssetViewModel.from_dict(classic_item_data) + + classic.append(classic_item) + + dynamic = [] + _dynamic = d.pop("Dynamic", UNSET) + for dynamic_item_data in _dynamic or []: + dynamic_item = ITemplateSharedAssetViewModel.from_dict(dynamic_item_data) + + dynamic.append(dynamic_item) + + page_flow = [] + _page_flow = d.pop("PageFlow", UNSET) + for page_flow_item_data in _page_flow or []: + page_flow_item = ITemplateSharedAssetViewModel.from_dict(page_flow_item_data) + + page_flow.append(page_flow_item) + + cinode_premium_3_page_flow = [] + _cinode_premium_3_page_flow = d.pop("CinodePremium3PageFlow", UNSET) + for cinode_premium_3_page_flow_item_data in _cinode_premium_3_page_flow or []: + cinode_premium_3_page_flow_item = ITemplateSharedAssetViewModel.from_dict( + cinode_premium_3_page_flow_item_data + ) + + cinode_premium_3_page_flow.append(cinode_premium_3_page_flow_item) + + cinode_premium_2_page_flow = [] + _cinode_premium_2_page_flow = d.pop("CinodePremium2PageFlow", UNSET) + for cinode_premium_2_page_flow_item_data in _cinode_premium_2_page_flow or []: + cinode_premium_2_page_flow_item = ITemplateSharedAssetViewModel.from_dict( + cinode_premium_2_page_flow_item_data + ) + + cinode_premium_2_page_flow.append(cinode_premium_2_page_flow_item) + + block_work_experience = [] + _block_work_experience = d.pop("BlockWorkExperience", UNSET) + for block_work_experience_item_data in _block_work_experience or []: + block_work_experience_item = ITemplateSharedAssetViewModel.from_dict(block_work_experience_item_data) + + block_work_experience.append(block_work_experience_item) + + block_skills_by_level = [] + _block_skills_by_level = d.pop("BlockSkillsByLevel", UNSET) + for block_skills_by_level_item_data in _block_skills_by_level or []: + block_skills_by_level_item = ITemplateSharedAssetViewModel.from_dict(block_skills_by_level_item_data) + + block_skills_by_level.append(block_skills_by_level_item) + + template_type = [] + _template_type = d.pop("TemplateType", UNSET) + for template_type_item_data in _template_type or []: + template_type_item = ITemplateSharedAssetViewModel.from_dict(template_type_item_data) + + template_type.append(template_type_item) + + dynamic_template_view_model_primary_style_assets = cls( + none=none, + primary=primary, + classic=classic, + dynamic=dynamic, + page_flow=page_flow, + cinode_premium_3_page_flow=cinode_premium_3_page_flow, + cinode_premium_2_page_flow=cinode_premium_2_page_flow, + block_work_experience=block_work_experience, + block_skills_by_level=block_skills_by_level, + template_type=template_type, + ) + + return dynamic_template_view_model_primary_style_assets diff --git a/src/cinode-py-client/cinode_api_client/models/education_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/education_block_item_model.py new file mode 100644 index 0000000..0ec2109 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/education_block_item_model.py @@ -0,0 +1,206 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.location_block_model import LocationBlockModel + + +T = TypeVar("T", bound="EducationBlockItemModel") + + +@_attrs_define +class EducationBlockItemModel: + """ + Attributes: + url (Union[Unset, None, str]): + school_name (Union[Unset, None, str]): + program_name (Union[Unset, None, str]): + degree (Union[Unset, None, str]): + description (Union[Unset, None, str]): + location (Union[Unset, None, LocationBlockModel]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + url: Union[Unset, None, str] = UNSET + school_name: Union[Unset, None, str] = UNSET + program_name: Union[Unset, None, str] = UNSET + degree: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + location: Union[Unset, None, "LocationBlockModel"] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + url = self.url + school_name = self.school_name + program_name = self.program_name + degree = self.degree + description = self.description + location: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.location, Unset): + location = self.location.to_dict() if self.location else None + + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if url is not UNSET: + field_dict["url"] = url + if school_name is not UNSET: + field_dict["schoolName"] = school_name + if program_name is not UNSET: + field_dict["programName"] = program_name + if degree is not UNSET: + field_dict["degree"] = degree + if description is not UNSET: + field_dict["description"] = description + if location is not UNSET: + field_dict["location"] = location + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.location_block_model import LocationBlockModel + + d = src_dict.copy() + url = d.pop("url", UNSET) + + school_name = d.pop("schoolName", UNSET) + + program_name = d.pop("programName", UNSET) + + degree = d.pop("degree", UNSET) + + description = d.pop("description", UNSET) + + _location = d.pop("location", UNSET) + location: Union[Unset, None, LocationBlockModel] + if _location is None: + location = None + elif isinstance(_location, Unset): + location = UNSET + else: + location = LocationBlockModel.from_dict(_location) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + education_block_item_model = cls( + url=url, + school_name=school_name, + program_name=program_name, + degree=degree, + description=description, + location=location, + start_date=start_date, + end_date=end_date, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return education_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/education_block_model.py b/src/cinode-py-client/cinode_api_client/models/education_block_model.py new file mode 100644 index 0000000..d865251 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/education_block_model.py @@ -0,0 +1,127 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.education_block_item_model import EducationBlockItemModel + + +T = TypeVar("T", bound="EducationBlockModel") + + +@_attrs_define +class EducationBlockModel: + """ + Attributes: + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + data (Union[Unset, None, List['EducationBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["EducationBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.education_block_item_model import EducationBlockItemModel + + d = src_dict.copy() + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = EducationBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + education_block_model = cls( + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return education_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/employer_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/employer_block_item_model.py new file mode 100644 index 0000000..01ba23f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/employer_block_item_model.py @@ -0,0 +1,166 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EmployerBlockItemModel") + + +@_attrs_define +class EmployerBlockItemModel: + """ + Attributes: + title (Union[Unset, None, str]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + title: Union[Unset, None, str] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + name = self.name + description = self.description + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + employer_block_item_model = cls( + title=title, + name=name, + description=description, + start_date=start_date, + end_date=end_date, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return employer_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/employer_block_model.py b/src/cinode-py-client/cinode_api_client/models/employer_block_model.py new file mode 100644 index 0000000..a70bd9d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/employer_block_model.py @@ -0,0 +1,127 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.employer_block_item_model import EmployerBlockItemModel + + +T = TypeVar("T", bound="EmployerBlockModel") + + +@_attrs_define +class EmployerBlockModel: + """ + Attributes: + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + data (Union[Unset, None, List['EmployerBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["EmployerBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.employer_block_item_model import EmployerBlockItemModel + + d = src_dict.copy() + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = EmployerBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + employer_block_model = cls( + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return employer_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/error_model.py b/src/cinode-py-client/cinode_api_client/models/error_model.py new file mode 100644 index 0000000..f632963 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/error_model.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ErrorModel") + + +@_attrs_define +class ErrorModel: + """ + Attributes: + correlation_id (Union[Unset, None, str]): CorrelationId + status (Union[Unset, None, str]): Severity of error + description (Union[Unset, None, str]): Error description in plain text + code (Union[Unset, None, int]): Cinode specific error code + more_info (Union[Unset, None, str]): Url to help page containing more information + """ + + correlation_id: Union[Unset, None, str] = UNSET + status: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + code: Union[Unset, None, int] = UNSET + more_info: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + correlation_id = self.correlation_id + status = self.status + description = self.description + code = self.code + more_info = self.more_info + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if correlation_id is not UNSET: + field_dict["correlationId"] = correlation_id + if status is not UNSET: + field_dict["status"] = status + if description is not UNSET: + field_dict["description"] = description + if code is not UNSET: + field_dict["code"] = code + if more_info is not UNSET: + field_dict["moreInfo"] = more_info + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + correlation_id = d.pop("correlationId", UNSET) + + status = d.pop("status", UNSET) + + description = d.pop("description", UNSET) + + code = d.pop("code", UNSET) + + more_info = d.pop("moreInfo", UNSET) + + error_model = cls( + correlation_id=correlation_id, + status=status, + description=description, + code=code, + more_info=more_info, + ) + + return error_model diff --git a/src/cinode-py-client/cinode_api_client/models/event_comment_model.py b/src/cinode-py-client/cinode_api_client/models/event_comment_model.py new file mode 100644 index 0000000..1d36e67 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_comment_model.py @@ -0,0 +1,87 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EventCommentModel") + + +@_attrs_define +class EventCommentModel: + """ + Attributes: + id (Union[Unset, None, int]): + event_id (Union[Unset, None, str]): + text (Union[Unset, None, str]): + company_user_id (Union[Unset, int]): + company_user_name (Union[Unset, None, str]): + created (Union[Unset, datetime.datetime]): + """ + + id: Union[Unset, None, int] = UNSET + event_id: Union[Unset, None, str] = UNSET + text: Union[Unset, None, str] = UNSET + company_user_id: Union[Unset, int] = UNSET + company_user_name: Union[Unset, None, str] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + event_id = self.event_id + text = self.text + company_user_id = self.company_user_id + company_user_name = self.company_user_name + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if event_id is not UNSET: + field_dict["eventId"] = event_id + if text is not UNSET: + field_dict["text"] = text + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_user_name is not UNSET: + field_dict["companyUserName"] = company_user_name + if created is not UNSET: + field_dict["created"] = created + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + event_id = d.pop("eventId", UNSET) + + text = d.pop("text", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + company_user_name = d.pop("companyUserName", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + event_comment_model = cls( + id=id, + event_id=event_id, + text=text, + company_user_id=company_user_id, + company_user_name=company_user_name, + created=created, + ) + + return event_comment_model diff --git a/src/cinode-py-client/cinode_api_client/models/event_meeting_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/event_meeting_add_edit_model.py new file mode 100644 index 0000000..2f753d7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_meeting_add_edit_model.py @@ -0,0 +1,172 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EventMeetingAddEditModel") + + +@_attrs_define +class EventMeetingAddEditModel: + """ + Attributes: + title (str): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for StartDateTime and EndDateTime + properties. Valid timezone ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + event_meeting_add_edit_model = cls( + title=title, + start_date_time=start_date_time, + end_date_time=end_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return event_meeting_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/event_note_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/event_note_add_edit_model.py new file mode 100644 index 0000000..52c5c12 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_note_add_edit_model.py @@ -0,0 +1,148 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EventNoteAddEditModel") + + +@_attrs_define +class EventNoteAddEditModel: + """ + Attributes: + title (str): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for NoteDate property. Valid timezone ids + can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + timezone_id = self.timezone_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + timezone_id = d.pop("timezoneId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + event_note_add_edit_model = cls( + title=title, + note_type=note_type, + note_date=note_date, + timezone_id=timezone_id, + type=type, + description=description, + visibility=visibility, + ) + + return event_note_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/event_note_type.py b/src/cinode-py-client/cinode_api_client/models/event_note_type.py new file mode 100644 index 0000000..a227eba --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_note_type.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class EventNoteType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/event_status_value.py b/src/cinode-py-client/cinode_api_client/models/event_status_value.py new file mode 100644 index 0000000..a588eff --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_status_value.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class EventStatusValue(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/event_task_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/event_task_add_edit_model.py new file mode 100644 index 0000000..7b23c45 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_task_add_edit_model.py @@ -0,0 +1,191 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EventTaskAddEditModel") + + +@_attrs_define +class EventTaskAddEditModel: + """ + Attributes: + title (str): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for DueDateTime property. Valid timezone + ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + event_task_add_edit_model = cls( + title=title, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return event_task_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/event_task_type.py b/src/cinode-py-client/cinode_api_client/models/event_task_type.py new file mode 100644 index 0000000..1623cbf --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_task_type.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class EventTaskType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/event_type.py b/src/cinode-py-client/cinode_api_client/models/event_type.py new file mode 100644 index 0000000..25f4985 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_type.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class EventType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/event_visibility.py b/src/cinode-py-client/cinode_api_client/models/event_visibility.py new file mode 100644 index 0000000..79c3cc4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/event_visibility.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class EventVisibility(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/extent_type.py b/src/cinode-py-client/cinode_api_client/models/extent_type.py new file mode 100644 index 0000000..ea488d1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/extent_type.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class ExtentType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/extra_skill_block_model.py b/src/cinode-py-client/cinode_api_client/models/extra_skill_block_model.py new file mode 100644 index 0000000..b4eca71 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/extra_skill_block_model.py @@ -0,0 +1,95 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.extra_skill_item_block_model import ExtraSkillItemBlockModel + + +T = TypeVar("T", bound="ExtraSkillBlockModel") + + +@_attrs_define +class ExtraSkillBlockModel: + """ + Attributes: + data (Union[Unset, None, List['ExtraSkillItemBlockModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + data: Union[Unset, None, List["ExtraSkillItemBlockModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.extra_skill_item_block_model import ExtraSkillItemBlockModel + + d = src_dict.copy() + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = ExtraSkillItemBlockModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + extra_skill_block_model = cls( + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return extra_skill_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/extra_skill_item_block_model.py b/src/cinode-py-client/cinode_api_client/models/extra_skill_item_block_model.py new file mode 100644 index 0000000..8b1e8da --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/extra_skill_item_block_model.py @@ -0,0 +1,116 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ExtraSkillItemBlockModel") + + +@_attrs_define +class ExtraSkillItemBlockModel: + """ + Attributes: + title (Union[Unset, None, str]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + title: Union[Unset, None, str] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title", UNSET) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + extra_skill_item_block_model = cls( + title=title, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return extra_skill_item_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/filter_model.py b/src/cinode-py-client/cinode_api_client/models/filter_model.py new file mode 100644 index 0000000..084d691 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/filter_model.py @@ -0,0 +1,51 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FilterModel") + + +@_attrs_define +class FilterModel: + """ + Attributes: + name (Union[Unset, None, str]): + values (Union[Unset, None, List[int]]): + """ + + name: Union[Unset, None, str] = UNSET + values: Union[Unset, None, List[int]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + values: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.values, Unset): + if self.values is None: + values = None + else: + values = self.values + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if values is not UNSET: + field_dict["values"] = values + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name", UNSET) + + values = cast(List[int], d.pop("values", UNSET)) + + filter_model = cls( + name=name, + values=values, + ) + + return filter_model diff --git a/src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_item_model.py new file mode 100644 index 0000000..0d14725 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_item_model.py @@ -0,0 +1,218 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.image_block_model import ImageBlockModel + from ..models.location_block_model import LocationBlockModel + + +T = TypeVar("T", bound="HighlightedWorkExperienceBlockItemModel") + + +@_attrs_define +class HighlightedWorkExperienceBlockItemModel: + """ + Attributes: + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + employer (Union[Unset, None, str]): + location (Union[Unset, None, LocationBlockModel]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + url (Union[Unset, None, str]): + logotype (Union[Unset, None, ImageBlockModel]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + employer: Union[Unset, None, str] = UNSET + location: Union[Unset, None, "LocationBlockModel"] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + url: Union[Unset, None, str] = UNSET + logotype: Union[Unset, None, "ImageBlockModel"] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + description = self.description + employer = self.employer + location: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.location, Unset): + location = self.location.to_dict() if self.location else None + + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + url = self.url + logotype: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.logotype, Unset): + logotype = self.logotype.to_dict() if self.logotype else None + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if employer is not UNSET: + field_dict["employer"] = employer + if location is not UNSET: + field_dict["location"] = location + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if url is not UNSET: + field_dict["url"] = url + if logotype is not UNSET: + field_dict["logotype"] = logotype + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.image_block_model import ImageBlockModel + from ..models.location_block_model import LocationBlockModel + + d = src_dict.copy() + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + employer = d.pop("employer", UNSET) + + _location = d.pop("location", UNSET) + location: Union[Unset, None, LocationBlockModel] + if _location is None: + location = None + elif isinstance(_location, Unset): + location = UNSET + else: + location = LocationBlockModel.from_dict(_location) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + url = d.pop("url", UNSET) + + _logotype = d.pop("logotype", UNSET) + logotype: Union[Unset, None, ImageBlockModel] + if _logotype is None: + logotype = None + elif isinstance(_logotype, Unset): + logotype = UNSET + else: + logotype = ImageBlockModel.from_dict(_logotype) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + highlighted_work_experience_block_item_model = cls( + title=title, + description=description, + employer=employer, + location=location, + start_date=start_date, + end_date=end_date, + url=url, + logotype=logotype, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return highlighted_work_experience_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_model.py b/src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_model.py new file mode 100644 index 0000000..10c0c2c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/highlighted_work_experience_block_model.py @@ -0,0 +1,159 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.highlighted_work_experience_block_item_model import HighlightedWorkExperienceBlockItemModel + + +T = TypeVar("T", bound="HighlightedWorkExperienceBlockModel") + + +@_attrs_define +class HighlightedWorkExperienceBlockModel: + """ + Attributes: + number_of_items_in_list (Union[Unset, int]): + title_length (Union[Unset, int]): + description_length (Union[Unset, int]): + employer_length (Union[Unset, int]): + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + data (Union[Unset, None, List['HighlightedWorkExperienceBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + number_of_items_in_list: Union[Unset, int] = UNSET + title_length: Union[Unset, int] = UNSET + description_length: Union[Unset, int] = UNSET + employer_length: Union[Unset, int] = UNSET + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["HighlightedWorkExperienceBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + number_of_items_in_list = self.number_of_items_in_list + title_length = self.title_length + description_length = self.description_length + employer_length = self.employer_length + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if number_of_items_in_list is not UNSET: + field_dict["numberOfItemsInList"] = number_of_items_in_list + if title_length is not UNSET: + field_dict["titleLength"] = title_length + if description_length is not UNSET: + field_dict["descriptionLength"] = description_length + if employer_length is not UNSET: + field_dict["employerLength"] = employer_length + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.highlighted_work_experience_block_item_model import HighlightedWorkExperienceBlockItemModel + + d = src_dict.copy() + number_of_items_in_list = d.pop("numberOfItemsInList", UNSET) + + title_length = d.pop("titleLength", UNSET) + + description_length = d.pop("descriptionLength", UNSET) + + employer_length = d.pop("employerLength", UNSET) + + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = HighlightedWorkExperienceBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + highlighted_work_experience_block_model = cls( + number_of_items_in_list=number_of_items_in_list, + title_length=title_length, + description_length=description_length, + employer_length=employer_length, + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return highlighted_work_experience_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/i_company_address_view_model.py b/src/cinode-py-client/cinode_api_client/models/i_company_address_view_model.py new file mode 100644 index 0000000..0d32d0a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_company_address_view_model.py @@ -0,0 +1,102 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.address_type import AddressType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ICompanyAddressViewModel") + + +@_attrs_define +class ICompanyAddressViewModel: + """ + Attributes: + address_id (Union[Unset, int]): + street1 (Union[Unset, None, str]): + street2 (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + country (Union[Unset, None, str]): + address_type (Union[Unset, AddressType]): + + Övrig = 0 + + Besöksadress = 1 + + Faktureringsadress = 2 + + Placeringsort = 3 + """ + + address_id: Union[Unset, int] = UNSET + street1: Union[Unset, None, str] = UNSET + street2: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + address_type: Union[Unset, AddressType] = UNSET + + def to_dict(self) -> Dict[str, Any]: + address_id = self.address_id + street1 = self.street1 + street2 = self.street2 + zip_code = self.zip_code + city = self.city + country = self.country + address_type: Union[Unset, int] = UNSET + if not isinstance(self.address_type, Unset): + address_type = self.address_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if address_id is not UNSET: + field_dict["addressId"] = address_id + if street1 is not UNSET: + field_dict["street1"] = street1 + if street2 is not UNSET: + field_dict["street2"] = street2 + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if address_type is not UNSET: + field_dict["addressType"] = address_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + address_id = d.pop("addressId", UNSET) + + street1 = d.pop("street1", UNSET) + + street2 = d.pop("street2", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + _address_type = d.pop("addressType", UNSET) + address_type: Union[Unset, AddressType] + if isinstance(_address_type, Unset): + address_type = UNSET + else: + address_type = AddressType(_address_type) + + i_company_address_view_model = cls( + address_id=address_id, + street1=street1, + street2=street2, + zip_code=zip_code, + city=city, + country=country, + address_type=address_type, + ) + + return i_company_address_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/i_company_candidate_patch_document.py b/src/cinode-py-client/cinode_api_client/models/i_company_candidate_patch_document.py new file mode 100644 index 0000000..a3b24fb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_company_candidate_patch_document.py @@ -0,0 +1,111 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_candidate_state import CompanyCandidateState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ICompanyCandidatePatchDocument") + + +@_attrs_define +class ICompanyCandidatePatchDocument: + """ + Attributes: + pipeline_id (Union[Unset, None, int]): + pipeline_stage_id (Union[Unset, None, int]): + recruitment_manager_id (Union[Unset, None, int]): + state (Union[Unset, None, CompanyCandidateState]): + + Öppen = 0 + + Vunnen = 10 + + Pausad = 20 + + Avböjd av kandidat = 30 + + Avböjd av oss = 40 + available_from_date (Union[Unset, None, datetime.datetime]): + campaign_code (Union[Unset, None, str]): + """ + + pipeline_id: Union[Unset, None, int] = UNSET + pipeline_stage_id: Union[Unset, None, int] = UNSET + recruitment_manager_id: Union[Unset, None, int] = UNSET + state: Union[Unset, None, CompanyCandidateState] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + campaign_code: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + pipeline_id = self.pipeline_id + pipeline_stage_id = self.pipeline_stage_id + recruitment_manager_id = self.recruitment_manager_id + state: Union[Unset, None, int] = UNSET + if not isinstance(self.state, Unset): + state = self.state.value if self.state else None + + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + campaign_code = self.campaign_code + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if pipeline_id is not UNSET: + field_dict["pipelineId"] = pipeline_id + if pipeline_stage_id is not UNSET: + field_dict["pipelineStageId"] = pipeline_stage_id + if recruitment_manager_id is not UNSET: + field_dict["recruitmentManagerId"] = recruitment_manager_id + if state is not UNSET: + field_dict["state"] = state + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if campaign_code is not UNSET: + field_dict["campaignCode"] = campaign_code + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + pipeline_id = d.pop("pipelineId", UNSET) + + pipeline_stage_id = d.pop("pipelineStageId", UNSET) + + recruitment_manager_id = d.pop("recruitmentManagerId", UNSET) + + _state = d.pop("state", UNSET) + state: Union[Unset, None, CompanyCandidateState] + if _state is None: + state = None + elif isinstance(_state, Unset): + state = UNSET + else: + state = CompanyCandidateState(_state) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + campaign_code = d.pop("campaignCode", UNSET) + + i_company_candidate_patch_document = cls( + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + recruitment_manager_id=recruitment_manager_id, + state=state, + available_from_date=available_from_date, + campaign_code=campaign_code, + ) + + return i_company_candidate_patch_document diff --git a/src/cinode-py-client/cinode_api_client/models/i_company_user_employee_patch_document.py b/src/cinode-py-client/cinode_api_client/models/i_company_user_employee_patch_document.py new file mode 100644 index 0000000..f1db82b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_company_user_employee_patch_document.py @@ -0,0 +1,358 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.company_user_status import CompanyUserStatus +from ..models.user_gender import UserGender +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ICompanyUserEmployeePatchDocument") + + +@_attrs_define +class ICompanyUserEmployeePatchDocument: + """ + Attributes: + status (Union[Unset, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + employment_start_date (Union[Unset, None, datetime.datetime]): + employment_end_date (Union[Unset, None, datetime.datetime]): + employment_number (Union[Unset, None, str]): + invoicing_goal (Union[Unset, None, int]): + mobility (Union[Unset, None, int]): + availability_percent (Union[Unset, None, int]): + available_from_date (Union[Unset, None, datetime.datetime]): + title (Union[Unset, None, str]): + email (Union[Unset, None, str]): + tax_table (Union[Unset, None, str]): + base_salary (Union[Unset, None, int]): + provision (Union[Unset, None, int]): + hourly_target_rate (Union[Unset, None, int]): + self_cost (Union[Unset, None, int]): + location_id (Union[Unset, None, int]): + default_currency_id (Union[Unset, None, int]): + display_currency_id (Union[Unset, None, int]): + firstname (Union[Unset, None, str]): + lastname (Union[Unset, None, str]): + date_of_birth (Union[Unset, None, datetime.datetime]): + gender (Union[Unset, UserGender]): + + Ej angiven = 0 + + Man = 1 + + Kvinna = 2 + company_calendar_id (Union[Unset, None, int]): + timezone_id (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + desired_assignment (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + twitter (Union[Unset, None, str]): + linked_in (Union[Unset, None, str]): + homepage (Union[Unset, None, str]): + blog (Union[Unset, None, str]): + git_hub (Union[Unset, None, str]): + """ + + status: Union[Unset, CompanyUserStatus] = UNSET + employment_start_date: Union[Unset, None, datetime.datetime] = UNSET + employment_end_date: Union[Unset, None, datetime.datetime] = UNSET + employment_number: Union[Unset, None, str] = UNSET + invoicing_goal: Union[Unset, None, int] = UNSET + mobility: Union[Unset, None, int] = UNSET + availability_percent: Union[Unset, None, int] = UNSET + available_from_date: Union[Unset, None, datetime.datetime] = UNSET + title: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + tax_table: Union[Unset, None, str] = UNSET + base_salary: Union[Unset, None, int] = UNSET + provision: Union[Unset, None, int] = UNSET + hourly_target_rate: Union[Unset, None, int] = UNSET + self_cost: Union[Unset, None, int] = UNSET + location_id: Union[Unset, None, int] = UNSET + default_currency_id: Union[Unset, None, int] = UNSET + display_currency_id: Union[Unset, None, int] = UNSET + firstname: Union[Unset, None, str] = UNSET + lastname: Union[Unset, None, str] = UNSET + date_of_birth: Union[Unset, None, datetime.datetime] = UNSET + gender: Union[Unset, UserGender] = UNSET + company_calendar_id: Union[Unset, None, int] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + desired_assignment: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + twitter: Union[Unset, None, str] = UNSET + linked_in: Union[Unset, None, str] = UNSET + homepage: Union[Unset, None, str] = UNSET + blog: Union[Unset, None, str] = UNSET + git_hub: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + employment_start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_start_date, Unset): + employment_start_date = self.employment_start_date.isoformat() if self.employment_start_date else None + + employment_end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.employment_end_date, Unset): + employment_end_date = self.employment_end_date.isoformat() if self.employment_end_date else None + + employment_number = self.employment_number + invoicing_goal = self.invoicing_goal + mobility = self.mobility + availability_percent = self.availability_percent + available_from_date: Union[Unset, None, str] = UNSET + if not isinstance(self.available_from_date, Unset): + available_from_date = self.available_from_date.isoformat() if self.available_from_date else None + + title = self.title + email = self.email + tax_table = self.tax_table + base_salary = self.base_salary + provision = self.provision + hourly_target_rate = self.hourly_target_rate + self_cost = self.self_cost + location_id = self.location_id + default_currency_id = self.default_currency_id + display_currency_id = self.display_currency_id + firstname = self.firstname + lastname = self.lastname + date_of_birth: Union[Unset, None, str] = UNSET + if not isinstance(self.date_of_birth, Unset): + date_of_birth = self.date_of_birth.isoformat() if self.date_of_birth else None + + gender: Union[Unset, int] = UNSET + if not isinstance(self.gender, Unset): + gender = self.gender.value + + company_calendar_id = self.company_calendar_id + timezone_id = self.timezone_id + phone = self.phone + desired_assignment = self.desired_assignment + internal_identifier = self.internal_identifier + twitter = self.twitter + linked_in = self.linked_in + homepage = self.homepage + blog = self.blog + git_hub = self.git_hub + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if status is not UNSET: + field_dict["status"] = status + if employment_start_date is not UNSET: + field_dict["employmentStartDate"] = employment_start_date + if employment_end_date is not UNSET: + field_dict["employmentEndDate"] = employment_end_date + if employment_number is not UNSET: + field_dict["employmentNumber"] = employment_number + if invoicing_goal is not UNSET: + field_dict["invoicingGoal"] = invoicing_goal + if mobility is not UNSET: + field_dict["mobility"] = mobility + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + if available_from_date is not UNSET: + field_dict["availableFromDate"] = available_from_date + if title is not UNSET: + field_dict["title"] = title + if email is not UNSET: + field_dict["email"] = email + if tax_table is not UNSET: + field_dict["taxTable"] = tax_table + if base_salary is not UNSET: + field_dict["baseSalary"] = base_salary + if provision is not UNSET: + field_dict["provision"] = provision + if hourly_target_rate is not UNSET: + field_dict["hourlyTargetRate"] = hourly_target_rate + if self_cost is not UNSET: + field_dict["selfCost"] = self_cost + if location_id is not UNSET: + field_dict["locationId"] = location_id + if default_currency_id is not UNSET: + field_dict["defaultCurrencyId"] = default_currency_id + if display_currency_id is not UNSET: + field_dict["displayCurrencyId"] = display_currency_id + if firstname is not UNSET: + field_dict["firstname"] = firstname + if lastname is not UNSET: + field_dict["lastname"] = lastname + if date_of_birth is not UNSET: + field_dict["dateOfBirth"] = date_of_birth + if gender is not UNSET: + field_dict["gender"] = gender + if company_calendar_id is not UNSET: + field_dict["companyCalendarId"] = company_calendar_id + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if phone is not UNSET: + field_dict["phone"] = phone + if desired_assignment is not UNSET: + field_dict["desiredAssignment"] = desired_assignment + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + if twitter is not UNSET: + field_dict["twitter"] = twitter + if linked_in is not UNSET: + field_dict["linkedIn"] = linked_in + if homepage is not UNSET: + field_dict["homepage"] = homepage + if blog is not UNSET: + field_dict["blog"] = blog + if git_hub is not UNSET: + field_dict["gitHub"] = git_hub + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _status = d.pop("status", UNSET) + status: Union[Unset, CompanyUserStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + _employment_start_date = d.pop("employmentStartDate", UNSET) + employment_start_date: Union[Unset, None, datetime.datetime] + if _employment_start_date is None: + employment_start_date = None + elif isinstance(_employment_start_date, Unset): + employment_start_date = UNSET + else: + employment_start_date = isoparse(_employment_start_date) + + _employment_end_date = d.pop("employmentEndDate", UNSET) + employment_end_date: Union[Unset, None, datetime.datetime] + if _employment_end_date is None: + employment_end_date = None + elif isinstance(_employment_end_date, Unset): + employment_end_date = UNSET + else: + employment_end_date = isoparse(_employment_end_date) + + employment_number = d.pop("employmentNumber", UNSET) + + invoicing_goal = d.pop("invoicingGoal", UNSET) + + mobility = d.pop("mobility", UNSET) + + availability_percent = d.pop("availabilityPercent", UNSET) + + _available_from_date = d.pop("availableFromDate", UNSET) + available_from_date: Union[Unset, None, datetime.datetime] + if _available_from_date is None: + available_from_date = None + elif isinstance(_available_from_date, Unset): + available_from_date = UNSET + else: + available_from_date = isoparse(_available_from_date) + + title = d.pop("title", UNSET) + + email = d.pop("email", UNSET) + + tax_table = d.pop("taxTable", UNSET) + + base_salary = d.pop("baseSalary", UNSET) + + provision = d.pop("provision", UNSET) + + hourly_target_rate = d.pop("hourlyTargetRate", UNSET) + + self_cost = d.pop("selfCost", UNSET) + + location_id = d.pop("locationId", UNSET) + + default_currency_id = d.pop("defaultCurrencyId", UNSET) + + display_currency_id = d.pop("displayCurrencyId", UNSET) + + firstname = d.pop("firstname", UNSET) + + lastname = d.pop("lastname", UNSET) + + _date_of_birth = d.pop("dateOfBirth", UNSET) + date_of_birth: Union[Unset, None, datetime.datetime] + if _date_of_birth is None: + date_of_birth = None + elif isinstance(_date_of_birth, Unset): + date_of_birth = UNSET + else: + date_of_birth = isoparse(_date_of_birth) + + _gender = d.pop("gender", UNSET) + gender: Union[Unset, UserGender] + if isinstance(_gender, Unset): + gender = UNSET + else: + gender = UserGender(_gender) + + company_calendar_id = d.pop("companyCalendarId", UNSET) + + timezone_id = d.pop("timezoneId", UNSET) + + phone = d.pop("phone", UNSET) + + desired_assignment = d.pop("desiredAssignment", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + twitter = d.pop("twitter", UNSET) + + linked_in = d.pop("linkedIn", UNSET) + + homepage = d.pop("homepage", UNSET) + + blog = d.pop("blog", UNSET) + + git_hub = d.pop("gitHub", UNSET) + + i_company_user_employee_patch_document = cls( + status=status, + employment_start_date=employment_start_date, + employment_end_date=employment_end_date, + employment_number=employment_number, + invoicing_goal=invoicing_goal, + mobility=mobility, + availability_percent=availability_percent, + available_from_date=available_from_date, + title=title, + email=email, + tax_table=tax_table, + base_salary=base_salary, + provision=provision, + hourly_target_rate=hourly_target_rate, + self_cost=self_cost, + location_id=location_id, + default_currency_id=default_currency_id, + display_currency_id=display_currency_id, + firstname=firstname, + lastname=lastname, + date_of_birth=date_of_birth, + gender=gender, + company_calendar_id=company_calendar_id, + timezone_id=timezone_id, + phone=phone, + desired_assignment=desired_assignment, + internal_identifier=internal_identifier, + twitter=twitter, + linked_in=linked_in, + homepage=homepage, + blog=blog, + git_hub=git_hub, + ) + + return i_company_user_employee_patch_document diff --git a/src/cinode-py-client/cinode_api_client/models/i_contact_info_view_model.py b/src/cinode-py-client/cinode_api_client/models/i_contact_info_view_model.py new file mode 100644 index 0000000..b4937a5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_contact_info_view_model.py @@ -0,0 +1,93 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.i_company_address_view_model import ICompanyAddressViewModel + + +T = TypeVar("T", bound="IContactInfoViewModel") + + +@_attrs_define +class IContactInfoViewModel: + """ + Attributes: + contact_info_id (Union[Unset, int]): + display_name (Union[Unset, None, str]): + url (Union[Unset, None, str]): + email (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + address (Union[Unset, None, ICompanyAddressViewModel]): + """ + + contact_info_id: Union[Unset, int] = UNSET + display_name: Union[Unset, None, str] = UNSET + url: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + address: Union[Unset, None, "ICompanyAddressViewModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + contact_info_id = self.contact_info_id + display_name = self.display_name + url = self.url + email = self.email + phone = self.phone + address: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.address, Unset): + address = self.address.to_dict() if self.address else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if contact_info_id is not UNSET: + field_dict["contactInfoId"] = contact_info_id + if display_name is not UNSET: + field_dict["displayName"] = display_name + if url is not UNSET: + field_dict["url"] = url + if email is not UNSET: + field_dict["email"] = email + if phone is not UNSET: + field_dict["phone"] = phone + if address is not UNSET: + field_dict["address"] = address + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.i_company_address_view_model import ICompanyAddressViewModel + + d = src_dict.copy() + contact_info_id = d.pop("contactInfoId", UNSET) + + display_name = d.pop("displayName", UNSET) + + url = d.pop("url", UNSET) + + email = d.pop("email", UNSET) + + phone = d.pop("phone", UNSET) + + _address = d.pop("address", UNSET) + address: Union[Unset, None, ICompanyAddressViewModel] + if _address is None: + address = None + elif isinstance(_address, Unset): + address = UNSET + else: + address = ICompanyAddressViewModel.from_dict(_address) + + i_contact_info_view_model = cls( + contact_info_id=contact_info_id, + display_name=display_name, + url=url, + email=email, + phone=phone, + address=address, + ) + + return i_contact_info_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/i_dynamic_block_view_model.py b/src/cinode-py-client/cinode_api_client/models/i_dynamic_block_view_model.py new file mode 100644 index 0000000..2e1aa49 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_dynamic_block_view_model.py @@ -0,0 +1,138 @@ +import datetime +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.template_asset_type import TemplateAssetType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="IDynamicBlockViewModel") + + +@_attrs_define +class IDynamicBlockViewModel: + """ + Attributes: + view_component_name (Union[Unset, None, str]): + template_asset_types (Union[Unset, None, List[TemplateAssetType]]): + company_user_resume_id (Union[Unset, int]): + company_user_id (Union[Unset, int]): + is_editable (Union[Unset, bool]): + partial_edit_view_path (Union[Unset, None, str]): + friendly_block_name (Union[Unset, None, str]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + view_component_name: Union[Unset, None, str] = UNSET + template_asset_types: Union[Unset, None, List[TemplateAssetType]] = UNSET + company_user_resume_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + is_editable: Union[Unset, bool] = UNSET + partial_edit_view_path: Union[Unset, None, str] = UNSET + friendly_block_name: Union[Unset, None, str] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + view_component_name = self.view_component_name + template_asset_types: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.template_asset_types, Unset): + if self.template_asset_types is None: + template_asset_types = None + else: + template_asset_types = [] + for template_asset_types_item_data in self.template_asset_types: + template_asset_types_item = template_asset_types_item_data.value + + template_asset_types.append(template_asset_types_item) + + company_user_resume_id = self.company_user_resume_id + company_user_id = self.company_user_id + is_editable = self.is_editable + partial_edit_view_path = self.partial_edit_view_path + friendly_block_name = self.friendly_block_name + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if view_component_name is not UNSET: + field_dict["viewComponentName"] = view_component_name + if template_asset_types is not UNSET: + field_dict["templateAssetTypes"] = template_asset_types + if company_user_resume_id is not UNSET: + field_dict["companyUserResumeId"] = company_user_resume_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if is_editable is not UNSET: + field_dict["isEditable"] = is_editable + if partial_edit_view_path is not UNSET: + field_dict["partialEditViewPath"] = partial_edit_view_path + if friendly_block_name is not UNSET: + field_dict["friendlyBlockName"] = friendly_block_name + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + view_component_name = d.pop("viewComponentName", UNSET) + + template_asset_types = [] + _template_asset_types = d.pop("templateAssetTypes", UNSET) + for template_asset_types_item_data in _template_asset_types or []: + template_asset_types_item = TemplateAssetType(template_asset_types_item_data) + + template_asset_types.append(template_asset_types_item) + + company_user_resume_id = d.pop("companyUserResumeId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + is_editable = d.pop("isEditable", UNSET) + + partial_edit_view_path = d.pop("partialEditViewPath", UNSET) + + friendly_block_name = d.pop("friendlyBlockName", UNSET) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + i_dynamic_block_view_model = cls( + view_component_name=view_component_name, + template_asset_types=template_asset_types, + company_user_resume_id=company_user_resume_id, + company_user_id=company_user_id, + is_editable=is_editable, + partial_edit_view_path=partial_edit_view_path, + friendly_block_name=friendly_block_name, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return i_dynamic_block_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/i_template_company.py b/src/cinode-py-client/cinode_api_client/models/i_template_company.py new file mode 100644 index 0000000..5746d61 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_template_company.py @@ -0,0 +1,94 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ITemplateCompany") + + +@_attrs_define +class ITemplateCompany: + """ + Attributes: + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + description (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + registration_year (Union[Unset, int]): + is_tax_registered (Union[Unset, bool]): + is_using_freemium_resumes (Union[Unset, bool]): + """ + + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + registration_year: Union[Unset, int] = UNSET + is_tax_registered: Union[Unset, bool] = UNSET + is_using_freemium_resumes: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + name = self.name + seo_id = self.seo_id + description = self.description + corporate_identity_number = self.corporate_identity_number + registration_year = self.registration_year + is_tax_registered = self.is_tax_registered + is_using_freemium_resumes = self.is_using_freemium_resumes + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if description is not UNSET: + field_dict["description"] = description + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if registration_year is not UNSET: + field_dict["registrationYear"] = registration_year + if is_tax_registered is not UNSET: + field_dict["isTaxRegistered"] = is_tax_registered + if is_using_freemium_resumes is not UNSET: + field_dict["isUsingFreemiumResumes"] = is_using_freemium_resumes + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + seo_id = d.pop("seoId", UNSET) + + description = d.pop("description", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + registration_year = d.pop("registrationYear", UNSET) + + is_tax_registered = d.pop("isTaxRegistered", UNSET) + + is_using_freemium_resumes = d.pop("isUsingFreemiumResumes", UNSET) + + i_template_company = cls( + company_id=company_id, + name=name, + seo_id=seo_id, + description=description, + corporate_identity_number=corporate_identity_number, + registration_year=registration_year, + is_tax_registered=is_tax_registered, + is_using_freemium_resumes=is_using_freemium_resumes, + ) + + return i_template_company diff --git a/src/cinode-py-client/cinode_api_client/models/i_template_image.py b/src/cinode-py-client/cinode_api_client/models/i_template_image.py new file mode 100644 index 0000000..09f3d4f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_template_image.py @@ -0,0 +1,159 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.image_size import ImageSize +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ITemplateImage") + + +@_attrs_define +class ITemplateImage: + """ + Attributes: + company_user_resume_id (Union[Unset, int]): + company_user_id (Union[Unset, int]): + image_id (Union[Unset, int]): + image_url (Union[Unset, None, str]): + image_original_url (Union[Unset, None, str]): + allow_no_profile_image (Union[Unset, bool]): + show_image (Union[Unset, bool]): + image_size (Union[Unset, ImageSize]): + + Original = 0 + + H40W40 = 1 + + H100W100 = 2 + + H200W200 = 3 + + H300W300 = 4 + + W100 = 5 + + H60 = 6 + + H100 = 7 + + H40 = 8 + + W340 = 9 + + W1800 = 10 + + H750W1800 = 11 + + H250 = 12 + + H400W400 = 13 + + W150 = 14 + + W1200 = 15 + use_default_image (Union[Unset, bool]): + image_file_name (Union[Unset, str]): + extension (Union[Unset, None, str]): + """ + + company_user_resume_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + image_id: Union[Unset, int] = UNSET + image_url: Union[Unset, None, str] = UNSET + image_original_url: Union[Unset, None, str] = UNSET + allow_no_profile_image: Union[Unset, bool] = UNSET + show_image: Union[Unset, bool] = UNSET + image_size: Union[Unset, ImageSize] = UNSET + use_default_image: Union[Unset, bool] = UNSET + image_file_name: Union[Unset, str] = UNSET + extension: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_resume_id = self.company_user_resume_id + company_user_id = self.company_user_id + image_id = self.image_id + image_url = self.image_url + image_original_url = self.image_original_url + allow_no_profile_image = self.allow_no_profile_image + show_image = self.show_image + image_size: Union[Unset, int] = UNSET + if not isinstance(self.image_size, Unset): + image_size = self.image_size.value + + use_default_image = self.use_default_image + image_file_name = self.image_file_name + extension = self.extension + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_resume_id is not UNSET: + field_dict["companyUserResumeId"] = company_user_resume_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if image_id is not UNSET: + field_dict["imageId"] = image_id + if image_url is not UNSET: + field_dict["imageUrl"] = image_url + if image_original_url is not UNSET: + field_dict["imageOriginalUrl"] = image_original_url + if allow_no_profile_image is not UNSET: + field_dict["allowNoProfileImage"] = allow_no_profile_image + if show_image is not UNSET: + field_dict["showImage"] = show_image + if image_size is not UNSET: + field_dict["imageSize"] = image_size + if use_default_image is not UNSET: + field_dict["useDefaultImage"] = use_default_image + if image_file_name is not UNSET: + field_dict["imageFileName"] = image_file_name + if extension is not UNSET: + field_dict["extension"] = extension + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_resume_id = d.pop("companyUserResumeId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + image_id = d.pop("imageId", UNSET) + + image_url = d.pop("imageUrl", UNSET) + + image_original_url = d.pop("imageOriginalUrl", UNSET) + + allow_no_profile_image = d.pop("allowNoProfileImage", UNSET) + + show_image = d.pop("showImage", UNSET) + + _image_size = d.pop("imageSize", UNSET) + image_size: Union[Unset, ImageSize] + if isinstance(_image_size, Unset): + image_size = UNSET + else: + image_size = ImageSize(_image_size) + + use_default_image = d.pop("useDefaultImage", UNSET) + + image_file_name = d.pop("imageFileName", UNSET) + + extension = d.pop("extension", UNSET) + + i_template_image = cls( + company_user_resume_id=company_user_resume_id, + company_user_id=company_user_id, + image_id=image_id, + image_url=image_url, + image_original_url=image_original_url, + allow_no_profile_image=allow_no_profile_image, + show_image=show_image, + image_size=image_size, + use_default_image=use_default_image, + image_file_name=image_file_name, + extension=extension, + ) + + return i_template_image diff --git a/src/cinode-py-client/cinode_api_client/models/i_template_logotype.py b/src/cinode-py-client/cinode_api_client/models/i_template_logotype.py new file mode 100644 index 0000000..af55006 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_template_logotype.py @@ -0,0 +1,111 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.image_size import ImageSize +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ITemplateLogotype") + + +@_attrs_define +class ITemplateLogotype: + """ + Attributes: + image_url (Union[Unset, None, str]): + image_original_url (Union[Unset, None, str]): + image_size (Union[Unset, ImageSize]): + + Original = 0 + + H40W40 = 1 + + H100W100 = 2 + + H200W200 = 3 + + H300W300 = 4 + + W100 = 5 + + H60 = 6 + + H100 = 7 + + H40 = 8 + + W340 = 9 + + W1800 = 10 + + H750W1800 = 11 + + H250 = 12 + + H400W400 = 13 + + W150 = 14 + + W1200 = 15 + image_file_name (Union[Unset, str]): + extension (Union[Unset, None, str]): + """ + + image_url: Union[Unset, None, str] = UNSET + image_original_url: Union[Unset, None, str] = UNSET + image_size: Union[Unset, ImageSize] = UNSET + image_file_name: Union[Unset, str] = UNSET + extension: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + image_url = self.image_url + image_original_url = self.image_original_url + image_size: Union[Unset, int] = UNSET + if not isinstance(self.image_size, Unset): + image_size = self.image_size.value + + image_file_name = self.image_file_name + extension = self.extension + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if image_url is not UNSET: + field_dict["imageUrl"] = image_url + if image_original_url is not UNSET: + field_dict["imageOriginalUrl"] = image_original_url + if image_size is not UNSET: + field_dict["imageSize"] = image_size + if image_file_name is not UNSET: + field_dict["imageFileName"] = image_file_name + if extension is not UNSET: + field_dict["extension"] = extension + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + image_url = d.pop("imageUrl", UNSET) + + image_original_url = d.pop("imageOriginalUrl", UNSET) + + _image_size = d.pop("imageSize", UNSET) + image_size: Union[Unset, ImageSize] + if isinstance(_image_size, Unset): + image_size = UNSET + else: + image_size = ImageSize(_image_size) + + image_file_name = d.pop("imageFileName", UNSET) + + extension = d.pop("extension", UNSET) + + i_template_logotype = cls( + image_url=image_url, + image_original_url=image_original_url, + image_size=image_size, + image_file_name=image_file_name, + extension=extension, + ) + + return i_template_logotype diff --git a/src/cinode-py-client/cinode_api_client/models/i_template_shared_asset_view_model.py b/src/cinode-py-client/cinode_api_client/models/i_template_shared_asset_view_model.py new file mode 100644 index 0000000..761eb4c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_template_shared_asset_view_model.py @@ -0,0 +1,62 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ITemplateSharedAssetViewModel") + + +@_attrs_define +class ITemplateSharedAssetViewModel: + """ + Attributes: + description (Union[Unset, None, str]): + order (Union[Unset, int]): + file_name (Union[Unset, None, str]): + version (Union[Unset, None, str]): + """ + + description: Union[Unset, None, str] = UNSET + order: Union[Unset, int] = UNSET + file_name: Union[Unset, None, str] = UNSET + version: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + description = self.description + order = self.order + file_name = self.file_name + version = self.version + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if description is not UNSET: + field_dict["description"] = description + if order is not UNSET: + field_dict["order"] = order + if file_name is not UNSET: + field_dict["fileName"] = file_name + if version is not UNSET: + field_dict["version"] = version + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + description = d.pop("description", UNSET) + + order = d.pop("order", UNSET) + + file_name = d.pop("fileName", UNSET) + + version = d.pop("version", UNSET) + + i_template_shared_asset_view_model = cls( + description=description, + order=order, + file_name=file_name, + version=version, + ) + + return i_template_shared_asset_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/i_template_style_asset_view_model.py b/src/cinode-py-client/cinode_api_client/models/i_template_style_asset_view_model.py new file mode 100644 index 0000000..fbb5c74 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_template_style_asset_view_model.py @@ -0,0 +1,78 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ITemplateStyleAssetViewModel") + + +@_attrs_define +class ITemplateStyleAssetViewModel: + """ + Attributes: + company_id (Union[Unset, int]): + resume_template_id (Union[Unset, int]): + id (Union[Unset, int]): + order (Union[Unset, int]): + file_name (Union[Unset, None, str]): + version (Union[Unset, None, str]): + """ + + company_id: Union[Unset, int] = UNSET + resume_template_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + order: Union[Unset, int] = UNSET + file_name: Union[Unset, None, str] = UNSET + version: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + resume_template_id = self.resume_template_id + id = self.id + order = self.order + file_name = self.file_name + version = self.version + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if resume_template_id is not UNSET: + field_dict["resumeTemplateId"] = resume_template_id + if id is not UNSET: + field_dict["id"] = id + if order is not UNSET: + field_dict["order"] = order + if file_name is not UNSET: + field_dict["fileName"] = file_name + if version is not UNSET: + field_dict["version"] = version + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + resume_template_id = d.pop("resumeTemplateId", UNSET) + + id = d.pop("id", UNSET) + + order = d.pop("order", UNSET) + + file_name = d.pop("fileName", UNSET) + + version = d.pop("version", UNSET) + + i_template_style_asset_view_model = cls( + company_id=company_id, + resume_template_id=resume_template_id, + id=id, + order=order, + file_name=file_name, + version=version, + ) + + return i_template_style_asset_view_model diff --git a/src/cinode-py-client/cinode_api_client/models/i_template_user_info.py b/src/cinode-py-client/cinode_api_client/models/i_template_user_info.py new file mode 100644 index 0000000..2baea57 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/i_template_user_info.py @@ -0,0 +1,154 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ITemplateUserInfo") + + +@_attrs_define +class ITemplateUserInfo: + """ + Attributes: + firstname (Union[Unset, None, str]): + lastname (Union[Unset, None, str]): + fullname (Union[Unset, None, str]): + phone (Union[Unset, None, str]): + date_of_birth (Union[Unset, None, datetime.datetime]): + email (Union[Unset, None, str]): + twitter_user_name (Union[Unset, None, str]): + linked_in_user_name (Union[Unset, None, str]): + homepage_url (Union[Unset, None, str]): + blogg_url (Union[Unset, None, str]): + git_hub_user_name (Union[Unset, None, str]): + location (Union[Unset, None, str]): + country (Union[Unset, None, str]): + internal_identifier (Union[Unset, None, str]): + """ + + firstname: Union[Unset, None, str] = UNSET + lastname: Union[Unset, None, str] = UNSET + fullname: Union[Unset, None, str] = UNSET + phone: Union[Unset, None, str] = UNSET + date_of_birth: Union[Unset, None, datetime.datetime] = UNSET + email: Union[Unset, None, str] = UNSET + twitter_user_name: Union[Unset, None, str] = UNSET + linked_in_user_name: Union[Unset, None, str] = UNSET + homepage_url: Union[Unset, None, str] = UNSET + blogg_url: Union[Unset, None, str] = UNSET + git_hub_user_name: Union[Unset, None, str] = UNSET + location: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + internal_identifier: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + firstname = self.firstname + lastname = self.lastname + fullname = self.fullname + phone = self.phone + date_of_birth: Union[Unset, None, str] = UNSET + if not isinstance(self.date_of_birth, Unset): + date_of_birth = self.date_of_birth.isoformat() if self.date_of_birth else None + + email = self.email + twitter_user_name = self.twitter_user_name + linked_in_user_name = self.linked_in_user_name + homepage_url = self.homepage_url + blogg_url = self.blogg_url + git_hub_user_name = self.git_hub_user_name + location = self.location + country = self.country + internal_identifier = self.internal_identifier + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if firstname is not UNSET: + field_dict["firstname"] = firstname + if lastname is not UNSET: + field_dict["lastname"] = lastname + if fullname is not UNSET: + field_dict["fullname"] = fullname + if phone is not UNSET: + field_dict["phone"] = phone + if date_of_birth is not UNSET: + field_dict["dateOfBirth"] = date_of_birth + if email is not UNSET: + field_dict["email"] = email + if twitter_user_name is not UNSET: + field_dict["twitterUserName"] = twitter_user_name + if linked_in_user_name is not UNSET: + field_dict["linkedInUserName"] = linked_in_user_name + if homepage_url is not UNSET: + field_dict["homepageUrl"] = homepage_url + if blogg_url is not UNSET: + field_dict["bloggUrl"] = blogg_url + if git_hub_user_name is not UNSET: + field_dict["gitHubUserName"] = git_hub_user_name + if location is not UNSET: + field_dict["location"] = location + if country is not UNSET: + field_dict["country"] = country + if internal_identifier is not UNSET: + field_dict["internalIdentifier"] = internal_identifier + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + firstname = d.pop("firstname", UNSET) + + lastname = d.pop("lastname", UNSET) + + fullname = d.pop("fullname", UNSET) + + phone = d.pop("phone", UNSET) + + _date_of_birth = d.pop("dateOfBirth", UNSET) + date_of_birth: Union[Unset, None, datetime.datetime] + if _date_of_birth is None: + date_of_birth = None + elif isinstance(_date_of_birth, Unset): + date_of_birth = UNSET + else: + date_of_birth = isoparse(_date_of_birth) + + email = d.pop("email", UNSET) + + twitter_user_name = d.pop("twitterUserName", UNSET) + + linked_in_user_name = d.pop("linkedInUserName", UNSET) + + homepage_url = d.pop("homepageUrl", UNSET) + + blogg_url = d.pop("bloggUrl", UNSET) + + git_hub_user_name = d.pop("gitHubUserName", UNSET) + + location = d.pop("location", UNSET) + + country = d.pop("country", UNSET) + + internal_identifier = d.pop("internalIdentifier", UNSET) + + i_template_user_info = cls( + firstname=firstname, + lastname=lastname, + fullname=fullname, + phone=phone, + date_of_birth=date_of_birth, + email=email, + twitter_user_name=twitter_user_name, + linked_in_user_name=linked_in_user_name, + homepage_url=homepage_url, + blogg_url=blogg_url, + git_hub_user_name=git_hub_user_name, + location=location, + country=country, + internal_identifier=internal_identifier, + ) + + return i_template_user_info diff --git a/src/cinode-py-client/cinode_api_client/models/image_block_model.py b/src/cinode-py-client/cinode_api_client/models/image_block_model.py new file mode 100644 index 0000000..eb9db1c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/image_block_model.py @@ -0,0 +1,106 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ImageBlockModel") + + +@_attrs_define +class ImageBlockModel: + """ + Attributes: + image_id (Union[Unset, None, int]): + company_image_id (Union[Unset, None, int]): + image_original_url (Union[Unset, None, str]): + image_file_name (Union[Unset, str]): + extension (Union[Unset, None, str]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + image_id: Union[Unset, None, int] = UNSET + company_image_id: Union[Unset, None, int] = UNSET + image_original_url: Union[Unset, None, str] = UNSET + image_file_name: Union[Unset, str] = UNSET + extension: Union[Unset, None, str] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + image_id = self.image_id + company_image_id = self.company_image_id + image_original_url = self.image_original_url + image_file_name = self.image_file_name + extension = self.extension + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if image_id is not UNSET: + field_dict["imageId"] = image_id + if company_image_id is not UNSET: + field_dict["companyImageId"] = company_image_id + if image_original_url is not UNSET: + field_dict["imageOriginalUrl"] = image_original_url + if image_file_name is not UNSET: + field_dict["imageFileName"] = image_file_name + if extension is not UNSET: + field_dict["extension"] = extension + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + image_id = d.pop("imageId", UNSET) + + company_image_id = d.pop("companyImageId", UNSET) + + image_original_url = d.pop("imageOriginalUrl", UNSET) + + image_file_name = d.pop("imageFileName", UNSET) + + extension = d.pop("extension", UNSET) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + image_block_model = cls( + image_id=image_id, + company_image_id=company_image_id, + image_original_url=image_original_url, + image_file_name=image_file_name, + extension=extension, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return image_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/image_size.py b/src/cinode-py-client/cinode_api_client/models/image_size.py new file mode 100644 index 0000000..aef2e70 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/image_size.py @@ -0,0 +1,23 @@ +from enum import IntEnum + + +class ImageSize(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + VALUE_7 = 7 + VALUE_8 = 8 + VALUE_9 = 9 + VALUE_10 = 10 + VALUE_11 = 11 + VALUE_12 = 12 + VALUE_13 = 13 + VALUE_14 = 14 + VALUE_15 = 15 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/import_profile_async_operation.py b/src/cinode-py-client/cinode_api_client/models/import_profile_async_operation.py new file mode 100644 index 0000000..8ea216f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/import_profile_async_operation.py @@ -0,0 +1,98 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.long_running_status import LongRunningStatus +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_profile_base_model import CompanyUserProfileBaseModel + + +T = TypeVar("T", bound="ImportProfileAsyncOperation") + + +@_attrs_define +class ImportProfileAsyncOperation: + """ + Attributes: + profile (Union[Unset, None, CompanyUserProfileBaseModel]): + operation_id (Union[Unset, int]): + status (Union[Unset, LongRunningStatus]): + + InProgress = 0 + + Completed = 1 + + Failed = 2 + errors (Union[Unset, None, List[str]]): + """ + + profile: Union[Unset, None, "CompanyUserProfileBaseModel"] = UNSET + operation_id: Union[Unset, int] = UNSET + status: Union[Unset, LongRunningStatus] = UNSET + errors: Union[Unset, None, List[str]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + profile: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.profile, Unset): + profile = self.profile.to_dict() if self.profile else None + + operation_id = self.operation_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + errors: Union[Unset, None, List[str]] = UNSET + if not isinstance(self.errors, Unset): + if self.errors is None: + errors = None + else: + errors = self.errors + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if profile is not UNSET: + field_dict["profile"] = profile + if operation_id is not UNSET: + field_dict["operationId"] = operation_id + if status is not UNSET: + field_dict["status"] = status + if errors is not UNSET: + field_dict["errors"] = errors + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_profile_base_model import CompanyUserProfileBaseModel + + d = src_dict.copy() + _profile = d.pop("profile", UNSET) + profile: Union[Unset, None, CompanyUserProfileBaseModel] + if _profile is None: + profile = None + elif isinstance(_profile, Unset): + profile = UNSET + else: + profile = CompanyUserProfileBaseModel.from_dict(_profile) + + operation_id = d.pop("operationId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, LongRunningStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = LongRunningStatus(_status) + + errors = cast(List[str], d.pop("errors", UNSET)) + + import_profile_async_operation = cls( + profile=profile, + operation_id=operation_id, + status=status, + errors=errors, + ) + + return import_profile_async_operation diff --git a/src/cinode-py-client/cinode_api_client/models/keyword_model.py b/src/cinode-py-client/cinode_api_client/models/keyword_model.py new file mode 100644 index 0000000..398b6ac --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/keyword_model.py @@ -0,0 +1,141 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.keyword_type import KeywordType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="KeywordModel") + + +@_attrs_define +class KeywordModel: + """ + Attributes: + id (Union[Unset, None, int]): + type (Union[Unset, KeywordType]): + + Okategoriserad = 0 + + Branscher = 1 + + Roller = 2 + + Verktyg = 3 + + Tekniker = 4 + + Metoder och processer = 5 + + Plattformar = 6 + + Produkter och tjänster = 7 + + Certifieringar = 10 + + Material = 11 + + Specifikationer och förordningar = 12 + + Hårdvara = 13 + + Verksamhet och funktion = 14 + + Byggnationer = 15 + + Rapporter och utredningar = 16 + + Specialiteter - Medicin = 17 + + Standarder och regelverk = 18 + + Behörigheter = 19 + + Mjuka färdigheter = 20 + + CustomName = 100 + master_synonym_id (Union[Unset, None, int]): + master_synonym (Union[Unset, None, str]): + synonyms (Union[Unset, None, List[str]]): + universal (Union[Unset, bool]): + verified (Union[Unset, bool]): + """ + + id: Union[Unset, None, int] = UNSET + type: Union[Unset, KeywordType] = UNSET + master_synonym_id: Union[Unset, None, int] = UNSET + master_synonym: Union[Unset, None, str] = UNSET + synonyms: Union[Unset, None, List[str]] = UNSET + universal: Union[Unset, bool] = UNSET + verified: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + master_synonym_id = self.master_synonym_id + master_synonym = self.master_synonym + synonyms: Union[Unset, None, List[str]] = UNSET + if not isinstance(self.synonyms, Unset): + if self.synonyms is None: + synonyms = None + else: + synonyms = self.synonyms + + universal = self.universal + verified = self.verified + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if type is not UNSET: + field_dict["type"] = type + if master_synonym_id is not UNSET: + field_dict["masterSynonymId"] = master_synonym_id + if master_synonym is not UNSET: + field_dict["masterSynonym"] = master_synonym + if synonyms is not UNSET: + field_dict["synonyms"] = synonyms + if universal is not UNSET: + field_dict["universal"] = universal + if verified is not UNSET: + field_dict["verified"] = verified + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, KeywordType] + if isinstance(_type, Unset): + type = UNSET + else: + type = KeywordType(_type) + + master_synonym_id = d.pop("masterSynonymId", UNSET) + + master_synonym = d.pop("masterSynonym", UNSET) + + synonyms = cast(List[str], d.pop("synonyms", UNSET)) + + universal = d.pop("universal", UNSET) + + verified = d.pop("verified", UNSET) + + keyword_model = cls( + id=id, + type=type, + master_synonym_id=master_synonym_id, + master_synonym=master_synonym, + synonyms=synonyms, + universal=universal, + verified=verified, + ) + + return keyword_model diff --git a/src/cinode-py-client/cinode_api_client/models/keyword_synonym_model.py b/src/cinode-py-client/cinode_api_client/models/keyword_synonym_model.py new file mode 100644 index 0000000..ef89124 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/keyword_synonym_model.py @@ -0,0 +1,102 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.keyword_model import KeywordModel + + +T = TypeVar("T", bound="KeywordSynonymModel") + + +@_attrs_define +class KeywordSynonymModel: + """ + Attributes: + keyword_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + keyword (Union[Unset, None, KeywordModel]): + name (Union[Unset, None, str]): + seo_id (Union[Unset, None, str]): + description (Union[Unset, None, str]): + language_id (Union[Unset, None, int]): + """ + + keyword_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + name: Union[Unset, None, str] = UNSET + seo_id: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + language_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_id = self.keyword_id + id = self.id + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + name = self.name + seo_id = self.seo_id + description = self.description + language_id = self.language_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if id is not UNSET: + field_dict["id"] = id + if keyword is not UNSET: + field_dict["keyword"] = keyword + if name is not UNSET: + field_dict["name"] = name + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if description is not UNSET: + field_dict["description"] = description + if language_id is not UNSET: + field_dict["languageId"] = language_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.keyword_model import KeywordModel + + d = src_dict.copy() + keyword_id = d.pop("keywordId", UNSET) + + id = d.pop("id", UNSET) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + name = d.pop("name", UNSET) + + seo_id = d.pop("seoId", UNSET) + + description = d.pop("description", UNSET) + + language_id = d.pop("languageId", UNSET) + + keyword_synonym_model = cls( + keyword_id=keyword_id, + id=id, + keyword=keyword, + name=name, + seo_id=seo_id, + description=description, + language_id=language_id, + ) + + return keyword_synonym_model diff --git a/src/cinode-py-client/cinode_api_client/models/keyword_type.py b/src/cinode-py-client/cinode_api_client/models/keyword_type.py new file mode 100644 index 0000000..da1a0ef --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/keyword_type.py @@ -0,0 +1,27 @@ +from enum import IntEnum + + +class KeywordType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + VALUE_7 = 7 + VALUE_10 = 10 + VALUE_11 = 11 + VALUE_12 = 12 + VALUE_13 = 13 + VALUE_14 = 14 + VALUE_15 = 15 + VALUE_16 = 16 + VALUE_17 = 17 + VALUE_18 = 18 + VALUE_19 = 19 + VALUE_20 = 20 + VALUE_100 = 100 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/language_block_model.py b/src/cinode-py-client/cinode_api_client/models/language_block_model.py new file mode 100644 index 0000000..c7768a6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/language_block_model.py @@ -0,0 +1,95 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.language_item_block_model import LanguageItemBlockModel + + +T = TypeVar("T", bound="LanguageBlockModel") + + +@_attrs_define +class LanguageBlockModel: + """ + Attributes: + data (Union[Unset, None, List['LanguageItemBlockModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + data: Union[Unset, None, List["LanguageItemBlockModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.language_item_block_model import LanguageItemBlockModel + + d = src_dict.copy() + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = LanguageItemBlockModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + language_block_model = cls( + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return language_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/language_item_block_model.py b/src/cinode-py-client/cinode_api_client/models/language_item_block_model.py new file mode 100644 index 0000000..0d048d6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/language_item_block_model.py @@ -0,0 +1,156 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="LanguageItemBlockModel") + + +@_attrs_define +class LanguageItemBlockModel: + """ + Attributes: + culture (Union[Unset, None, str]): + lang (Union[Unset, None, str]): + country (Union[Unset, None, str]): + name (Union[Unset, None, str]): + level (Union[Unset, int]): + language_id (Union[Unset, None, int]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + culture: Union[Unset, None, str] = UNSET + lang: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + name: Union[Unset, None, str] = UNSET + level: Union[Unset, int] = UNSET + language_id: Union[Unset, None, int] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + culture = self.culture + lang = self.lang + country = self.country + name = self.name + level = self.level + language_id = self.language_id + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if culture is not UNSET: + field_dict["culture"] = culture + if lang is not UNSET: + field_dict["lang"] = lang + if country is not UNSET: + field_dict["country"] = country + if name is not UNSET: + field_dict["name"] = name + if level is not UNSET: + field_dict["level"] = level + if language_id is not UNSET: + field_dict["languageId"] = language_id + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + culture = d.pop("culture", UNSET) + + lang = d.pop("lang", UNSET) + + country = d.pop("country", UNSET) + + name = d.pop("name", UNSET) + + level = d.pop("level", UNSET) + + language_id = d.pop("languageId", UNSET) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + language_item_block_model = cls( + culture=culture, + lang=lang, + country=country, + name=name, + level=level, + language_id=language_id, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return language_item_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/language_level.py b/src/cinode-py-client/cinode_api_client/models/language_level.py new file mode 100644 index 0000000..f82b8de --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/language_level.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class LanguageLevel(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/link.py b/src/cinode-py-client/cinode_api_client/models/link.py new file mode 100644 index 0000000..23359b3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/link.py @@ -0,0 +1,59 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Link") + + +@_attrs_define +class Link: + """ + Attributes: + href (Union[Unset, None, str]): + rel (Union[Unset, None, str]): + methods (Union[Unset, None, List[str]]): + """ + + href: Union[Unset, None, str] = UNSET + rel: Union[Unset, None, str] = UNSET + methods: Union[Unset, None, List[str]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + href = self.href + rel = self.rel + methods: Union[Unset, None, List[str]] = UNSET + if not isinstance(self.methods, Unset): + if self.methods is None: + methods = None + else: + methods = self.methods + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if href is not UNSET: + field_dict["href"] = href + if rel is not UNSET: + field_dict["rel"] = rel + if methods is not UNSET: + field_dict["methods"] = methods + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + href = d.pop("href", UNSET) + + rel = d.pop("rel", UNSET) + + methods = cast(List[str], d.pop("methods", UNSET)) + + link = cls( + href=href, + rel=rel, + methods=methods, + ) + + return link diff --git a/src/cinode-py-client/cinode_api_client/models/location_block_model.py b/src/cinode-py-client/cinode_api_client/models/location_block_model.py new file mode 100644 index 0000000..02ca8ce --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/location_block_model.py @@ -0,0 +1,150 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="LocationBlockModel") + + +@_attrs_define +class LocationBlockModel: + """ + Attributes: + location_id (Union[Unset, int]): + google_id (Union[Unset, None, str]): + name (Union[Unset, None, str]): + street (Union[Unset, None, str]): + street_number (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + country (Union[Unset, None, str]): + country_code (Union[Unset, None, str]): + formatted_address (Union[Unset, None, str]): + phone_number (Union[Unset, None, str]): + latitude (Union[Unset, None, str]): + longitude (Union[Unset, None, str]): + web_site_url (Union[Unset, None, str]): + display_name (Union[Unset, None, str]): + """ + + location_id: Union[Unset, int] = UNSET + google_id: Union[Unset, None, str] = UNSET + name: Union[Unset, None, str] = UNSET + street: Union[Unset, None, str] = UNSET + street_number: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + country_code: Union[Unset, None, str] = UNSET + formatted_address: Union[Unset, None, str] = UNSET + phone_number: Union[Unset, None, str] = UNSET + latitude: Union[Unset, None, str] = UNSET + longitude: Union[Unset, None, str] = UNSET + web_site_url: Union[Unset, None, str] = UNSET + display_name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + location_id = self.location_id + google_id = self.google_id + name = self.name + street = self.street + street_number = self.street_number + zip_code = self.zip_code + city = self.city + country = self.country + country_code = self.country_code + formatted_address = self.formatted_address + phone_number = self.phone_number + latitude = self.latitude + longitude = self.longitude + web_site_url = self.web_site_url + display_name = self.display_name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if location_id is not UNSET: + field_dict["locationId"] = location_id + if google_id is not UNSET: + field_dict["googleId"] = google_id + if name is not UNSET: + field_dict["name"] = name + if street is not UNSET: + field_dict["street"] = street + if street_number is not UNSET: + field_dict["streetNumber"] = street_number + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if country_code is not UNSET: + field_dict["countryCode"] = country_code + if formatted_address is not UNSET: + field_dict["formattedAddress"] = formatted_address + if phone_number is not UNSET: + field_dict["phoneNumber"] = phone_number + if latitude is not UNSET: + field_dict["latitude"] = latitude + if longitude is not UNSET: + field_dict["longitude"] = longitude + if web_site_url is not UNSET: + field_dict["webSiteUrl"] = web_site_url + if display_name is not UNSET: + field_dict["displayName"] = display_name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + location_id = d.pop("locationId", UNSET) + + google_id = d.pop("googleId", UNSET) + + name = d.pop("name", UNSET) + + street = d.pop("street", UNSET) + + street_number = d.pop("streetNumber", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + country_code = d.pop("countryCode", UNSET) + + formatted_address = d.pop("formattedAddress", UNSET) + + phone_number = d.pop("phoneNumber", UNSET) + + latitude = d.pop("latitude", UNSET) + + longitude = d.pop("longitude", UNSET) + + web_site_url = d.pop("webSiteUrl", UNSET) + + display_name = d.pop("displayName", UNSET) + + location_block_model = cls( + location_id=location_id, + google_id=google_id, + name=name, + street=street, + street_number=street_number, + zip_code=zip_code, + city=city, + country=country, + country_code=country_code, + formatted_address=formatted_address, + phone_number=phone_number, + latitude=latitude, + longitude=longitude, + web_site_url=web_site_url, + display_name=display_name, + ) + + return location_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/location_model.py b/src/cinode-py-client/cinode_api_client/models/location_model.py new file mode 100644 index 0000000..7df4f3c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/location_model.py @@ -0,0 +1,142 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="LocationModel") + + +@_attrs_define +class LocationModel: + """ + Attributes: + location_id (Union[Unset, int]): + name (Union[Unset, None, str]): + street (Union[Unset, None, str]): + street_number (Union[Unset, None, str]): + zip_code (Union[Unset, None, str]): + city (Union[Unset, None, str]): + country (Union[Unset, None, str]): + country_code (Union[Unset, None, str]): + formatted_address (Union[Unset, None, str]): + phone_number (Union[Unset, None, str]): + latitude (Union[Unset, None, str]): + longitude (Union[Unset, None, str]): + web_site_url (Union[Unset, None, str]): + display_name (Union[Unset, None, str]): + """ + + location_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + street: Union[Unset, None, str] = UNSET + street_number: Union[Unset, None, str] = UNSET + zip_code: Union[Unset, None, str] = UNSET + city: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + country_code: Union[Unset, None, str] = UNSET + formatted_address: Union[Unset, None, str] = UNSET + phone_number: Union[Unset, None, str] = UNSET + latitude: Union[Unset, None, str] = UNSET + longitude: Union[Unset, None, str] = UNSET + web_site_url: Union[Unset, None, str] = UNSET + display_name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + location_id = self.location_id + name = self.name + street = self.street + street_number = self.street_number + zip_code = self.zip_code + city = self.city + country = self.country + country_code = self.country_code + formatted_address = self.formatted_address + phone_number = self.phone_number + latitude = self.latitude + longitude = self.longitude + web_site_url = self.web_site_url + display_name = self.display_name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if location_id is not UNSET: + field_dict["locationId"] = location_id + if name is not UNSET: + field_dict["name"] = name + if street is not UNSET: + field_dict["street"] = street + if street_number is not UNSET: + field_dict["streetNumber"] = street_number + if zip_code is not UNSET: + field_dict["zipCode"] = zip_code + if city is not UNSET: + field_dict["city"] = city + if country is not UNSET: + field_dict["country"] = country + if country_code is not UNSET: + field_dict["countryCode"] = country_code + if formatted_address is not UNSET: + field_dict["formattedAddress"] = formatted_address + if phone_number is not UNSET: + field_dict["phoneNumber"] = phone_number + if latitude is not UNSET: + field_dict["latitude"] = latitude + if longitude is not UNSET: + field_dict["longitude"] = longitude + if web_site_url is not UNSET: + field_dict["webSiteUrl"] = web_site_url + if display_name is not UNSET: + field_dict["displayName"] = display_name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + location_id = d.pop("locationId", UNSET) + + name = d.pop("name", UNSET) + + street = d.pop("street", UNSET) + + street_number = d.pop("streetNumber", UNSET) + + zip_code = d.pop("zipCode", UNSET) + + city = d.pop("city", UNSET) + + country = d.pop("country", UNSET) + + country_code = d.pop("countryCode", UNSET) + + formatted_address = d.pop("formattedAddress", UNSET) + + phone_number = d.pop("phoneNumber", UNSET) + + latitude = d.pop("latitude", UNSET) + + longitude = d.pop("longitude", UNSET) + + web_site_url = d.pop("webSiteUrl", UNSET) + + display_name = d.pop("displayName", UNSET) + + location_model = cls( + location_id=location_id, + name=name, + street=street, + street_number=street_number, + zip_code=zip_code, + city=city, + country=country, + country_code=country_code, + formatted_address=formatted_address, + phone_number=phone_number, + latitude=latitude, + longitude=longitude, + web_site_url=web_site_url, + display_name=display_name, + ) + + return location_model diff --git a/src/cinode-py-client/cinode_api_client/models/long_running_status.py b/src/cinode-py-client/cinode_api_client/models/long_running_status.py new file mode 100644 index 0000000..31b61c5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/long_running_status.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class LongRunningStatus(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/mention_text_model.py b/src/cinode-py-client/cinode_api_client/models/mention_text_model.py new file mode 100644 index 0000000..ea26767 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/mention_text_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MentionTextModel") + + +@_attrs_define +class MentionTextModel: + """ + Attributes: + value (Union[Unset, None, str]): + """ + + value: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + value = self.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if value is not UNSET: + field_dict["value"] = value + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + value = d.pop("value", UNSET) + + mention_text_model = cls( + value=value, + ) + + return mention_text_model diff --git a/src/cinode-py-client/cinode_api_client/models/module_type.py b/src/cinode-py-client/cinode_api_client/models/module_type.py new file mode 100644 index 0000000..b82eb68 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/module_type.py @@ -0,0 +1,37 @@ +from enum import IntEnum + + +class ModuleType(IntEnum): + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + VALUE_8 = 8 + VALUE_9 = 9 + VALUE_10 = 10 + VALUE_11 = 11 + VALUE_12 = 12 + VALUE_13 = 13 + VALUE_14 = 14 + VALUE_19 = 19 + VALUE_20 = 20 + VALUE_21 = 21 + VALUE_22 = 22 + VALUE_23 = 23 + VALUE_30 = 30 + VALUE_31 = 31 + VALUE_40 = 40 + VALUE_41 = 41 + VALUE_42 = 42 + VALUE_43 = 43 + VALUE_50 = 50 + VALUE_51 = 51 + VALUE_52 = 52 + VALUE_60 = 60 + VALUE_70 = 70 + VALUE_600 = 600 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/operation.py b/src/cinode-py-client/cinode_api_client/models/operation.py new file mode 100644 index 0000000..15a02bf --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/operation.py @@ -0,0 +1,90 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.operation_value import OperationValue + + +T = TypeVar("T", bound="Operation") + + +@_attrs_define +class Operation: + """ + Attributes: + op (Union[Unset, str]): + value (Union[Unset, None, OperationValue]): + path (Union[Unset, str]): + """ + + op: Union[Unset, str] = UNSET + value: Union[Unset, None, "OperationValue"] = UNSET + path: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + op = self.op + value: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.value, Unset): + value = self.value.to_dict() if self.value else None + + path = self.path + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if op is not UNSET: + field_dict["op"] = op + if value is not UNSET: + field_dict["value"] = value + if path is not UNSET: + field_dict["path"] = path + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.operation_value import OperationValue + + d = src_dict.copy() + op = d.pop("op", UNSET) + + _value = d.pop("value", UNSET) + value: Union[Unset, None, OperationValue] + if _value is None: + value = None + elif isinstance(_value, Unset): + value = UNSET + else: + value = OperationValue.from_dict(_value) + + path = d.pop("path", UNSET) + + operation = cls( + op=op, + value=value, + path=path, + ) + + operation.additional_properties = d + return operation + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/operation_value.py b/src/cinode-py-client/cinode_api_client/models/operation_value.py new file mode 100644 index 0000000..f5c4f40 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/operation_value.py @@ -0,0 +1,44 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="OperationValue") + + +@_attrs_define +class OperationValue: + """ """ + + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + operation_value = cls() + + operation_value.additional_properties = d + return operation_value + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/partner_base_model.py b/src/cinode-py-client/cinode_api_client/models/partner_base_model.py new file mode 100644 index 0000000..e39279b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/partner_base_model.py @@ -0,0 +1,122 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.partner_connection_base_model import PartnerConnectionBaseModel + + +T = TypeVar("T", bound="PartnerBaseModel") + + +@_attrs_define +class PartnerBaseModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + partner_connection (Union[Unset, None, PartnerConnectionBaseModel]): + company_user_manager (Union[Unset, None, CompanyUserBaseModel]): + has_trusts (Union[Unset, bool]): + is_enabled (Union[Unset, bool]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + partner_connection: Union[Unset, None, "PartnerConnectionBaseModel"] = UNSET + company_user_manager: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + has_trusts: Union[Unset, bool] = UNSET + is_enabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + name = self.name + description = self.description + partner_connection: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.partner_connection, Unset): + partner_connection = self.partner_connection.to_dict() if self.partner_connection else None + + company_user_manager: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_user_manager, Unset): + company_user_manager = self.company_user_manager.to_dict() if self.company_user_manager else None + + has_trusts = self.has_trusts + is_enabled = self.is_enabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if partner_connection is not UNSET: + field_dict["partnerConnection"] = partner_connection + if company_user_manager is not UNSET: + field_dict["companyUserManager"] = company_user_manager + if has_trusts is not UNSET: + field_dict["hasTrusts"] = has_trusts + if is_enabled is not UNSET: + field_dict["isEnabled"] = is_enabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.partner_connection_base_model import PartnerConnectionBaseModel + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + _partner_connection = d.pop("partnerConnection", UNSET) + partner_connection: Union[Unset, None, PartnerConnectionBaseModel] + if _partner_connection is None: + partner_connection = None + elif isinstance(_partner_connection, Unset): + partner_connection = UNSET + else: + partner_connection = PartnerConnectionBaseModel.from_dict(_partner_connection) + + _company_user_manager = d.pop("companyUserManager", UNSET) + company_user_manager: Union[Unset, None, CompanyUserBaseModel] + if _company_user_manager is None: + company_user_manager = None + elif isinstance(_company_user_manager, Unset): + company_user_manager = UNSET + else: + company_user_manager = CompanyUserBaseModel.from_dict(_company_user_manager) + + has_trusts = d.pop("hasTrusts", UNSET) + + is_enabled = d.pop("isEnabled", UNSET) + + partner_base_model = cls( + id=id, + company_id=company_id, + name=name, + description=description, + partner_connection=partner_connection, + company_user_manager=company_user_manager, + has_trusts=has_trusts, + is_enabled=is_enabled, + ) + + return partner_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/partner_connection_base_model.py b/src/cinode-py-client/cinode_api_client/models/partner_connection_base_model.py new file mode 100644 index 0000000..96222ca --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/partner_connection_base_model.py @@ -0,0 +1,150 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.partner_connection_trust_type import PartnerConnectionTrustType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_base_model import CompanyBaseModel + + +T = TypeVar("T", bound="PartnerConnectionBaseModel") + + +@_attrs_define +class PartnerConnectionBaseModel: + """ + Attributes: + company_id (Union[Unset, int]): + company (Union[Unset, None, CompanyBaseModel]): + partner_id (Union[Unset, int]): + connected_partner_connection_id (Union[Unset, None, int]): + partner_company_id (Union[Unset, int]): + partner_company (Union[Unset, None, CompanyBaseModel]): + granted_trusts (Union[Unset, None, List[PartnerConnectionTrustType]]): + received_trusts (Union[Unset, None, List[PartnerConnectionTrustType]]): + """ + + company_id: Union[Unset, int] = UNSET + company: Union[Unset, None, "CompanyBaseModel"] = UNSET + partner_id: Union[Unset, int] = UNSET + connected_partner_connection_id: Union[Unset, None, int] = UNSET + partner_company_id: Union[Unset, int] = UNSET + partner_company: Union[Unset, None, "CompanyBaseModel"] = UNSET + granted_trusts: Union[Unset, None, List[PartnerConnectionTrustType]] = UNSET + received_trusts: Union[Unset, None, List[PartnerConnectionTrustType]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + company: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company, Unset): + company = self.company.to_dict() if self.company else None + + partner_id = self.partner_id + connected_partner_connection_id = self.connected_partner_connection_id + partner_company_id = self.partner_company_id + partner_company: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.partner_company, Unset): + partner_company = self.partner_company.to_dict() if self.partner_company else None + + granted_trusts: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.granted_trusts, Unset): + if self.granted_trusts is None: + granted_trusts = None + else: + granted_trusts = [] + for granted_trusts_item_data in self.granted_trusts: + granted_trusts_item = granted_trusts_item_data.value + + granted_trusts.append(granted_trusts_item) + + received_trusts: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.received_trusts, Unset): + if self.received_trusts is None: + received_trusts = None + else: + received_trusts = [] + for received_trusts_item_data in self.received_trusts: + received_trusts_item = received_trusts_item_data.value + + received_trusts.append(received_trusts_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if company is not UNSET: + field_dict["company"] = company + if partner_id is not UNSET: + field_dict["partnerId"] = partner_id + if connected_partner_connection_id is not UNSET: + field_dict["connectedPartnerConnectionId"] = connected_partner_connection_id + if partner_company_id is not UNSET: + field_dict["partnerCompanyId"] = partner_company_id + if partner_company is not UNSET: + field_dict["partnerCompany"] = partner_company + if granted_trusts is not UNSET: + field_dict["grantedTrusts"] = granted_trusts + if received_trusts is not UNSET: + field_dict["receivedTrusts"] = received_trusts + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_base_model import CompanyBaseModel + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + _company = d.pop("company", UNSET) + company: Union[Unset, None, CompanyBaseModel] + if _company is None: + company = None + elif isinstance(_company, Unset): + company = UNSET + else: + company = CompanyBaseModel.from_dict(_company) + + partner_id = d.pop("partnerId", UNSET) + + connected_partner_connection_id = d.pop("connectedPartnerConnectionId", UNSET) + + partner_company_id = d.pop("partnerCompanyId", UNSET) + + _partner_company = d.pop("partnerCompany", UNSET) + partner_company: Union[Unset, None, CompanyBaseModel] + if _partner_company is None: + partner_company = None + elif isinstance(_partner_company, Unset): + partner_company = UNSET + else: + partner_company = CompanyBaseModel.from_dict(_partner_company) + + granted_trusts = [] + _granted_trusts = d.pop("grantedTrusts", UNSET) + for granted_trusts_item_data in _granted_trusts or []: + granted_trusts_item = PartnerConnectionTrustType(granted_trusts_item_data) + + granted_trusts.append(granted_trusts_item) + + received_trusts = [] + _received_trusts = d.pop("receivedTrusts", UNSET) + for received_trusts_item_data in _received_trusts or []: + received_trusts_item = PartnerConnectionTrustType(received_trusts_item_data) + + received_trusts.append(received_trusts_item) + + partner_connection_base_model = cls( + company_id=company_id, + company=company, + partner_id=partner_id, + connected_partner_connection_id=connected_partner_connection_id, + partner_company_id=partner_company_id, + partner_company=partner_company, + granted_trusts=granted_trusts, + received_trusts=received_trusts, + ) + + return partner_connection_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/partner_connection_trust_type.py b/src/cinode-py-client/cinode_api_client/models/partner_connection_trust_type.py new file mode 100644 index 0000000..3888159 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/partner_connection_trust_type.py @@ -0,0 +1,13 @@ +from enum import IntEnum + + +class PartnerConnectionTrustType(IntEnum): + VALUE_10 = 10 + VALUE_20 = 20 + VALUE_30 = 30 + VALUE_40 = 40 + VALUE_50 = 50 + VALUE_60 = 60 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/partner_recipient_base_model.py b/src/cinode-py-client/cinode_api_client/models/partner_recipient_base_model.py new file mode 100644 index 0000000..dc1832f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/partner_recipient_base_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PartnerRecipientBaseModel") + + +@_attrs_define +class PartnerRecipientBaseModel: + """ + Attributes: + partner_id (Union[Unset, int]): + requested_company_user_anonymous_hash (Union[Unset, None, str]): + requested_company_user_id (Union[Unset, None, int]): + """ + + partner_id: Union[Unset, int] = UNSET + requested_company_user_anonymous_hash: Union[Unset, None, str] = UNSET + requested_company_user_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + partner_id = self.partner_id + requested_company_user_anonymous_hash = self.requested_company_user_anonymous_hash + requested_company_user_id = self.requested_company_user_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if partner_id is not UNSET: + field_dict["partnerId"] = partner_id + if requested_company_user_anonymous_hash is not UNSET: + field_dict["requestedCompanyUserAnonymousHash"] = requested_company_user_anonymous_hash + if requested_company_user_id is not UNSET: + field_dict["requestedCompanyUserId"] = requested_company_user_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + partner_id = d.pop("partnerId", UNSET) + + requested_company_user_anonymous_hash = d.pop("requestedCompanyUserAnonymousHash", UNSET) + + requested_company_user_id = d.pop("requestedCompanyUserId", UNSET) + + partner_recipient_base_model = cls( + partner_id=partner_id, + requested_company_user_anonymous_hash=requested_company_user_anonymous_hash, + requested_company_user_id=requested_company_user_id, + ) + + return partner_recipient_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/partners_filter_model.py b/src/cinode-py-client/cinode_api_client/models/partners_filter_model.py new file mode 100644 index 0000000..1e3b3b7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/partners_filter_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PartnersFilterModel") + + +@_attrs_define +class PartnersFilterModel: + """ + Attributes: + query (Union[Unset, None, str]): + only_include_connected_partners (Union[Unset, bool]): + """ + + query: Union[Unset, None, str] = UNSET + only_include_connected_partners: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + query = self.query + only_include_connected_partners = self.only_include_connected_partners + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if query is not UNSET: + field_dict["query"] = query + if only_include_connected_partners is not UNSET: + field_dict["onlyIncludeConnectedPartners"] = only_include_connected_partners + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + query = d.pop("query", UNSET) + + only_include_connected_partners = d.pop("onlyIncludeConnectedPartners", UNSET) + + partners_filter_model = cls( + query=query, + only_include_connected_partners=only_include_connected_partners, + ) + + return partners_filter_model diff --git a/src/cinode-py-client/cinode_api_client/models/partners_overview_model.py b/src/cinode-py-client/cinode_api_client/models/partners_overview_model.py new file mode 100644 index 0000000..1be7ad3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/partners_overview_model.py @@ -0,0 +1,86 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.partner_base_model import PartnerBaseModel + from ..models.partners_filter_model import PartnersFilterModel + + +T = TypeVar("T", bound="PartnersOverviewModel") + + +@_attrs_define +class PartnersOverviewModel: + """ + Attributes: + partners (Union[Unset, None, List['PartnerBaseModel']]): + total_items (Union[Unset, int]): + filter_ (Union[Unset, None, PartnersFilterModel]): + """ + + partners: Union[Unset, None, List["PartnerBaseModel"]] = UNSET + total_items: Union[Unset, int] = UNSET + filter_: Union[Unset, None, "PartnersFilterModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + partners: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.partners, Unset): + if self.partners is None: + partners = None + else: + partners = [] + for partners_item_data in self.partners: + partners_item = partners_item_data.to_dict() + + partners.append(partners_item) + + total_items = self.total_items + filter_: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.filter_, Unset): + filter_ = self.filter_.to_dict() if self.filter_ else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if partners is not UNSET: + field_dict["partners"] = partners + if total_items is not UNSET: + field_dict["totalItems"] = total_items + if filter_ is not UNSET: + field_dict["filter"] = filter_ + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.partner_base_model import PartnerBaseModel + from ..models.partners_filter_model import PartnersFilterModel + + d = src_dict.copy() + partners = [] + _partners = d.pop("partners", UNSET) + for partners_item_data in _partners or []: + partners_item = PartnerBaseModel.from_dict(partners_item_data) + + partners.append(partners_item) + + total_items = d.pop("totalItems", UNSET) + + _filter_ = d.pop("filter", UNSET) + filter_: Union[Unset, None, PartnersFilterModel] + if _filter_ is None: + filter_ = None + elif isinstance(_filter_, Unset): + filter_ = UNSET + else: + filter_ = PartnersFilterModel.from_dict(_filter_) + + partners_overview_model = cls( + partners=partners, + total_items=total_items, + filter_=filter_, + ) + + return partners_overview_model diff --git a/src/cinode-py-client/cinode_api_client/models/pdf_engine_type.py b/src/cinode-py-client/cinode_api_client/models/pdf_engine_type.py new file mode 100644 index 0000000..219a4fa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/pdf_engine_type.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class PdfEngineType(IntEnum): + VALUE_0 = 0 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/pdf_orientation.py b/src/cinode-py-client/cinode_api_client/models/pdf_orientation.py new file mode 100644 index 0000000..d35edf1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/pdf_orientation.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class PdfOrientation(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/presentation_block_model.py b/src/cinode-py-client/cinode_api_client/models/presentation_block_model.py new file mode 100644 index 0000000..44ad9f6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/presentation_block_model.py @@ -0,0 +1,188 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PresentationBlockModel") + + +@_attrs_define +class PresentationBlockModel: + """ + Attributes: + discarded (Union[Unset, None, datetime.datetime]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + personal_description (Union[Unset, None, str]): + personal_description_heading (Union[Unset, None, str]): + sub_heading (Union[Unset, None, str]): + use_advanced_formatting (Union[Unset, bool]): + editor_settings (Union[Unset, None, str]): + hide_sub_heading (Union[Unset, bool]): + personal_presentation_length (Union[Unset, int]): + show_personal_presentation (Union[Unset, bool]): + title_length (Union[Unset, int]): + description_length (Union[Unset, int]): + employer_length (Union[Unset, int]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + discarded: Union[Unset, None, datetime.datetime] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + personal_description: Union[Unset, None, str] = UNSET + personal_description_heading: Union[Unset, None, str] = UNSET + sub_heading: Union[Unset, None, str] = UNSET + use_advanced_formatting: Union[Unset, bool] = UNSET + editor_settings: Union[Unset, None, str] = UNSET + hide_sub_heading: Union[Unset, bool] = UNSET + personal_presentation_length: Union[Unset, int] = UNSET + show_personal_presentation: Union[Unset, bool] = UNSET + title_length: Union[Unset, int] = UNSET + description_length: Union[Unset, int] = UNSET + employer_length: Union[Unset, int] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + title = self.title + description = self.description + personal_description = self.personal_description + personal_description_heading = self.personal_description_heading + sub_heading = self.sub_heading + use_advanced_formatting = self.use_advanced_formatting + editor_settings = self.editor_settings + hide_sub_heading = self.hide_sub_heading + personal_presentation_length = self.personal_presentation_length + show_personal_presentation = self.show_personal_presentation + title_length = self.title_length + description_length = self.description_length + employer_length = self.employer_length + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if discarded is not UNSET: + field_dict["discarded"] = discarded + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if personal_description is not UNSET: + field_dict["personalDescription"] = personal_description + if personal_description_heading is not UNSET: + field_dict["personalDescriptionHeading"] = personal_description_heading + if sub_heading is not UNSET: + field_dict["subHeading"] = sub_heading + if use_advanced_formatting is not UNSET: + field_dict["useAdvancedFormatting"] = use_advanced_formatting + if editor_settings is not UNSET: + field_dict["editorSettings"] = editor_settings + if hide_sub_heading is not UNSET: + field_dict["hideSubHeading"] = hide_sub_heading + if personal_presentation_length is not UNSET: + field_dict["personalPresentationLength"] = personal_presentation_length + if show_personal_presentation is not UNSET: + field_dict["showPersonalPresentation"] = show_personal_presentation + if title_length is not UNSET: + field_dict["titleLength"] = title_length + if description_length is not UNSET: + field_dict["descriptionLength"] = description_length + if employer_length is not UNSET: + field_dict["employerLength"] = employer_length + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + personal_description = d.pop("personalDescription", UNSET) + + personal_description_heading = d.pop("personalDescriptionHeading", UNSET) + + sub_heading = d.pop("subHeading", UNSET) + + use_advanced_formatting = d.pop("useAdvancedFormatting", UNSET) + + editor_settings = d.pop("editorSettings", UNSET) + + hide_sub_heading = d.pop("hideSubHeading", UNSET) + + personal_presentation_length = d.pop("personalPresentationLength", UNSET) + + show_personal_presentation = d.pop("showPersonalPresentation", UNSET) + + title_length = d.pop("titleLength", UNSET) + + description_length = d.pop("descriptionLength", UNSET) + + employer_length = d.pop("employerLength", UNSET) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + presentation_block_model = cls( + discarded=discarded, + title=title, + description=description, + personal_description=personal_description, + personal_description_heading=personal_description_heading, + sub_heading=sub_heading, + use_advanced_formatting=use_advanced_formatting, + editor_settings=editor_settings, + hide_sub_heading=hide_sub_heading, + personal_presentation_length=personal_presentation_length, + show_personal_presentation=show_personal_presentation, + title_length=title_length, + description_length=description_length, + employer_length=employer_length, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return presentation_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/profile_language_model.py b/src/cinode-py-client/cinode_api_client/models/profile_language_model.py new file mode 100644 index 0000000..f142cf3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/profile_language_model.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProfileLanguageModel") + + +@_attrs_define +class ProfileLanguageModel: + """ + Attributes: + language_id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + culture (Union[Unset, None, str]): + lang (Union[Unset, None, str]): + country (Union[Unset, None, str]): + """ + + language_id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + culture: Union[Unset, None, str] = UNSET + lang: Union[Unset, None, str] = UNSET + country: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + language_id = self.language_id + name = self.name + culture = self.culture + lang = self.lang + country = self.country + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if language_id is not UNSET: + field_dict["languageId"] = language_id + if name is not UNSET: + field_dict["name"] = name + if culture is not UNSET: + field_dict["culture"] = culture + if lang is not UNSET: + field_dict["lang"] = lang + if country is not UNSET: + field_dict["country"] = country + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + language_id = d.pop("languageId", UNSET) + + name = d.pop("name", UNSET) + + culture = d.pop("culture", UNSET) + + lang = d.pop("lang", UNSET) + + country = d.pop("country", UNSET) + + profile_language_model = cls( + language_id=language_id, + name=name, + culture=culture, + lang=lang, + country=country, + ) + + return profile_language_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_add_edit_model.py new file mode 100644 index 0000000..4077e35 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_add_edit_model.py @@ -0,0 +1,264 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.project_priority import ProjectPriority +from ..models.project_state import ProjectState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.location_model import LocationModel + + +T = TypeVar("T", bound="ProjectAddEditModel") + + +@_attrs_define +class ProjectAddEditModel: + """ + Attributes: + title (str): + customer_id (int): + description (Union[Unset, None, str]): + identifier (Union[Unset, None, str]): + customer_identifier (Union[Unset, None, str]): + intermediator_id (Union[Unset, None, int]): + estimated_close_date (Union[Unset, None, datetime.datetime]): + estimated_value (Union[Unset, None, int]): + contract_value (Union[Unset, None, int]): + probability (Union[Unset, None, int]): + pipeline_id (Union[Unset, None, int]): + pipeline_stage_id (Union[Unset, None, int]): + currency_id (Union[Unset, None, int]): + project_state (Union[Unset, ProjectState]): + + Öppen = 0 + + Vunnen = 30 + + Förlorad = 40 + + Avböjd = 50 + + Uppskjuten = 60 + location (Union[Unset, None, LocationModel]): + team_id (Union[Unset, None, int]): + state_reason_id (Union[Unset, None, int]): + priority (Union[Unset, ProjectPriority]): + + Låg = 3 + + Medel = 5 + + Hög = 8 Default: ProjectPriority.VALUE_5. + sales_manager_ids (Union[Unset, None, List[int]]): List of sales managers employee ids + project_manager_ids (Union[Unset, None, List[int]]): List of project managers employee ids + """ + + title: str + customer_id: int + description: Union[Unset, None, str] = UNSET + identifier: Union[Unset, None, str] = UNSET + customer_identifier: Union[Unset, None, str] = UNSET + intermediator_id: Union[Unset, None, int] = UNSET + estimated_close_date: Union[Unset, None, datetime.datetime] = UNSET + estimated_value: Union[Unset, None, int] = UNSET + contract_value: Union[Unset, None, int] = UNSET + probability: Union[Unset, None, int] = UNSET + pipeline_id: Union[Unset, None, int] = UNSET + pipeline_stage_id: Union[Unset, None, int] = UNSET + currency_id: Union[Unset, None, int] = UNSET + project_state: Union[Unset, ProjectState] = UNSET + location: Union[Unset, None, "LocationModel"] = UNSET + team_id: Union[Unset, None, int] = UNSET + state_reason_id: Union[Unset, None, int] = UNSET + priority: Union[Unset, ProjectPriority] = ProjectPriority.VALUE_5 + sales_manager_ids: Union[Unset, None, List[int]] = UNSET + project_manager_ids: Union[Unset, None, List[int]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_id = self.customer_id + description = self.description + identifier = self.identifier + customer_identifier = self.customer_identifier + intermediator_id = self.intermediator_id + estimated_close_date: Union[Unset, None, str] = UNSET + if not isinstance(self.estimated_close_date, Unset): + estimated_close_date = self.estimated_close_date.isoformat() if self.estimated_close_date else None + + estimated_value = self.estimated_value + contract_value = self.contract_value + probability = self.probability + pipeline_id = self.pipeline_id + pipeline_stage_id = self.pipeline_stage_id + currency_id = self.currency_id + project_state: Union[Unset, int] = UNSET + if not isinstance(self.project_state, Unset): + project_state = self.project_state.value + + location: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.location, Unset): + location = self.location.to_dict() if self.location else None + + team_id = self.team_id + state_reason_id = self.state_reason_id + priority: Union[Unset, int] = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority.value + + sales_manager_ids: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.sales_manager_ids, Unset): + if self.sales_manager_ids is None: + sales_manager_ids = None + else: + sales_manager_ids = self.sales_manager_ids + + project_manager_ids: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_manager_ids, Unset): + if self.project_manager_ids is None: + project_manager_ids = None + else: + project_manager_ids = self.project_manager_ids + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + "customerId": customer_id, + } + ) + if description is not UNSET: + field_dict["description"] = description + if identifier is not UNSET: + field_dict["identifier"] = identifier + if customer_identifier is not UNSET: + field_dict["customerIdentifier"] = customer_identifier + if intermediator_id is not UNSET: + field_dict["intermediatorId"] = intermediator_id + if estimated_close_date is not UNSET: + field_dict["estimatedCloseDate"] = estimated_close_date + if estimated_value is not UNSET: + field_dict["estimatedValue"] = estimated_value + if contract_value is not UNSET: + field_dict["contractValue"] = contract_value + if probability is not UNSET: + field_dict["probability"] = probability + if pipeline_id is not UNSET: + field_dict["pipelineId"] = pipeline_id + if pipeline_stage_id is not UNSET: + field_dict["pipelineStageId"] = pipeline_stage_id + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if project_state is not UNSET: + field_dict["projectState"] = project_state + if location is not UNSET: + field_dict["location"] = location + if team_id is not UNSET: + field_dict["teamId"] = team_id + if state_reason_id is not UNSET: + field_dict["stateReasonId"] = state_reason_id + if priority is not UNSET: + field_dict["priority"] = priority + if sales_manager_ids is not UNSET: + field_dict["salesManagerIds"] = sales_manager_ids + if project_manager_ids is not UNSET: + field_dict["projectManagerIds"] = project_manager_ids + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.location_model import LocationModel + + d = src_dict.copy() + title = d.pop("title") + + customer_id = d.pop("customerId") + + description = d.pop("description", UNSET) + + identifier = d.pop("identifier", UNSET) + + customer_identifier = d.pop("customerIdentifier", UNSET) + + intermediator_id = d.pop("intermediatorId", UNSET) + + _estimated_close_date = d.pop("estimatedCloseDate", UNSET) + estimated_close_date: Union[Unset, None, datetime.datetime] + if _estimated_close_date is None: + estimated_close_date = None + elif isinstance(_estimated_close_date, Unset): + estimated_close_date = UNSET + else: + estimated_close_date = isoparse(_estimated_close_date) + + estimated_value = d.pop("estimatedValue", UNSET) + + contract_value = d.pop("contractValue", UNSET) + + probability = d.pop("probability", UNSET) + + pipeline_id = d.pop("pipelineId", UNSET) + + pipeline_stage_id = d.pop("pipelineStageId", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + _project_state = d.pop("projectState", UNSET) + project_state: Union[Unset, ProjectState] + if isinstance(_project_state, Unset): + project_state = UNSET + else: + project_state = ProjectState(_project_state) + + _location = d.pop("location", UNSET) + location: Union[Unset, None, LocationModel] + if _location is None: + location = None + elif isinstance(_location, Unset): + location = UNSET + else: + location = LocationModel.from_dict(_location) + + team_id = d.pop("teamId", UNSET) + + state_reason_id = d.pop("stateReasonId", UNSET) + + _priority = d.pop("priority", UNSET) + priority: Union[Unset, ProjectPriority] + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = ProjectPriority(_priority) + + sales_manager_ids = cast(List[int], d.pop("salesManagerIds", UNSET)) + + project_manager_ids = cast(List[int], d.pop("projectManagerIds", UNSET)) + + project_add_edit_model = cls( + title=title, + customer_id=customer_id, + description=description, + identifier=identifier, + customer_identifier=customer_identifier, + intermediator_id=intermediator_id, + estimated_close_date=estimated_close_date, + estimated_value=estimated_value, + contract_value=contract_value, + probability=probability, + pipeline_id=pipeline_id, + pipeline_stage_id=pipeline_stage_id, + currency_id=currency_id, + project_state=project_state, + location=location, + team_id=team_id, + state_reason_id=state_reason_id, + priority=priority, + sales_manager_ids=sales_manager_ids, + project_manager_ids=project_manager_ids, + ) + + return project_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_add_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_add_model.py new file mode 100644 index 0000000..fe86cdb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_add_model.py @@ -0,0 +1,188 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.contract_type import ContractType +from ..models.extent_type import ExtentType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentAddModel") + + +@_attrs_define +class ProjectAssignmentAddModel: + """ + Attributes: + title (str): + description (Union[Unset, None, str]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + rate (Union[Unset, None, int]): + extent (Union[Unset, None, int]): + oral_agreement_to_date (Union[Unset, None, datetime.datetime]): + option_to_date (Union[Unset, None, datetime.datetime]): + contract_type (Union[Unset, ContractType]): + + Timpris = 0 + + Fastpris = 1 + extent_type (Union[Unset, ExtentType]): + + Procent = 0 + + Timmar = 1 + currency_id (Union[Unset, None, int]): + """ + + title: str + description: Union[Unset, None, str] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + rate: Union[Unset, None, int] = UNSET + extent: Union[Unset, None, int] = UNSET + oral_agreement_to_date: Union[Unset, None, datetime.datetime] = UNSET + option_to_date: Union[Unset, None, datetime.datetime] = UNSET + contract_type: Union[Unset, ContractType] = UNSET + extent_type: Union[Unset, ExtentType] = UNSET + currency_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + description = self.description + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + rate = self.rate + extent = self.extent + oral_agreement_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.oral_agreement_to_date, Unset): + oral_agreement_to_date = self.oral_agreement_to_date.isoformat() if self.oral_agreement_to_date else None + + option_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.option_to_date, Unset): + option_to_date = self.option_to_date.isoformat() if self.option_to_date else None + + contract_type: Union[Unset, int] = UNSET + if not isinstance(self.contract_type, Unset): + contract_type = self.contract_type.value + + extent_type: Union[Unset, int] = UNSET + if not isinstance(self.extent_type, Unset): + extent_type = self.extent_type.value + + currency_id = self.currency_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if description is not UNSET: + field_dict["description"] = description + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if rate is not UNSET: + field_dict["rate"] = rate + if extent is not UNSET: + field_dict["extent"] = extent + if oral_agreement_to_date is not UNSET: + field_dict["oralAgreementToDate"] = oral_agreement_to_date + if option_to_date is not UNSET: + field_dict["optionToDate"] = option_to_date + if contract_type is not UNSET: + field_dict["contractType"] = contract_type + if extent_type is not UNSET: + field_dict["extentType"] = extent_type + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + description = d.pop("description", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + rate = d.pop("rate", UNSET) + + extent = d.pop("extent", UNSET) + + _oral_agreement_to_date = d.pop("oralAgreementToDate", UNSET) + oral_agreement_to_date: Union[Unset, None, datetime.datetime] + if _oral_agreement_to_date is None: + oral_agreement_to_date = None + elif isinstance(_oral_agreement_to_date, Unset): + oral_agreement_to_date = UNSET + else: + oral_agreement_to_date = isoparse(_oral_agreement_to_date) + + _option_to_date = d.pop("optionToDate", UNSET) + option_to_date: Union[Unset, None, datetime.datetime] + if _option_to_date is None: + option_to_date = None + elif isinstance(_option_to_date, Unset): + option_to_date = UNSET + else: + option_to_date = isoparse(_option_to_date) + + _contract_type = d.pop("contractType", UNSET) + contract_type: Union[Unset, ContractType] + if isinstance(_contract_type, Unset): + contract_type = UNSET + else: + contract_type = ContractType(_contract_type) + + _extent_type = d.pop("extentType", UNSET) + extent_type: Union[Unset, ExtentType] + if isinstance(_extent_type, Unset): + extent_type = UNSET + else: + extent_type = ExtentType(_extent_type) + + currency_id = d.pop("currencyId", UNSET) + + project_assignment_add_model = cls( + title=title, + description=description, + start_date=start_date, + end_date=end_date, + rate=rate, + extent=extent, + oral_agreement_to_date=oral_agreement_to_date, + option_to_date=option_to_date, + contract_type=contract_type, + extent_type=extent_type, + currency_id=currency_id, + ) + + return project_assignment_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_allocation_status.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_allocation_status.py new file mode 100644 index 0000000..93cb09a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_allocation_status.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class ProjectAssignmentAllocationStatus(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_announce_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_announce_model.py new file mode 100644 index 0000000..7c77d0b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_announce_model.py @@ -0,0 +1,187 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.partner_recipient_base_model import PartnerRecipientBaseModel + + +T = TypeVar("T", bound="ProjectAssignmentAnnounceModel") + + +@_attrs_define +class ProjectAssignmentAnnounceModel: + """ + Attributes: + title (str): + deadline (datetime.datetime): + manager_company_user_id (int): + description (Union[Unset, None, str]): + price (Union[Unset, None, float]): + is_price_negotiable (Union[Unset, bool]): + currency_id (Union[Unset, None, int]): + attachment_ids (Union[Unset, None, List[str]]): + partner_recipients (Union[Unset, None, List['PartnerRecipientBaseModel']]): + subcontractor_ids (Union[Unset, None, List[int]]): + announce_to_partner_network (Union[Unset, None, bool]): + announce_to_market (Union[Unset, None, bool]): + is_remote (Union[Unset, bool]): + is_end_customer_assignment (Union[Unset, None, bool]): + publish_for_real (Union[Unset, bool]): Set to true if you actually want to publish the announcement to your + recipients, if you are developing/testing the endpoint it should be false, then no persist will take place. + """ + + title: str + deadline: datetime.datetime + manager_company_user_id: int + description: Union[Unset, None, str] = UNSET + price: Union[Unset, None, float] = UNSET + is_price_negotiable: Union[Unset, bool] = UNSET + currency_id: Union[Unset, None, int] = UNSET + attachment_ids: Union[Unset, None, List[str]] = UNSET + partner_recipients: Union[Unset, None, List["PartnerRecipientBaseModel"]] = UNSET + subcontractor_ids: Union[Unset, None, List[int]] = UNSET + announce_to_partner_network: Union[Unset, None, bool] = UNSET + announce_to_market: Union[Unset, None, bool] = UNSET + is_remote: Union[Unset, bool] = UNSET + is_end_customer_assignment: Union[Unset, None, bool] = UNSET + publish_for_real: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + deadline = self.deadline.isoformat() + + manager_company_user_id = self.manager_company_user_id + description = self.description + price = self.price + is_price_negotiable = self.is_price_negotiable + currency_id = self.currency_id + attachment_ids: Union[Unset, None, List[str]] = UNSET + if not isinstance(self.attachment_ids, Unset): + if self.attachment_ids is None: + attachment_ids = None + else: + attachment_ids = self.attachment_ids + + partner_recipients: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.partner_recipients, Unset): + if self.partner_recipients is None: + partner_recipients = None + else: + partner_recipients = [] + for partner_recipients_item_data in self.partner_recipients: + partner_recipients_item = partner_recipients_item_data.to_dict() + + partner_recipients.append(partner_recipients_item) + + subcontractor_ids: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.subcontractor_ids, Unset): + if self.subcontractor_ids is None: + subcontractor_ids = None + else: + subcontractor_ids = self.subcontractor_ids + + announce_to_partner_network = self.announce_to_partner_network + announce_to_market = self.announce_to_market + is_remote = self.is_remote + is_end_customer_assignment = self.is_end_customer_assignment + publish_for_real = self.publish_for_real + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + "deadline": deadline, + "managerCompanyUserId": manager_company_user_id, + } + ) + if description is not UNSET: + field_dict["description"] = description + if price is not UNSET: + field_dict["price"] = price + if is_price_negotiable is not UNSET: + field_dict["isPriceNegotiable"] = is_price_negotiable + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if attachment_ids is not UNSET: + field_dict["attachmentIds"] = attachment_ids + if partner_recipients is not UNSET: + field_dict["partnerRecipients"] = partner_recipients + if subcontractor_ids is not UNSET: + field_dict["subcontractorIds"] = subcontractor_ids + if announce_to_partner_network is not UNSET: + field_dict["announceToPartnerNetwork"] = announce_to_partner_network + if announce_to_market is not UNSET: + field_dict["announceToMarket"] = announce_to_market + if is_remote is not UNSET: + field_dict["isRemote"] = is_remote + if is_end_customer_assignment is not UNSET: + field_dict["isEndCustomerAssignment"] = is_end_customer_assignment + if publish_for_real is not UNSET: + field_dict["publishForReal"] = publish_for_real + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.partner_recipient_base_model import PartnerRecipientBaseModel + + d = src_dict.copy() + title = d.pop("title") + + deadline = isoparse(d.pop("deadline")) + + manager_company_user_id = d.pop("managerCompanyUserId") + + description = d.pop("description", UNSET) + + price = d.pop("price", UNSET) + + is_price_negotiable = d.pop("isPriceNegotiable", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + attachment_ids = cast(List[str], d.pop("attachmentIds", UNSET)) + + partner_recipients = [] + _partner_recipients = d.pop("partnerRecipients", UNSET) + for partner_recipients_item_data in _partner_recipients or []: + partner_recipients_item = PartnerRecipientBaseModel.from_dict(partner_recipients_item_data) + + partner_recipients.append(partner_recipients_item) + + subcontractor_ids = cast(List[int], d.pop("subcontractorIds", UNSET)) + + announce_to_partner_network = d.pop("announceToPartnerNetwork", UNSET) + + announce_to_market = d.pop("announceToMarket", UNSET) + + is_remote = d.pop("isRemote", UNSET) + + is_end_customer_assignment = d.pop("isEndCustomerAssignment", UNSET) + + publish_for_real = d.pop("publishForReal", UNSET) + + project_assignment_announce_model = cls( + title=title, + deadline=deadline, + manager_company_user_id=manager_company_user_id, + description=description, + price=price, + is_price_negotiable=is_price_negotiable, + currency_id=currency_id, + attachment_ids=attachment_ids, + partner_recipients=partner_recipients, + subcontractor_ids=subcontractor_ids, + announce_to_partner_network=announce_to_partner_network, + announce_to_market=announce_to_market, + is_remote=is_remote, + is_end_customer_assignment=is_end_customer_assignment, + publish_for_real=publish_for_real, + ) + + return project_assignment_announce_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_announcement_base_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_announcement_base_model.py new file mode 100644 index 0000000..afe88ee --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_announcement_base_model.py @@ -0,0 +1,236 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.contract_type import ContractType +from ..models.project_assignment_request_status import ProjectAssignmentRequestStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentAnnouncementBaseModel") + + +@_attrs_define +class ProjectAssignmentAnnouncementBaseModel: + """ + Attributes: + request_id (Union[Unset, int]): + title (Union[Unset, None, str]): + project_id (Union[Unset, int]): + company_id (Union[Unset, int]): + project_assignment_id (Union[Unset, int]): + created_date_time (Union[Unset, datetime.datetime]): + deadline (Union[Unset, datetime.datetime]): + price (Union[Unset, None, float]): + contract_type (Union[Unset, ContractType]): + + Timpris = 0 + + Fastpris = 1 + description (Union[Unset, None, str]): + description_html (Union[Unset, None, str]): + currency_code (Union[Unset, None, str]): + currency_id (Union[Unset, None, int]): + status (Union[Unset, ProjectAssignmentRequestStatus]): + + Öppen = 0 + + Återkallad = 10 + + Stängd = 20 + status_text (Union[Unset, None, str]): + is_announced_to_partner_network (Union[Unset, None, bool]): + is_price_negotiable (Union[Unset, bool]): + is_remote (Union[Unset, None, bool]): + is_announced_to_market (Union[Unset, None, bool]): + is_end_customer_assignment (Union[Unset, None, bool]): + """ + + request_id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + project_id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + project_assignment_id: Union[Unset, int] = UNSET + created_date_time: Union[Unset, datetime.datetime] = UNSET + deadline: Union[Unset, datetime.datetime] = UNSET + price: Union[Unset, None, float] = UNSET + contract_type: Union[Unset, ContractType] = UNSET + description: Union[Unset, None, str] = UNSET + description_html: Union[Unset, None, str] = UNSET + currency_code: Union[Unset, None, str] = UNSET + currency_id: Union[Unset, None, int] = UNSET + status: Union[Unset, ProjectAssignmentRequestStatus] = UNSET + status_text: Union[Unset, None, str] = UNSET + is_announced_to_partner_network: Union[Unset, None, bool] = UNSET + is_price_negotiable: Union[Unset, bool] = UNSET + is_remote: Union[Unset, None, bool] = UNSET + is_announced_to_market: Union[Unset, None, bool] = UNSET + is_end_customer_assignment: Union[Unset, None, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + request_id = self.request_id + title = self.title + project_id = self.project_id + company_id = self.company_id + project_assignment_id = self.project_assignment_id + created_date_time: Union[Unset, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() + + deadline: Union[Unset, str] = UNSET + if not isinstance(self.deadline, Unset): + deadline = self.deadline.isoformat() + + price = self.price + contract_type: Union[Unset, int] = UNSET + if not isinstance(self.contract_type, Unset): + contract_type = self.contract_type.value + + description = self.description + description_html = self.description_html + currency_code = self.currency_code + currency_id = self.currency_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + status_text = self.status_text + is_announced_to_partner_network = self.is_announced_to_partner_network + is_price_negotiable = self.is_price_negotiable + is_remote = self.is_remote + is_announced_to_market = self.is_announced_to_market + is_end_customer_assignment = self.is_end_customer_assignment + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if request_id is not UNSET: + field_dict["requestId"] = request_id + if title is not UNSET: + field_dict["title"] = title + if project_id is not UNSET: + field_dict["projectId"] = project_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if project_assignment_id is not UNSET: + field_dict["projectAssignmentId"] = project_assignment_id + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if deadline is not UNSET: + field_dict["deadline"] = deadline + if price is not UNSET: + field_dict["price"] = price + if contract_type is not UNSET: + field_dict["contractType"] = contract_type + if description is not UNSET: + field_dict["description"] = description + if description_html is not UNSET: + field_dict["descriptionHtml"] = description_html + if currency_code is not UNSET: + field_dict["currencyCode"] = currency_code + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if status is not UNSET: + field_dict["status"] = status + if status_text is not UNSET: + field_dict["statusText"] = status_text + if is_announced_to_partner_network is not UNSET: + field_dict["isAnnouncedToPartnerNetwork"] = is_announced_to_partner_network + if is_price_negotiable is not UNSET: + field_dict["isPriceNegotiable"] = is_price_negotiable + if is_remote is not UNSET: + field_dict["isRemote"] = is_remote + if is_announced_to_market is not UNSET: + field_dict["isAnnouncedToMarket"] = is_announced_to_market + if is_end_customer_assignment is not UNSET: + field_dict["isEndCustomerAssignment"] = is_end_customer_assignment + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + request_id = d.pop("requestId", UNSET) + + title = d.pop("title", UNSET) + + project_id = d.pop("projectId", UNSET) + + company_id = d.pop("companyId", UNSET) + + project_assignment_id = d.pop("projectAssignmentId", UNSET) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, datetime.datetime] + if isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _deadline = d.pop("deadline", UNSET) + deadline: Union[Unset, datetime.datetime] + if isinstance(_deadline, Unset): + deadline = UNSET + else: + deadline = isoparse(_deadline) + + price = d.pop("price", UNSET) + + _contract_type = d.pop("contractType", UNSET) + contract_type: Union[Unset, ContractType] + if isinstance(_contract_type, Unset): + contract_type = UNSET + else: + contract_type = ContractType(_contract_type) + + description = d.pop("description", UNSET) + + description_html = d.pop("descriptionHtml", UNSET) + + currency_code = d.pop("currencyCode", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, ProjectAssignmentRequestStatus] + if isinstance(_status, Unset): + status = UNSET + else: + status = ProjectAssignmentRequestStatus(_status) + + status_text = d.pop("statusText", UNSET) + + is_announced_to_partner_network = d.pop("isAnnouncedToPartnerNetwork", UNSET) + + is_price_negotiable = d.pop("isPriceNegotiable", UNSET) + + is_remote = d.pop("isRemote", UNSET) + + is_announced_to_market = d.pop("isAnnouncedToMarket", UNSET) + + is_end_customer_assignment = d.pop("isEndCustomerAssignment", UNSET) + + project_assignment_announcement_base_model = cls( + request_id=request_id, + title=title, + project_id=project_id, + company_id=company_id, + project_assignment_id=project_assignment_id, + created_date_time=created_date_time, + deadline=deadline, + price=price, + contract_type=contract_type, + description=description, + description_html=description_html, + currency_code=currency_code, + currency_id=currency_id, + status=status, + status_text=status_text, + is_announced_to_partner_network=is_announced_to_partner_network, + is_price_negotiable=is_price_negotiable, + is_remote=is_remote, + is_announced_to_market=is_announced_to_market, + is_end_customer_assignment=is_end_customer_assignment, + ) + + return project_assignment_announcement_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_base_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_base_model.py new file mode 100644 index 0000000..cf5fc4a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_base_model.py @@ -0,0 +1,213 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.extent_type import ExtentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.link import Link + from ..models.project_base_model import ProjectBaseModel + + +T = TypeVar("T", bound="ProjectAssignmentBaseModel") + + +@_attrs_define +class ProjectAssignmentBaseModel: + """ + Attributes: + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + project_id (Union[Unset, int]): + project (Union[Unset, None, ProjectBaseModel]): + customer (Union[Unset, None, CompanyCustomerBaseModel]): + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + extent_type (Union[Unset, ExtentType]): + + Procent = 0 + + Timmar = 1 + extent (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, int] = UNSET + project: Union[Unset, None, "ProjectBaseModel"] = UNSET + customer: Union[Unset, None, "CompanyCustomerBaseModel"] = UNSET + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + extent_type: Union[Unset, ExtentType] = UNSET + extent: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + customer_id = self.customer_id + project_id = self.project_id + project: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.project, Unset): + project = self.project.to_dict() if self.project else None + + customer: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.customer, Unset): + customer = self.customer.to_dict() if self.customer else None + + id = self.id + title = self.title + description = self.description + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + extent_type: Union[Unset, int] = UNSET + if not isinstance(self.extent_type, Unset): + extent_type = self.extent_type.value + + extent = self.extent + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if project is not UNSET: + field_dict["project"] = project + if customer is not UNSET: + field_dict["customer"] = customer + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if extent_type is not UNSET: + field_dict["extentType"] = extent_type + if extent is not UNSET: + field_dict["extent"] = extent + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.link import Link + from ..models.project_base_model import ProjectBaseModel + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + _project = d.pop("project", UNSET) + project: Union[Unset, None, ProjectBaseModel] + if _project is None: + project = None + elif isinstance(_project, Unset): + project = UNSET + else: + project = ProjectBaseModel.from_dict(_project) + + _customer = d.pop("customer", UNSET) + customer: Union[Unset, None, CompanyCustomerBaseModel] + if _customer is None: + customer = None + elif isinstance(_customer, Unset): + customer = UNSET + else: + customer = CompanyCustomerBaseModel.from_dict(_customer) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + _extent_type = d.pop("extentType", UNSET) + extent_type: Union[Unset, ExtentType] + if isinstance(_extent_type, Unset): + extent_type = UNSET + else: + extent_type = ExtentType(_extent_type) + + extent = d.pop("extent", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_assignment_base_model = cls( + company_id=company_id, + customer_id=customer_id, + project_id=project_id, + project=project, + customer=customer, + id=id, + title=title, + description=description, + start_date=start_date, + end_date=end_date, + extent_type=extent_type, + extent=extent, + links=links, + ) + + return project_assignment_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_edit_model.py new file mode 100644 index 0000000..ca26fd3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_edit_model.py @@ -0,0 +1,195 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.contract_type import ContractType +from ..models.extent_type import ExtentType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentEditModel") + + +@_attrs_define +class ProjectAssignmentEditModel: + """ + Attributes: + project_assignment_id (int): + title (str): + description (Union[Unset, None, str]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + rate (Union[Unset, None, int]): + extent (Union[Unset, None, int]): + oral_agreement_to_date (Union[Unset, None, datetime.datetime]): + option_to_date (Union[Unset, None, datetime.datetime]): + contract_type (Union[Unset, ContractType]): + + Timpris = 0 + + Fastpris = 1 + extent_type (Union[Unset, ExtentType]): + + Procent = 0 + + Timmar = 1 + currency_id (Union[Unset, None, int]): + """ + + project_assignment_id: int + title: str + description: Union[Unset, None, str] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + rate: Union[Unset, None, int] = UNSET + extent: Union[Unset, None, int] = UNSET + oral_agreement_to_date: Union[Unset, None, datetime.datetime] = UNSET + option_to_date: Union[Unset, None, datetime.datetime] = UNSET + contract_type: Union[Unset, ContractType] = UNSET + extent_type: Union[Unset, ExtentType] = UNSET + currency_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + project_assignment_id = self.project_assignment_id + title = self.title + description = self.description + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + rate = self.rate + extent = self.extent + oral_agreement_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.oral_agreement_to_date, Unset): + oral_agreement_to_date = self.oral_agreement_to_date.isoformat() if self.oral_agreement_to_date else None + + option_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.option_to_date, Unset): + option_to_date = self.option_to_date.isoformat() if self.option_to_date else None + + contract_type: Union[Unset, int] = UNSET + if not isinstance(self.contract_type, Unset): + contract_type = self.contract_type.value + + extent_type: Union[Unset, int] = UNSET + if not isinstance(self.extent_type, Unset): + extent_type = self.extent_type.value + + currency_id = self.currency_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "projectAssignmentId": project_assignment_id, + "title": title, + } + ) + if description is not UNSET: + field_dict["description"] = description + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if rate is not UNSET: + field_dict["rate"] = rate + if extent is not UNSET: + field_dict["extent"] = extent + if oral_agreement_to_date is not UNSET: + field_dict["oralAgreementToDate"] = oral_agreement_to_date + if option_to_date is not UNSET: + field_dict["optionToDate"] = option_to_date + if contract_type is not UNSET: + field_dict["contractType"] = contract_type + if extent_type is not UNSET: + field_dict["extentType"] = extent_type + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + project_assignment_id = d.pop("projectAssignmentId") + + title = d.pop("title") + + description = d.pop("description", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + rate = d.pop("rate", UNSET) + + extent = d.pop("extent", UNSET) + + _oral_agreement_to_date = d.pop("oralAgreementToDate", UNSET) + oral_agreement_to_date: Union[Unset, None, datetime.datetime] + if _oral_agreement_to_date is None: + oral_agreement_to_date = None + elif isinstance(_oral_agreement_to_date, Unset): + oral_agreement_to_date = UNSET + else: + oral_agreement_to_date = isoparse(_oral_agreement_to_date) + + _option_to_date = d.pop("optionToDate", UNSET) + option_to_date: Union[Unset, None, datetime.datetime] + if _option_to_date is None: + option_to_date = None + elif isinstance(_option_to_date, Unset): + option_to_date = UNSET + else: + option_to_date = isoparse(_option_to_date) + + _contract_type = d.pop("contractType", UNSET) + contract_type: Union[Unset, ContractType] + if isinstance(_contract_type, Unset): + contract_type = UNSET + else: + contract_type = ContractType(_contract_type) + + _extent_type = d.pop("extentType", UNSET) + extent_type: Union[Unset, ExtentType] + if isinstance(_extent_type, Unset): + extent_type = UNSET + else: + extent_type = ExtentType(_extent_type) + + currency_id = d.pop("currencyId", UNSET) + + project_assignment_edit_model = cls( + project_assignment_id=project_assignment_id, + title=title, + description=description, + start_date=start_date, + end_date=end_date, + rate=rate, + extent=extent, + oral_agreement_to_date=oral_agreement_to_date, + option_to_date=option_to_date, + contract_type=contract_type, + extent_type=extent_type, + currency_id=currency_id, + ) + + return project_assignment_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_extent_type.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_extent_type.py new file mode 100644 index 0000000..2bc4aae --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_extent_type.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class ProjectAssignmentExtentType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_filter_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_filter_model.py new file mode 100644 index 0000000..9131ee7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_filter_model.py @@ -0,0 +1,164 @@ +from typing import Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.project_assignment_allocation_status import ProjectAssignmentAllocationStatus +from ..models.project_assignment_member_type import ProjectAssignmentMemberType +from ..models.project_assignment_status import ProjectAssignmentStatus +from ..models.project_state import ProjectState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentFilterModel") + + +@_attrs_define +class ProjectAssignmentFilterModel: + """ + Attributes: + pipelines (Union[Unset, None, List[int]]): Pipeline Ids can be retrieved from the Project Pipelines endpoint + project_assignment_member_types (Union[Unset, None, List[ProjectAssignmentMemberType]]): 0 - Employee + 1 - Partner consultant + 2- Subcontractor + project_assignment_statuses (Union[Unset, None, List[ProjectAssignmentStatus]]): 1 - Upcoming + 2 - Ongoing + teams (Union[Unset, None, List[int]]): Team Id of Employee assigned to Role + project_states (Union[Unset, None, List[ProjectState]]): 0 - Open + 30 - Won + 40 - Lost + 50 - Abandoned + 60 - Suspended + project_assignment_allocation_statuses (Union[Unset, None, List[ProjectAssignmentAllocationStatus]]): + """ + + pipelines: Union[Unset, None, List[int]] = UNSET + project_assignment_member_types: Union[Unset, None, List[ProjectAssignmentMemberType]] = UNSET + project_assignment_statuses: Union[Unset, None, List[ProjectAssignmentStatus]] = UNSET + teams: Union[Unset, None, List[int]] = UNSET + project_states: Union[Unset, None, List[ProjectState]] = UNSET + project_assignment_allocation_statuses: Union[Unset, None, List[ProjectAssignmentAllocationStatus]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + pipelines: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.pipelines, Unset): + if self.pipelines is None: + pipelines = None + else: + pipelines = self.pipelines + + project_assignment_member_types: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_assignment_member_types, Unset): + if self.project_assignment_member_types is None: + project_assignment_member_types = None + else: + project_assignment_member_types = [] + for project_assignment_member_types_item_data in self.project_assignment_member_types: + project_assignment_member_types_item = project_assignment_member_types_item_data.value + + project_assignment_member_types.append(project_assignment_member_types_item) + + project_assignment_statuses: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_assignment_statuses, Unset): + if self.project_assignment_statuses is None: + project_assignment_statuses = None + else: + project_assignment_statuses = [] + for project_assignment_statuses_item_data in self.project_assignment_statuses: + project_assignment_statuses_item = project_assignment_statuses_item_data.value + + project_assignment_statuses.append(project_assignment_statuses_item) + + teams: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.teams, Unset): + if self.teams is None: + teams = None + else: + teams = self.teams + + project_states: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_states, Unset): + if self.project_states is None: + project_states = None + else: + project_states = [] + for project_states_item_data in self.project_states: + project_states_item = project_states_item_data.value + + project_states.append(project_states_item) + + project_assignment_allocation_statuses: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_assignment_allocation_statuses, Unset): + if self.project_assignment_allocation_statuses is None: + project_assignment_allocation_statuses = None + else: + project_assignment_allocation_statuses = [] + for project_assignment_allocation_statuses_item_data in self.project_assignment_allocation_statuses: + project_assignment_allocation_statuses_item = project_assignment_allocation_statuses_item_data.value + + project_assignment_allocation_statuses.append(project_assignment_allocation_statuses_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if pipelines is not UNSET: + field_dict["pipelines"] = pipelines + if project_assignment_member_types is not UNSET: + field_dict["projectAssignmentMemberTypes"] = project_assignment_member_types + if project_assignment_statuses is not UNSET: + field_dict["projectAssignmentStatuses"] = project_assignment_statuses + if teams is not UNSET: + field_dict["teams"] = teams + if project_states is not UNSET: + field_dict["projectStates"] = project_states + if project_assignment_allocation_statuses is not UNSET: + field_dict["projectAssignmentAllocationStatuses"] = project_assignment_allocation_statuses + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + pipelines = cast(List[int], d.pop("pipelines", UNSET)) + + project_assignment_member_types = [] + _project_assignment_member_types = d.pop("projectAssignmentMemberTypes", UNSET) + for project_assignment_member_types_item_data in _project_assignment_member_types or []: + project_assignment_member_types_item = ProjectAssignmentMemberType( + project_assignment_member_types_item_data + ) + + project_assignment_member_types.append(project_assignment_member_types_item) + + project_assignment_statuses = [] + _project_assignment_statuses = d.pop("projectAssignmentStatuses", UNSET) + for project_assignment_statuses_item_data in _project_assignment_statuses or []: + project_assignment_statuses_item = ProjectAssignmentStatus(project_assignment_statuses_item_data) + + project_assignment_statuses.append(project_assignment_statuses_item) + + teams = cast(List[int], d.pop("teams", UNSET)) + + project_states = [] + _project_states = d.pop("projectStates", UNSET) + for project_states_item_data in _project_states or []: + project_states_item = ProjectState(project_states_item_data) + + project_states.append(project_states_item) + + project_assignment_allocation_statuses = [] + _project_assignment_allocation_statuses = d.pop("projectAssignmentAllocationStatuses", UNSET) + for project_assignment_allocation_statuses_item_data in _project_assignment_allocation_statuses or []: + project_assignment_allocation_statuses_item = ProjectAssignmentAllocationStatus( + project_assignment_allocation_statuses_item_data + ) + + project_assignment_allocation_statuses.append(project_assignment_allocation_statuses_item) + + project_assignment_filter_model = cls( + pipelines=pipelines, + project_assignment_member_types=project_assignment_member_types, + project_assignment_statuses=project_assignment_statuses, + teams=teams, + project_states=project_states, + project_assignment_allocation_statuses=project_assignment_allocation_statuses, + ) + + return project_assignment_filter_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_allocation_status.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_allocation_status.py new file mode 100644 index 0000000..741a36e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_allocation_status.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class ProjectAssignmentMemberAllocationStatus(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_add_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_add_model.py new file mode 100644 index 0000000..1769ebd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_add_model.py @@ -0,0 +1,63 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.project_assignment_allocation_status import ProjectAssignmentAllocationStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentMemberEmployeeAddModel") + + +@_attrs_define +class ProjectAssignmentMemberEmployeeAddModel: + """ + Attributes: + company_user_id (int): + status (ProjectAssignmentAllocationStatus): + + Ej bokad = 0 + + Preliminär = 1 + + Tillsatt = 2 + team_id (Union[Unset, None, int]): + """ + + company_user_id: int + status: ProjectAssignmentAllocationStatus + team_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + status = self.status.value + + team_id = self.team_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "companyUserId": company_user_id, + "status": status, + } + ) + if team_id is not UNSET: + field_dict["teamId"] = team_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_id = d.pop("companyUserId") + + status = ProjectAssignmentAllocationStatus(d.pop("status")) + + team_id = d.pop("teamId", UNSET) + + project_assignment_member_employee_add_model = cls( + company_user_id=company_user_id, + status=status, + team_id=team_id, + ) + + return project_assignment_member_employee_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_edit_model.py new file mode 100644 index 0000000..de84538 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_employee_edit_model.py @@ -0,0 +1,89 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.project_assignment_allocation_status import ProjectAssignmentAllocationStatus +from ..models.project_assignment_member_state import ProjectAssignmentMemberState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentMemberEmployeeEditModel") + + +@_attrs_define +class ProjectAssignmentMemberEmployeeEditModel: + """ + Attributes: + id (int): + state (ProjectAssignmentMemberState): + + Tillagd = 0 + + Offererad = 10 + + Avböjd av kund = 20 + + Avböjd av oss = 30 + + Pausad = 40 + company_user_id (int): + status (ProjectAssignmentAllocationStatus): + + Ej bokad = 0 + + Preliminär = 1 + + Tillsatt = 2 + team_id (Union[Unset, None, int]): + """ + + id: int + state: ProjectAssignmentMemberState + company_user_id: int + status: ProjectAssignmentAllocationStatus + team_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + state = self.state.value + + company_user_id = self.company_user_id + status = self.status.value + + team_id = self.team_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "id": id, + "state": state, + "companyUserId": company_user_id, + "status": status, + } + ) + if team_id is not UNSET: + field_dict["teamId"] = team_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id") + + state = ProjectAssignmentMemberState(d.pop("state")) + + company_user_id = d.pop("companyUserId") + + status = ProjectAssignmentAllocationStatus(d.pop("status")) + + team_id = d.pop("teamId", UNSET) + + project_assignment_member_employee_edit_model = cls( + id=id, + state=state, + company_user_id=company_user_id, + status=status, + team_id=team_id, + ) + + return project_assignment_member_employee_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_model.py new file mode 100644 index 0000000..94c9ee6 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_model.py @@ -0,0 +1,199 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.company_user_status import CompanyUserStatus +from ..models.company_user_type import CompanyUserType +from ..models.project_assignment_member_state import ProjectAssignmentMemberState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectAssignmentMemberModel") + + +@_attrs_define +class ProjectAssignmentMemberModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + company_id (Union[Unset, None, int]): + id (Union[Unset, None, int]): + seo_id (Union[Unset, None, str]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + company_user_type (Union[Unset, None, CompanyUserType]): + + Medarbetare = 0 + + Kandidat = 10 + + Underkonsult = 20 + + Api = 30 + + Bot = 40 + status (Union[Unset, None, CompanyUserStatus]): + + Frånkopplad = 0 + + Kommande = 2 + + Aktiv = 3 + project_assignment_member_id (Union[Unset, int]): + project_assignment_member_state (Union[Unset, None, ProjectAssignmentMemberState]): + + Tillagd = 0 + + Offererad = 10 + + Avböjd av kund = 20 + + Avböjd av oss = 30 + + Pausad = 40 + links (Union[Unset, None, List['Link']]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, int] = UNSET + seo_id: Union[Unset, None, str] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + company_user_type: Union[Unset, None, CompanyUserType] = UNSET + status: Union[Unset, None, CompanyUserStatus] = UNSET + project_assignment_member_id: Union[Unset, int] = UNSET + project_assignment_member_state: Union[Unset, None, ProjectAssignmentMemberState] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + company_id = self.company_id + id = self.id + seo_id = self.seo_id + first_name = self.first_name + last_name = self.last_name + company_user_type: Union[Unset, None, int] = UNSET + if not isinstance(self.company_user_type, Unset): + company_user_type = self.company_user_type.value if self.company_user_type else None + + status: Union[Unset, None, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value if self.status else None + + project_assignment_member_id = self.project_assignment_member_id + project_assignment_member_state: Union[Unset, None, int] = UNSET + if not isinstance(self.project_assignment_member_state, Unset): + project_assignment_member_state = ( + self.project_assignment_member_state.value if self.project_assignment_member_state else None + ) + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if company_user_type is not UNSET: + field_dict["companyUserType"] = company_user_type + if status is not UNSET: + field_dict["status"] = status + if project_assignment_member_id is not UNSET: + field_dict["projectAssignmentMemberId"] = project_assignment_member_id + if project_assignment_member_state is not UNSET: + field_dict["projectAssignmentMemberState"] = project_assignment_member_state + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + seo_id = d.pop("seoId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _company_user_type = d.pop("companyUserType", UNSET) + company_user_type: Union[Unset, None, CompanyUserType] + if _company_user_type is None: + company_user_type = None + elif isinstance(_company_user_type, Unset): + company_user_type = UNSET + else: + company_user_type = CompanyUserType(_company_user_type) + + _status = d.pop("status", UNSET) + status: Union[Unset, None, CompanyUserStatus] + if _status is None: + status = None + elif isinstance(_status, Unset): + status = UNSET + else: + status = CompanyUserStatus(_status) + + project_assignment_member_id = d.pop("projectAssignmentMemberId", UNSET) + + _project_assignment_member_state = d.pop("projectAssignmentMemberState", UNSET) + project_assignment_member_state: Union[Unset, None, ProjectAssignmentMemberState] + if _project_assignment_member_state is None: + project_assignment_member_state = None + elif isinstance(_project_assignment_member_state, Unset): + project_assignment_member_state = UNSET + else: + project_assignment_member_state = ProjectAssignmentMemberState(_project_assignment_member_state) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_assignment_member_model = cls( + company_user_id=company_user_id, + company_id=company_id, + id=id, + seo_id=seo_id, + first_name=first_name, + last_name=last_name, + company_user_type=company_user_type, + status=status, + project_assignment_member_id=project_assignment_member_id, + project_assignment_member_state=project_assignment_member_state, + links=links, + ) + + return project_assignment_member_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_state.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_state.py new file mode 100644 index 0000000..0c40ef1 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_state.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class ProjectAssignmentMemberState(IntEnum): + VALUE_0 = 0 + VALUE_10 = 10 + VALUE_20 = 20 + VALUE_30 = 30 + VALUE_40 = 40 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_state_history_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_state_history_model.py new file mode 100644 index 0000000..9794c83 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_state_history_model.py @@ -0,0 +1,65 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.project_assignment_member_state import ProjectAssignmentMemberState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentMemberStateHistoryModel") + + +@_attrs_define +class ProjectAssignmentMemberStateHistoryModel: + """ + Attributes: + state (Union[Unset, ProjectAssignmentMemberState]): + + Tillagd = 0 + + Offererad = 10 + + Avböjd av kund = 20 + + Avböjd av oss = 30 + + Pausad = 40 + note (Union[Unset, None, str]): + """ + + state: Union[Unset, ProjectAssignmentMemberState] = UNSET + note: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + state: Union[Unset, int] = UNSET + if not isinstance(self.state, Unset): + state = self.state.value + + note = self.note + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if state is not UNSET: + field_dict["state"] = state + if note is not UNSET: + field_dict["note"] = note + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _state = d.pop("state", UNSET) + state: Union[Unset, ProjectAssignmentMemberState] + if isinstance(_state, Unset): + state = UNSET + else: + state = ProjectAssignmentMemberState(_state) + + note = d.pop("note", UNSET) + + project_assignment_member_state_history_model = cls( + state=state, + note=note, + ) + + return project_assignment_member_state_history_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_add_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_add_model.py new file mode 100644 index 0000000..fff5960 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_add_model.py @@ -0,0 +1,79 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.project_assignment_allocation_status import ProjectAssignmentAllocationStatus +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentMemberSubcontractorAddModel") + + +@_attrs_define +class ProjectAssignmentMemberSubcontractorAddModel: + """ + Attributes: + company_user_id (int): + status (ProjectAssignmentAllocationStatus): + + Ej bokad = 0 + + Preliminär = 1 + + Tillsatt = 2 + group_id (Union[Unset, None, int]): + currency_id (Union[Unset, None, int]): + tariff (Union[Unset, None, float]): + """ + + company_user_id: int + status: ProjectAssignmentAllocationStatus + group_id: Union[Unset, None, int] = UNSET + currency_id: Union[Unset, None, int] = UNSET + tariff: Union[Unset, None, float] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + status = self.status.value + + group_id = self.group_id + currency_id = self.currency_id + tariff = self.tariff + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "companyUserId": company_user_id, + "status": status, + } + ) + if group_id is not UNSET: + field_dict["groupId"] = group_id + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if tariff is not UNSET: + field_dict["tariff"] = tariff + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_id = d.pop("companyUserId") + + status = ProjectAssignmentAllocationStatus(d.pop("status")) + + group_id = d.pop("groupId", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + tariff = d.pop("tariff", UNSET) + + project_assignment_member_subcontractor_add_model = cls( + company_user_id=company_user_id, + status=status, + group_id=group_id, + currency_id=currency_id, + tariff=tariff, + ) + + return project_assignment_member_subcontractor_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_edit_model.py new file mode 100644 index 0000000..a8ecf2e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_subcontractor_edit_model.py @@ -0,0 +1,105 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.project_assignment_allocation_status import ProjectAssignmentAllocationStatus +from ..models.project_assignment_member_state import ProjectAssignmentMemberState +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentMemberSubcontractorEditModel") + + +@_attrs_define +class ProjectAssignmentMemberSubcontractorEditModel: + """ + Attributes: + id (int): + state (ProjectAssignmentMemberState): + + Tillagd = 0 + + Offererad = 10 + + Avböjd av kund = 20 + + Avböjd av oss = 30 + + Pausad = 40 + company_user_id (int): + status (ProjectAssignmentAllocationStatus): + + Ej bokad = 0 + + Preliminär = 1 + + Tillsatt = 2 + group_id (Union[Unset, None, int]): + currency_id (Union[Unset, None, int]): + tariff (Union[Unset, None, float]): + """ + + id: int + state: ProjectAssignmentMemberState + company_user_id: int + status: ProjectAssignmentAllocationStatus + group_id: Union[Unset, None, int] = UNSET + currency_id: Union[Unset, None, int] = UNSET + tariff: Union[Unset, None, float] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + state = self.state.value + + company_user_id = self.company_user_id + status = self.status.value + + group_id = self.group_id + currency_id = self.currency_id + tariff = self.tariff + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "id": id, + "state": state, + "companyUserId": company_user_id, + "status": status, + } + ) + if group_id is not UNSET: + field_dict["groupId"] = group_id + if currency_id is not UNSET: + field_dict["currencyId"] = currency_id + if tariff is not UNSET: + field_dict["tariff"] = tariff + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id") + + state = ProjectAssignmentMemberState(d.pop("state")) + + company_user_id = d.pop("companyUserId") + + status = ProjectAssignmentAllocationStatus(d.pop("status")) + + group_id = d.pop("groupId", UNSET) + + currency_id = d.pop("currencyId", UNSET) + + tariff = d.pop("tariff", UNSET) + + project_assignment_member_subcontractor_edit_model = cls( + id=id, + state=state, + company_user_id=company_user_id, + status=status, + group_id=group_id, + currency_id=currency_id, + tariff=tariff, + ) + + return project_assignment_member_subcontractor_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_member_type.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_type.py new file mode 100644 index 0000000..822b394 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_member_type.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class ProjectAssignmentMemberType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_model.py new file mode 100644 index 0000000..b6eb169 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_model.py @@ -0,0 +1,410 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.contract_type import ContractType +from ..models.extent_type import ExtentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_base_model import CompanyBaseModel + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.project_assignment_member_model import ProjectAssignmentMemberModel + from ..models.project_assignment_skill_base_model import ProjectAssignmentSkillBaseModel + from ..models.project_base_model import ProjectBaseModel + + +T = TypeVar("T", bound="ProjectAssignmentModel") + + +@_attrs_define +class ProjectAssignmentModel: + """ + Attributes: + company (Union[Unset, None, CompanyBaseModel]): + assigned (Union[Unset, None, ProjectAssignmentMemberModel]): + prospects (Union[Unset, None, List['ProjectAssignmentMemberModel']]): + seo_id (Union[Unset, None, str]): + skills (Union[Unset, None, List['ProjectAssignmentSkillBaseModel']]): + project_assignment_member_id (Union[Unset, None, int]): + rate (Union[Unset, None, int]): + oral_agreement_to_date (Union[Unset, None, datetime.datetime]): + option_to_date (Union[Unset, None, datetime.datetime]): + contract_type (Union[Unset, ContractType]): + + Timpris = 0 + + Fastpris = 1 + is_assigned (Union[Unset, bool]): + currency (Union[Unset, None, CurrencyModel]): + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + project_id (Union[Unset, int]): + project (Union[Unset, None, ProjectBaseModel]): + customer (Union[Unset, None, CompanyCustomerBaseModel]): + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + extent_type (Union[Unset, ExtentType]): + + Procent = 0 + + Timmar = 1 + extent (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + company: Union[Unset, None, "CompanyBaseModel"] = UNSET + assigned: Union[Unset, None, "ProjectAssignmentMemberModel"] = UNSET + prospects: Union[Unset, None, List["ProjectAssignmentMemberModel"]] = UNSET + seo_id: Union[Unset, None, str] = UNSET + skills: Union[Unset, None, List["ProjectAssignmentSkillBaseModel"]] = UNSET + project_assignment_member_id: Union[Unset, None, int] = UNSET + rate: Union[Unset, None, int] = UNSET + oral_agreement_to_date: Union[Unset, None, datetime.datetime] = UNSET + option_to_date: Union[Unset, None, datetime.datetime] = UNSET + contract_type: Union[Unset, ContractType] = UNSET + is_assigned: Union[Unset, bool] = UNSET + currency: Union[Unset, None, "CurrencyModel"] = UNSET + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, int] = UNSET + project: Union[Unset, None, "ProjectBaseModel"] = UNSET + customer: Union[Unset, None, "CompanyCustomerBaseModel"] = UNSET + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + extent_type: Union[Unset, ExtentType] = UNSET + extent: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company, Unset): + company = self.company.to_dict() if self.company else None + + assigned: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.assigned, Unset): + assigned = self.assigned.to_dict() if self.assigned else None + + prospects: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.prospects, Unset): + if self.prospects is None: + prospects = None + else: + prospects = [] + for prospects_item_data in self.prospects: + prospects_item = prospects_item_data.to_dict() + + prospects.append(prospects_item) + + seo_id = self.seo_id + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + project_assignment_member_id = self.project_assignment_member_id + rate = self.rate + oral_agreement_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.oral_agreement_to_date, Unset): + oral_agreement_to_date = self.oral_agreement_to_date.isoformat() if self.oral_agreement_to_date else None + + option_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.option_to_date, Unset): + option_to_date = self.option_to_date.isoformat() if self.option_to_date else None + + contract_type: Union[Unset, int] = UNSET + if not isinstance(self.contract_type, Unset): + contract_type = self.contract_type.value + + is_assigned = self.is_assigned + currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.to_dict() if self.currency else None + + company_id = self.company_id + customer_id = self.customer_id + project_id = self.project_id + project: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.project, Unset): + project = self.project.to_dict() if self.project else None + + customer: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.customer, Unset): + customer = self.customer.to_dict() if self.customer else None + + id = self.id + title = self.title + description = self.description + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + extent_type: Union[Unset, int] = UNSET + if not isinstance(self.extent_type, Unset): + extent_type = self.extent_type.value + + extent = self.extent + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company is not UNSET: + field_dict["company"] = company + if assigned is not UNSET: + field_dict["assigned"] = assigned + if prospects is not UNSET: + field_dict["prospects"] = prospects + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if skills is not UNSET: + field_dict["skills"] = skills + if project_assignment_member_id is not UNSET: + field_dict["projectAssignmentMemberId"] = project_assignment_member_id + if rate is not UNSET: + field_dict["rate"] = rate + if oral_agreement_to_date is not UNSET: + field_dict["oralAgreementToDate"] = oral_agreement_to_date + if option_to_date is not UNSET: + field_dict["optionToDate"] = option_to_date + if contract_type is not UNSET: + field_dict["contractType"] = contract_type + if is_assigned is not UNSET: + field_dict["isAssigned"] = is_assigned + if currency is not UNSET: + field_dict["currency"] = currency + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if project is not UNSET: + field_dict["project"] = project + if customer is not UNSET: + field_dict["customer"] = customer + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if extent_type is not UNSET: + field_dict["extentType"] = extent_type + if extent is not UNSET: + field_dict["extent"] = extent + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_base_model import CompanyBaseModel + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.project_assignment_member_model import ProjectAssignmentMemberModel + from ..models.project_assignment_skill_base_model import ProjectAssignmentSkillBaseModel + from ..models.project_base_model import ProjectBaseModel + + d = src_dict.copy() + _company = d.pop("company", UNSET) + company: Union[Unset, None, CompanyBaseModel] + if _company is None: + company = None + elif isinstance(_company, Unset): + company = UNSET + else: + company = CompanyBaseModel.from_dict(_company) + + _assigned = d.pop("assigned", UNSET) + assigned: Union[Unset, None, ProjectAssignmentMemberModel] + if _assigned is None: + assigned = None + elif isinstance(_assigned, Unset): + assigned = UNSET + else: + assigned = ProjectAssignmentMemberModel.from_dict(_assigned) + + prospects = [] + _prospects = d.pop("prospects", UNSET) + for prospects_item_data in _prospects or []: + prospects_item = ProjectAssignmentMemberModel.from_dict(prospects_item_data) + + prospects.append(prospects_item) + + seo_id = d.pop("seoId", UNSET) + + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = ProjectAssignmentSkillBaseModel.from_dict(skills_item_data) + + skills.append(skills_item) + + project_assignment_member_id = d.pop("projectAssignmentMemberId", UNSET) + + rate = d.pop("rate", UNSET) + + _oral_agreement_to_date = d.pop("oralAgreementToDate", UNSET) + oral_agreement_to_date: Union[Unset, None, datetime.datetime] + if _oral_agreement_to_date is None: + oral_agreement_to_date = None + elif isinstance(_oral_agreement_to_date, Unset): + oral_agreement_to_date = UNSET + else: + oral_agreement_to_date = isoparse(_oral_agreement_to_date) + + _option_to_date = d.pop("optionToDate", UNSET) + option_to_date: Union[Unset, None, datetime.datetime] + if _option_to_date is None: + option_to_date = None + elif isinstance(_option_to_date, Unset): + option_to_date = UNSET + else: + option_to_date = isoparse(_option_to_date) + + _contract_type = d.pop("contractType", UNSET) + contract_type: Union[Unset, ContractType] + if isinstance(_contract_type, Unset): + contract_type = UNSET + else: + contract_type = ContractType(_contract_type) + + is_assigned = d.pop("isAssigned", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Union[Unset, None, CurrencyModel] + if _currency is None: + currency = None + elif isinstance(_currency, Unset): + currency = UNSET + else: + currency = CurrencyModel.from_dict(_currency) + + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + _project = d.pop("project", UNSET) + project: Union[Unset, None, ProjectBaseModel] + if _project is None: + project = None + elif isinstance(_project, Unset): + project = UNSET + else: + project = ProjectBaseModel.from_dict(_project) + + _customer = d.pop("customer", UNSET) + customer: Union[Unset, None, CompanyCustomerBaseModel] + if _customer is None: + customer = None + elif isinstance(_customer, Unset): + customer = UNSET + else: + customer = CompanyCustomerBaseModel.from_dict(_customer) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + _extent_type = d.pop("extentType", UNSET) + extent_type: Union[Unset, ExtentType] + if isinstance(_extent_type, Unset): + extent_type = UNSET + else: + extent_type = ExtentType(_extent_type) + + extent = d.pop("extent", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_assignment_model = cls( + company=company, + assigned=assigned, + prospects=prospects, + seo_id=seo_id, + skills=skills, + project_assignment_member_id=project_assignment_member_id, + rate=rate, + oral_agreement_to_date=oral_agreement_to_date, + option_to_date=option_to_date, + contract_type=contract_type, + is_assigned=is_assigned, + currency=currency, + company_id=company_id, + customer_id=customer_id, + project_id=project_id, + project=project, + customer=customer, + id=id, + title=title, + description=description, + start_date=start_date, + end_date=end_date, + extent_type=extent_type, + extent=extent, + links=links, + ) + + return project_assignment_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_request_status.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_request_status.py new file mode 100644 index 0000000..6cb6b2a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_request_status.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class ProjectAssignmentRequestStatus(IntEnum): + VALUE_0 = 0 + VALUE_10 = 10 + VALUE_20 = 20 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_add_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_add_model.py new file mode 100644 index 0000000..e787f6c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_add_model.py @@ -0,0 +1,64 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentSkillAddModel") + + +@_attrs_define +class ProjectAssignmentSkillAddModel: + """ + Attributes: + name (str): + keyword_synonym_id (Union[Unset, None, int]): + level (Union[Unset, None, int]): + is_mandatory (Union[Unset, None, bool]): + """ + + name: str + keyword_synonym_id: Union[Unset, None, int] = UNSET + level: Union[Unset, None, int] = UNSET + is_mandatory: Union[Unset, None, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + keyword_synonym_id = self.keyword_synonym_id + level = self.level + is_mandatory = self.is_mandatory + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "name": name, + } + ) + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if level is not UNSET: + field_dict["level"] = level + if is_mandatory is not UNSET: + field_dict["isMandatory"] = is_mandatory + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name") + + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + level = d.pop("level", UNSET) + + is_mandatory = d.pop("isMandatory", UNSET) + + project_assignment_skill_add_model = cls( + name=name, + keyword_synonym_id=keyword_synonym_id, + level=level, + is_mandatory=is_mandatory, + ) + + return project_assignment_skill_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_base_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_base_model.py new file mode 100644 index 0000000..479c56f --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_base_model.py @@ -0,0 +1,126 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.keyword_model import KeywordModel + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectAssignmentSkillBaseModel") + + +@_attrs_define +class ProjectAssignmentSkillBaseModel: + """ + Attributes: + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + project_id (Union[Unset, int]): + project_assignment_id (Union[Unset, int]): + keyword_id (Union[Unset, int]): + level (Union[Unset, int]): + keyword (Union[Unset, None, KeywordModel]): + links (Union[Unset, None, List['Link']]): + """ + + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, int] = UNSET + project_assignment_id: Union[Unset, int] = UNSET + keyword_id: Union[Unset, int] = UNSET + level: Union[Unset, int] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + customer_id = self.customer_id + project_id = self.project_id + project_assignment_id = self.project_assignment_id + keyword_id = self.keyword_id + level = self.level + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if project_assignment_id is not UNSET: + field_dict["projectAssignmentId"] = project_assignment_id + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if level is not UNSET: + field_dict["level"] = level + if keyword is not UNSET: + field_dict["keyword"] = keyword + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.keyword_model import KeywordModel + from ..models.link import Link + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + project_assignment_id = d.pop("projectAssignmentId", UNSET) + + keyword_id = d.pop("keywordId", UNSET) + + level = d.pop("level", UNSET) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_assignment_skill_base_model = cls( + company_id=company_id, + customer_id=customer_id, + project_id=project_id, + project_assignment_id=project_assignment_id, + keyword_id=keyword_id, + level=level, + keyword=keyword, + links=links, + ) + + return project_assignment_skill_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_edit_model.py new file mode 100644 index 0000000..97d9079 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_edit_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectAssignmentSkillEditModel") + + +@_attrs_define +class ProjectAssignmentSkillEditModel: + """ + Attributes: + name (Union[Unset, None, str]): + level (Union[Unset, None, int]): + is_mandatory (Union[Unset, None, bool]): + """ + + name: Union[Unset, None, str] = UNSET + level: Union[Unset, None, int] = UNSET + is_mandatory: Union[Unset, None, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + level = self.level + is_mandatory = self.is_mandatory + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if level is not UNSET: + field_dict["level"] = level + if is_mandatory is not UNSET: + field_dict["isMandatory"] = is_mandatory + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name", UNSET) + + level = d.pop("level", UNSET) + + is_mandatory = d.pop("isMandatory", UNSET) + + project_assignment_skill_edit_model = cls( + name=name, + level=level, + is_mandatory=is_mandatory, + ) + + return project_assignment_skill_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_model.py new file mode 100644 index 0000000..a89d59c --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_skill_model.py @@ -0,0 +1,242 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_base_model import CompanyBaseModel + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.keyword_model import KeywordModel + from ..models.keyword_synonym_model import KeywordSynonymModel + from ..models.link import Link + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + from ..models.project_base_model import ProjectBaseModel + + +T = TypeVar("T", bound="ProjectAssignmentSkillModel") + + +@_attrs_define +class ProjectAssignmentSkillModel: + """ + Attributes: + project_assignment (Union[Unset, None, ProjectAssignmentBaseModel]): + project (Union[Unset, None, ProjectBaseModel]): + company (Union[Unset, None, CompanyBaseModel]): + customer (Union[Unset, None, CompanyCustomerBaseModel]): + keyword_synonym_id (Union[Unset, int]): + keyword_synonym (Union[Unset, None, KeywordSynonymModel]): + is_mandatory (Union[Unset, bool]): + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + project_id (Union[Unset, int]): + project_assignment_id (Union[Unset, int]): + keyword_id (Union[Unset, int]): + level (Union[Unset, int]): + keyword (Union[Unset, None, KeywordModel]): + links (Union[Unset, None, List['Link']]): + """ + + project_assignment: Union[Unset, None, "ProjectAssignmentBaseModel"] = UNSET + project: Union[Unset, None, "ProjectBaseModel"] = UNSET + company: Union[Unset, None, "CompanyBaseModel"] = UNSET + customer: Union[Unset, None, "CompanyCustomerBaseModel"] = UNSET + keyword_synonym_id: Union[Unset, int] = UNSET + keyword_synonym: Union[Unset, None, "KeywordSynonymModel"] = UNSET + is_mandatory: Union[Unset, bool] = UNSET + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, int] = UNSET + project_assignment_id: Union[Unset, int] = UNSET + keyword_id: Union[Unset, int] = UNSET + level: Union[Unset, int] = UNSET + keyword: Union[Unset, None, "KeywordModel"] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + project_assignment: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.project_assignment, Unset): + project_assignment = self.project_assignment.to_dict() if self.project_assignment else None + + project: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.project, Unset): + project = self.project.to_dict() if self.project else None + + company: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company, Unset): + company = self.company.to_dict() if self.company else None + + customer: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.customer, Unset): + customer = self.customer.to_dict() if self.customer else None + + keyword_synonym_id = self.keyword_synonym_id + keyword_synonym: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword_synonym, Unset): + keyword_synonym = self.keyword_synonym.to_dict() if self.keyword_synonym else None + + is_mandatory = self.is_mandatory + company_id = self.company_id + customer_id = self.customer_id + project_id = self.project_id + project_assignment_id = self.project_assignment_id + keyword_id = self.keyword_id + level = self.level + keyword: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.keyword, Unset): + keyword = self.keyword.to_dict() if self.keyword else None + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if project_assignment is not UNSET: + field_dict["projectAssignment"] = project_assignment + if project is not UNSET: + field_dict["project"] = project + if company is not UNSET: + field_dict["company"] = company + if customer is not UNSET: + field_dict["customer"] = customer + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if keyword_synonym is not UNSET: + field_dict["keywordSynonym"] = keyword_synonym + if is_mandatory is not UNSET: + field_dict["isMandatory"] = is_mandatory + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if project_assignment_id is not UNSET: + field_dict["projectAssignmentId"] = project_assignment_id + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if level is not UNSET: + field_dict["level"] = level + if keyword is not UNSET: + field_dict["keyword"] = keyword + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_base_model import CompanyBaseModel + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.keyword_model import KeywordModel + from ..models.keyword_synonym_model import KeywordSynonymModel + from ..models.link import Link + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + from ..models.project_base_model import ProjectBaseModel + + d = src_dict.copy() + _project_assignment = d.pop("projectAssignment", UNSET) + project_assignment: Union[Unset, None, ProjectAssignmentBaseModel] + if _project_assignment is None: + project_assignment = None + elif isinstance(_project_assignment, Unset): + project_assignment = UNSET + else: + project_assignment = ProjectAssignmentBaseModel.from_dict(_project_assignment) + + _project = d.pop("project", UNSET) + project: Union[Unset, None, ProjectBaseModel] + if _project is None: + project = None + elif isinstance(_project, Unset): + project = UNSET + else: + project = ProjectBaseModel.from_dict(_project) + + _company = d.pop("company", UNSET) + company: Union[Unset, None, CompanyBaseModel] + if _company is None: + company = None + elif isinstance(_company, Unset): + company = UNSET + else: + company = CompanyBaseModel.from_dict(_company) + + _customer = d.pop("customer", UNSET) + customer: Union[Unset, None, CompanyCustomerBaseModel] + if _customer is None: + customer = None + elif isinstance(_customer, Unset): + customer = UNSET + else: + customer = CompanyCustomerBaseModel.from_dict(_customer) + + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + _keyword_synonym = d.pop("keywordSynonym", UNSET) + keyword_synonym: Union[Unset, None, KeywordSynonymModel] + if _keyword_synonym is None: + keyword_synonym = None + elif isinstance(_keyword_synonym, Unset): + keyword_synonym = UNSET + else: + keyword_synonym = KeywordSynonymModel.from_dict(_keyword_synonym) + + is_mandatory = d.pop("isMandatory", UNSET) + + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + project_assignment_id = d.pop("projectAssignmentId", UNSET) + + keyword_id = d.pop("keywordId", UNSET) + + level = d.pop("level", UNSET) + + _keyword = d.pop("keyword", UNSET) + keyword: Union[Unset, None, KeywordModel] + if _keyword is None: + keyword = None + elif isinstance(_keyword, Unset): + keyword = UNSET + else: + keyword = KeywordModel.from_dict(_keyword) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_assignment_skill_model = cls( + project_assignment=project_assignment, + project=project, + company=company, + customer=customer, + keyword_synonym_id=keyword_synonym_id, + keyword_synonym=keyword_synonym, + is_mandatory=is_mandatory, + company_id=company_id, + customer_id=customer_id, + project_id=project_id, + project_assignment_id=project_assignment_id, + keyword_id=keyword_id, + level=level, + keyword=keyword, + links=links, + ) + + return project_assignment_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_status.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_status.py new file mode 100644 index 0000000..c840ae3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_status.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class ProjectAssignmentStatus(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_assignment_with_status_model.py b/src/cinode-py-client/cinode_api_client/models/project_assignment_with_status_model.py new file mode 100644 index 0000000..890603e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_assignment_with_status_model.py @@ -0,0 +1,312 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.project_assignment_extent_type import ProjectAssignmentExtentType +from ..models.project_assignment_member_allocation_status import ProjectAssignmentMemberAllocationStatus +from ..models.project_assignment_member_type import ProjectAssignmentMemberType +from ..models.project_state import ProjectState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.project_assignment_member_model import ProjectAssignmentMemberModel + + +T = TypeVar("T", bound="ProjectAssignmentWithStatusModel") + + +@_attrs_define +class ProjectAssignmentWithStatusModel: + """ + Attributes: + pipeline_id (Union[Unset, None, int]): + project_pipeline_stage_title (Union[Unset, None, str]): + customer_id (Union[Unset, int]): + project_id (Union[Unset, int]): + project_state (Union[Unset, ProjectState]): + + Öppen = 0 + + Vunnen = 30 + + Förlorad = 40 + + Avböjd = 50 + + Uppskjuten = 60 + probability (Union[Unset, int]): + project_assignment_id (Union[Unset, int]): Unspecified = 0, + Coming = 1, + Ongoing = 2, + Ended = 3 + project_assignment_allocation_status (Union[Unset, ProjectAssignmentMemberAllocationStatus]): + + None = 0 + + Preliminär = 1 + + Tillsatt = 2 + + Offererad = 3 + project_assignment_member_type (Union[Unset, ProjectAssignmentMemberType]): + + Unspecified = 0 + + Medarbetare = 1 + + Partnerkonsult = 2 + + Underkonsult = 3 + start_date (Union[Unset, None, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + option_to_date (Union[Unset, None, datetime.datetime]): + oral_agreement_to_date (Union[Unset, None, datetime.datetime]): + project_assignment_extent (Union[Unset, int]): + project_assignment_extent_type (Union[Unset, ProjectAssignmentExtentType]): + + Procent = 0 + + Timmar = 1 + rate (Union[Unset, None, int]): + estimated_close_date (Union[Unset, None, datetime.datetime]): + assigned (Union[Unset, None, ProjectAssignmentMemberModel]): + """ + + pipeline_id: Union[Unset, None, int] = UNSET + project_pipeline_stage_title: Union[Unset, None, str] = UNSET + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, int] = UNSET + project_state: Union[Unset, ProjectState] = UNSET + probability: Union[Unset, int] = UNSET + project_assignment_id: Union[Unset, int] = UNSET + project_assignment_allocation_status: Union[Unset, ProjectAssignmentMemberAllocationStatus] = UNSET + project_assignment_member_type: Union[Unset, ProjectAssignmentMemberType] = UNSET + start_date: Union[Unset, None, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + option_to_date: Union[Unset, None, datetime.datetime] = UNSET + oral_agreement_to_date: Union[Unset, None, datetime.datetime] = UNSET + project_assignment_extent: Union[Unset, int] = UNSET + project_assignment_extent_type: Union[Unset, ProjectAssignmentExtentType] = UNSET + rate: Union[Unset, None, int] = UNSET + estimated_close_date: Union[Unset, None, datetime.datetime] = UNSET + assigned: Union[Unset, None, "ProjectAssignmentMemberModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + pipeline_id = self.pipeline_id + project_pipeline_stage_title = self.project_pipeline_stage_title + customer_id = self.customer_id + project_id = self.project_id + project_state: Union[Unset, int] = UNSET + if not isinstance(self.project_state, Unset): + project_state = self.project_state.value + + probability = self.probability + project_assignment_id = self.project_assignment_id + project_assignment_allocation_status: Union[Unset, int] = UNSET + if not isinstance(self.project_assignment_allocation_status, Unset): + project_assignment_allocation_status = self.project_assignment_allocation_status.value + + project_assignment_member_type: Union[Unset, int] = UNSET + if not isinstance(self.project_assignment_member_type, Unset): + project_assignment_member_type = self.project_assignment_member_type.value + + start_date: Union[Unset, None, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() if self.start_date else None + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + option_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.option_to_date, Unset): + option_to_date = self.option_to_date.isoformat() if self.option_to_date else None + + oral_agreement_to_date: Union[Unset, None, str] = UNSET + if not isinstance(self.oral_agreement_to_date, Unset): + oral_agreement_to_date = self.oral_agreement_to_date.isoformat() if self.oral_agreement_to_date else None + + project_assignment_extent = self.project_assignment_extent + project_assignment_extent_type: Union[Unset, int] = UNSET + if not isinstance(self.project_assignment_extent_type, Unset): + project_assignment_extent_type = self.project_assignment_extent_type.value + + rate = self.rate + estimated_close_date: Union[Unset, None, str] = UNSET + if not isinstance(self.estimated_close_date, Unset): + estimated_close_date = self.estimated_close_date.isoformat() if self.estimated_close_date else None + + assigned: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.assigned, Unset): + assigned = self.assigned.to_dict() if self.assigned else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if pipeline_id is not UNSET: + field_dict["pipelineId"] = pipeline_id + if project_pipeline_stage_title is not UNSET: + field_dict["projectPipelineStageTitle"] = project_pipeline_stage_title + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if project_state is not UNSET: + field_dict["projectState"] = project_state + if probability is not UNSET: + field_dict["probability"] = probability + if project_assignment_id is not UNSET: + field_dict["projectAssignmentId"] = project_assignment_id + if project_assignment_allocation_status is not UNSET: + field_dict["projectAssignmentAllocationStatus"] = project_assignment_allocation_status + if project_assignment_member_type is not UNSET: + field_dict["projectAssignmentMemberType"] = project_assignment_member_type + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if option_to_date is not UNSET: + field_dict["optionToDate"] = option_to_date + if oral_agreement_to_date is not UNSET: + field_dict["oralAgreementToDate"] = oral_agreement_to_date + if project_assignment_extent is not UNSET: + field_dict["projectAssignmentExtent"] = project_assignment_extent + if project_assignment_extent_type is not UNSET: + field_dict["projectAssignmentExtentType"] = project_assignment_extent_type + if rate is not UNSET: + field_dict["rate"] = rate + if estimated_close_date is not UNSET: + field_dict["estimatedCloseDate"] = estimated_close_date + if assigned is not UNSET: + field_dict["assigned"] = assigned + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.project_assignment_member_model import ProjectAssignmentMemberModel + + d = src_dict.copy() + pipeline_id = d.pop("pipelineId", UNSET) + + project_pipeline_stage_title = d.pop("projectPipelineStageTitle", UNSET) + + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + _project_state = d.pop("projectState", UNSET) + project_state: Union[Unset, ProjectState] + if isinstance(_project_state, Unset): + project_state = UNSET + else: + project_state = ProjectState(_project_state) + + probability = d.pop("probability", UNSET) + + project_assignment_id = d.pop("projectAssignmentId", UNSET) + + _project_assignment_allocation_status = d.pop("projectAssignmentAllocationStatus", UNSET) + project_assignment_allocation_status: Union[Unset, ProjectAssignmentMemberAllocationStatus] + if isinstance(_project_assignment_allocation_status, Unset): + project_assignment_allocation_status = UNSET + else: + project_assignment_allocation_status = ProjectAssignmentMemberAllocationStatus( + _project_assignment_allocation_status + ) + + _project_assignment_member_type = d.pop("projectAssignmentMemberType", UNSET) + project_assignment_member_type: Union[Unset, ProjectAssignmentMemberType] + if isinstance(_project_assignment_member_type, Unset): + project_assignment_member_type = UNSET + else: + project_assignment_member_type = ProjectAssignmentMemberType(_project_assignment_member_type) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, None, datetime.datetime] + if _start_date is None: + start_date = None + elif isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + _option_to_date = d.pop("optionToDate", UNSET) + option_to_date: Union[Unset, None, datetime.datetime] + if _option_to_date is None: + option_to_date = None + elif isinstance(_option_to_date, Unset): + option_to_date = UNSET + else: + option_to_date = isoparse(_option_to_date) + + _oral_agreement_to_date = d.pop("oralAgreementToDate", UNSET) + oral_agreement_to_date: Union[Unset, None, datetime.datetime] + if _oral_agreement_to_date is None: + oral_agreement_to_date = None + elif isinstance(_oral_agreement_to_date, Unset): + oral_agreement_to_date = UNSET + else: + oral_agreement_to_date = isoparse(_oral_agreement_to_date) + + project_assignment_extent = d.pop("projectAssignmentExtent", UNSET) + + _project_assignment_extent_type = d.pop("projectAssignmentExtentType", UNSET) + project_assignment_extent_type: Union[Unset, ProjectAssignmentExtentType] + if isinstance(_project_assignment_extent_type, Unset): + project_assignment_extent_type = UNSET + else: + project_assignment_extent_type = ProjectAssignmentExtentType(_project_assignment_extent_type) + + rate = d.pop("rate", UNSET) + + _estimated_close_date = d.pop("estimatedCloseDate", UNSET) + estimated_close_date: Union[Unset, None, datetime.datetime] + if _estimated_close_date is None: + estimated_close_date = None + elif isinstance(_estimated_close_date, Unset): + estimated_close_date = UNSET + else: + estimated_close_date = isoparse(_estimated_close_date) + + _assigned = d.pop("assigned", UNSET) + assigned: Union[Unset, None, ProjectAssignmentMemberModel] + if _assigned is None: + assigned = None + elif isinstance(_assigned, Unset): + assigned = UNSET + else: + assigned = ProjectAssignmentMemberModel.from_dict(_assigned) + + project_assignment_with_status_model = cls( + pipeline_id=pipeline_id, + project_pipeline_stage_title=project_pipeline_stage_title, + customer_id=customer_id, + project_id=project_id, + project_state=project_state, + probability=probability, + project_assignment_id=project_assignment_id, + project_assignment_allocation_status=project_assignment_allocation_status, + project_assignment_member_type=project_assignment_member_type, + start_date=start_date, + end_date=end_date, + option_to_date=option_to_date, + oral_agreement_to_date=oral_agreement_to_date, + project_assignment_extent=project_assignment_extent, + project_assignment_extent_type=project_assignment_extent_type, + rate=rate, + estimated_close_date=estimated_close_date, + assigned=assigned, + ) + + return project_assignment_with_status_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_attachment_model.py b/src/cinode-py-client/cinode_api_client/models/project_attachment_model.py new file mode 100644 index 0000000..602aebb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_attachment_model.py @@ -0,0 +1,119 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.attachment_type import AttachmentType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectAttachmentModel") + + +@_attrs_define +class ProjectAttachmentModel: + """ + Attributes: + project_id (Union[Unset, int]): + attachment_type (Union[Unset, AttachmentType]): + + File = 0 + + Uri = 1 + company_id (Union[Unset, None, int]): + id (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + project_id: Union[Unset, int] = UNSET + attachment_type: Union[Unset, AttachmentType] = UNSET + company_id: Union[Unset, None, int] = UNSET + id: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + project_id = self.project_id + attachment_type: Union[Unset, int] = UNSET + if not isinstance(self.attachment_type, Unset): + attachment_type = self.attachment_type.value + + company_id = self.company_id + id = self.id + title = self.title + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if project_id is not UNSET: + field_dict["projectId"] = project_id + if attachment_type is not UNSET: + field_dict["attachmentType"] = attachment_type + if company_id is not UNSET: + field_dict["companyId"] = company_id + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + project_id = d.pop("projectId", UNSET) + + _attachment_type = d.pop("attachmentType", UNSET) + attachment_type: Union[Unset, AttachmentType] + if isinstance(_attachment_type, Unset): + attachment_type = UNSET + else: + attachment_type = AttachmentType(_attachment_type) + + company_id = d.pop("companyId", UNSET) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_attachment_model = cls( + project_id=project_id, + attachment_type=attachment_type, + company_id=company_id, + id=id, + title=title, + description=description, + links=links, + ) + + return project_attachment_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_base_model.py b/src/cinode-py-client/cinode_api_client/models/project_base_model.py new file mode 100644 index 0000000..fdd21fe --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_base_model.py @@ -0,0 +1,114 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectBaseModel") + + +@_attrs_define +class ProjectBaseModel: + """ + Attributes: + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + identifier (Union[Unset, None, str]): + customer_identifier (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + identifier: Union[Unset, None, str] = UNSET + customer_identifier: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + customer_id = self.customer_id + id = self.id + title = self.title + description = self.description + identifier = self.identifier + customer_identifier = self.customer_identifier + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if identifier is not UNSET: + field_dict["identifier"] = identifier + if customer_identifier is not UNSET: + field_dict["customerIdentifier"] = customer_identifier + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + identifier = d.pop("identifier", UNSET) + + customer_identifier = d.pop("customerIdentifier", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_base_model = cls( + company_id=company_id, + customer_id=customer_id, + id=id, + title=title, + description=description, + identifier=identifier, + customer_identifier=customer_identifier, + links=links, + ) + + return project_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_base_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_base_model.py new file mode 100644 index 0000000..8f44824 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_base_model.py @@ -0,0 +1,141 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectEventBaseModel") + + +@_attrs_define +class ProjectEventBaseModel: + """ + Attributes: + project_id (Union[Unset, None, int]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + project_id: Union[Unset, None, int] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + project_id = self.project_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if project_id is not UNSET: + field_dict["projectId"] = project_id + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + project_id = d.pop("projectId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_event_base_model = cls( + project_id=project_id, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return project_event_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_meeting_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_meeting_add_edit_model.py new file mode 100644 index 0000000..4b9b26e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_meeting_add_edit_model.py @@ -0,0 +1,180 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectEventMeetingAddEditModel") + + +@_attrs_define +class ProjectEventMeetingAddEditModel: + """ + Attributes: + title (str): + customer_id (Union[Unset, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for StartDateTime and EndDateTime + properties. Valid timezone ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + customer_id: Union[Unset, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_id = self.customer_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + customer_id = d.pop("customerId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + project_event_meeting_add_edit_model = cls( + title=title, + customer_id=customer_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return project_event_meeting_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_meeting_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_meeting_model.py new file mode 100644 index 0000000..8c5d077 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_meeting_model.py @@ -0,0 +1,320 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectEventMeetingModel") + + +@_attrs_define +class ProjectEventMeetingModel: + """ + Attributes: + customer_id (Union[Unset, int]): + project_id (Union[Unset, None, int]): + start_date_time (Union[Unset, datetime.datetime]): + end_date_time (Union[Unset, datetime.datetime]): + location (Union[Unset, None, str]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, None, int] = UNSET + start_date_time: Union[Unset, datetime.datetime] = UNSET + end_date_time: Union[Unset, datetime.datetime] = UNSET + location: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_id = self.customer_id + project_id = self.project_id + start_date_time: Union[Unset, str] = UNSET + if not isinstance(self.start_date_time, Unset): + start_date_time = self.start_date_time.isoformat() + + end_date_time: Union[Unset, str] = UNSET + if not isinstance(self.end_date_time, Unset): + end_date_time = self.end_date_time.isoformat() + + location = self.location + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if start_date_time is not UNSET: + field_dict["startDateTime"] = start_date_time + if end_date_time is not UNSET: + field_dict["endDateTime"] = end_date_time + if location is not UNSET: + field_dict["location"] = location + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + _start_date_time = d.pop("startDateTime", UNSET) + start_date_time: Union[Unset, datetime.datetime] + if isinstance(_start_date_time, Unset): + start_date_time = UNSET + else: + start_date_time = isoparse(_start_date_time) + + _end_date_time = d.pop("endDateTime", UNSET) + end_date_time: Union[Unset, datetime.datetime] + if isinstance(_end_date_time, Unset): + end_date_time = UNSET + else: + end_date_time = isoparse(_end_date_time) + + location = d.pop("location", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_event_meeting_model = cls( + customer_id=customer_id, + project_id=project_id, + start_date_time=start_date_time, + end_date_time=end_date_time, + location=location, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return project_event_meeting_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_model.py new file mode 100644 index 0000000..c55a5f5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_model.py @@ -0,0 +1,237 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectEventModel") + + +@_attrs_define +class ProjectEventModel: + """ + Attributes: + project_id (Union[Unset, None, int]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + project_id: Union[Unset, None, int] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + project_id = self.project_id + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if project_id is not UNSET: + field_dict["projectId"] = project_id + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + project_id = d.pop("projectId", UNSET) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_event_model = cls( + project_id=project_id, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return project_event_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_note_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_note_add_edit_model.py new file mode 100644 index 0000000..32cad08 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_note_add_edit_model.py @@ -0,0 +1,156 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectEventNoteAddEditModel") + + +@_attrs_define +class ProjectEventNoteAddEditModel: + """ + Attributes: + title (str): + customer_id (Union[Unset, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for NoteDate property. Valid timezone ids + can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + customer_id: Union[Unset, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_id = self.customer_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + timezone_id = self.timezone_id + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + customer_id = d.pop("customerId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + timezone_id = d.pop("timezoneId", UNSET) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + project_event_note_add_edit_model = cls( + title=title, + customer_id=customer_id, + note_type=note_type, + note_date=note_date, + timezone_id=timezone_id, + type=type, + description=description, + visibility=visibility, + ) + + return project_event_note_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_note_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_note_model.py new file mode 100644 index 0000000..dd41b3d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_note_model.py @@ -0,0 +1,288 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_note_type import EventNoteType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectEventNoteModel") + + +@_attrs_define +class ProjectEventNoteModel: + """ + Attributes: + customer_id (Union[Unset, int]): + project_id (Union[Unset, None, int]): + note_type (Union[Unset, None, EventNoteType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + note_date (Union[Unset, None, datetime.datetime]): + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, None, int] = UNSET + note_type: Union[Unset, None, EventNoteType] = UNSET + note_date: Union[Unset, None, datetime.datetime] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_id = self.customer_id + project_id = self.project_id + note_type: Union[Unset, None, int] = UNSET + if not isinstance(self.note_type, Unset): + note_type = self.note_type.value if self.note_type else None + + note_date: Union[Unset, None, str] = UNSET + if not isinstance(self.note_date, Unset): + note_date = self.note_date.isoformat() if self.note_date else None + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if note_type is not UNSET: + field_dict["noteType"] = note_type + if note_date is not UNSET: + field_dict["noteDate"] = note_date + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + _note_type = d.pop("noteType", UNSET) + note_type: Union[Unset, None, EventNoteType] + if _note_type is None: + note_type = None + elif isinstance(_note_type, Unset): + note_type = UNSET + else: + note_type = EventNoteType(_note_type) + + _note_date = d.pop("noteDate", UNSET) + note_date: Union[Unset, None, datetime.datetime] + if _note_date is None: + note_date = None + elif isinstance(_note_date, Unset): + note_date = UNSET + else: + note_date = isoparse(_note_date) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_event_note_model = cls( + customer_id=customer_id, + project_id=project_id, + note_type=note_type, + note_date=note_date, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return project_event_note_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_task_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_task_add_edit_model.py new file mode 100644 index 0000000..996dd8e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_task_add_edit_model.py @@ -0,0 +1,199 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectEventTaskAddEditModel") + + +@_attrs_define +class ProjectEventTaskAddEditModel: + """ + Attributes: + title (str): + customer_id (Union[Unset, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + timezone_id (Union[Unset, None, str]): The desired timezone to be used for DueDateTime property. Valid timezone + ids can be found at https://nodatime.org/TimeZones + If empty, the timezone of the executing user (API account) will be used. + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + description (Union[Unset, None, str]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + """ + + title: str + customer_id: Union[Unset, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + timezone_id: Union[Unset, None, str] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + type: Union[Unset, EventType] = UNSET + description: Union[Unset, None, str] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + customer_id = self.customer_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + timezone_id = self.timezone_id + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + description = self.description + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "title": title, + } + ) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if timezone_id is not UNSET: + field_dict["timezoneId"] = timezone_id + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if type is not UNSET: + field_dict["type"] = type + if description is not UNSET: + field_dict["description"] = description + if visibility is not UNSET: + field_dict["visibility"] = visibility + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + title = d.pop("title") + + customer_id = d.pop("customerId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + timezone_id = d.pop("timezoneId", UNSET) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + description = d.pop("description", UNSET) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + project_event_task_add_edit_model = cls( + title=title, + customer_id=customer_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + timezone_id=timezone_id, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + type=type, + description=description, + visibility=visibility, + ) + + return project_event_task_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_event_task_model.py b/src/cinode-py-client/cinode_api_client/models/project_event_task_model.py new file mode 100644 index 0000000..d822a59 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_event_task_model.py @@ -0,0 +1,331 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.event_status_value import EventStatusValue +from ..models.event_task_type import EventTaskType +from ..models.event_type import EventType +from ..models.event_visibility import EventVisibility +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectEventTaskModel") + + +@_attrs_define +class ProjectEventTaskModel: + """ + Attributes: + customer_id (Union[Unset, int]): + project_id (Union[Unset, None, int]): + task_type (Union[Unset, None, EventTaskType]): + + Ej angiven = 0 + + Telefonsamtal = 1 + + E-mail = 2 + has_time (Union[Unset, None, bool]): + due_date_time (Union[Unset, None, datetime.datetime]): + assigned_to_company_user_id (Union[Unset, None, int]): + status (Union[Unset, EventStatusValue]): + + Inte påbörjad = 0 + + Påbörjad = 1 + + Färdig = 2 + + Uppskjuten = 3 + + Väntar = 4 + created_by_company_user_id (Union[Unset, int]): + updated_by_company_user_id (Union[Unset, None, int]): + created (Union[Unset, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + visibility (Union[Unset, EventVisibility]): + + Publik = 0 + + Privat = 1 + comments (Union[Unset, None, List['EventCommentModel']]): + type (Union[Unset, EventType]): + + Möte = 0 + + Notering = 1 + + Uppgift = 2 + + Samtal = 3 + id (Union[Unset, None, str]): + company_id (Union[Unset, None, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + event_date (Union[Unset, datetime.datetime]): + links (Union[Unset, None, List['Link']]): + """ + + customer_id: Union[Unset, int] = UNSET + project_id: Union[Unset, None, int] = UNSET + task_type: Union[Unset, None, EventTaskType] = UNSET + has_time: Union[Unset, None, bool] = UNSET + due_date_time: Union[Unset, None, datetime.datetime] = UNSET + assigned_to_company_user_id: Union[Unset, None, int] = UNSET + status: Union[Unset, EventStatusValue] = UNSET + created_by_company_user_id: Union[Unset, int] = UNSET + updated_by_company_user_id: Union[Unset, None, int] = UNSET + created: Union[Unset, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + visibility: Union[Unset, EventVisibility] = UNSET + comments: Union[Unset, None, List["EventCommentModel"]] = UNSET + type: Union[Unset, EventType] = UNSET + id: Union[Unset, None, str] = UNSET + company_id: Union[Unset, None, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + event_date: Union[Unset, datetime.datetime] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + customer_id = self.customer_id + project_id = self.project_id + task_type: Union[Unset, None, int] = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type.value if self.task_type else None + + has_time = self.has_time + due_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.due_date_time, Unset): + due_date_time = self.due_date_time.isoformat() if self.due_date_time else None + + assigned_to_company_user_id = self.assigned_to_company_user_id + status: Union[Unset, int] = UNSET + if not isinstance(self.status, Unset): + status = self.status.value + + created_by_company_user_id = self.created_by_company_user_id + updated_by_company_user_id = self.updated_by_company_user_id + created: Union[Unset, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + visibility: Union[Unset, int] = UNSET + if not isinstance(self.visibility, Unset): + visibility = self.visibility.value + + comments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.comments, Unset): + if self.comments is None: + comments = None + else: + comments = [] + for comments_item_data in self.comments: + comments_item = comments_item_data.to_dict() + + comments.append(comments_item) + + type: Union[Unset, int] = UNSET + if not isinstance(self.type, Unset): + type = self.type.value + + id = self.id + company_id = self.company_id + title = self.title + description = self.description + event_date: Union[Unset, str] = UNSET + if not isinstance(self.event_date, Unset): + event_date = self.event_date.isoformat() + + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if task_type is not UNSET: + field_dict["taskType"] = task_type + if has_time is not UNSET: + field_dict["hasTime"] = has_time + if due_date_time is not UNSET: + field_dict["dueDateTime"] = due_date_time + if assigned_to_company_user_id is not UNSET: + field_dict["assignedToCompanyUserId"] = assigned_to_company_user_id + if status is not UNSET: + field_dict["status"] = status + if created_by_company_user_id is not UNSET: + field_dict["createdByCompanyUserId"] = created_by_company_user_id + if updated_by_company_user_id is not UNSET: + field_dict["updatedByCompanyUserId"] = updated_by_company_user_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if visibility is not UNSET: + field_dict["visibility"] = visibility + if comments is not UNSET: + field_dict["comments"] = comments + if type is not UNSET: + field_dict["type"] = type + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if event_date is not UNSET: + field_dict["eventDate"] = event_date + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.event_comment_model import EventCommentModel + from ..models.link import Link + + d = src_dict.copy() + customer_id = d.pop("customerId", UNSET) + + project_id = d.pop("projectId", UNSET) + + _task_type = d.pop("taskType", UNSET) + task_type: Union[Unset, None, EventTaskType] + if _task_type is None: + task_type = None + elif isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = EventTaskType(_task_type) + + has_time = d.pop("hasTime", UNSET) + + _due_date_time = d.pop("dueDateTime", UNSET) + due_date_time: Union[Unset, None, datetime.datetime] + if _due_date_time is None: + due_date_time = None + elif isinstance(_due_date_time, Unset): + due_date_time = UNSET + else: + due_date_time = isoparse(_due_date_time) + + assigned_to_company_user_id = d.pop("assignedToCompanyUserId", UNSET) + + _status = d.pop("status", UNSET) + status: Union[Unset, EventStatusValue] + if isinstance(_status, Unset): + status = UNSET + else: + status = EventStatusValue(_status) + + created_by_company_user_id = d.pop("createdByCompanyUserId", UNSET) + + updated_by_company_user_id = d.pop("updatedByCompanyUserId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, datetime.datetime] + if isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _visibility = d.pop("visibility", UNSET) + visibility: Union[Unset, EventVisibility] + if isinstance(_visibility, Unset): + visibility = UNSET + else: + visibility = EventVisibility(_visibility) + + comments = [] + _comments = d.pop("comments", UNSET) + for comments_item_data in _comments or []: + comments_item = EventCommentModel.from_dict(comments_item_data) + + comments.append(comments_item) + + _type = d.pop("type", UNSET) + type: Union[Unset, EventType] + if isinstance(_type, Unset): + type = UNSET + else: + type = EventType(_type) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + _event_date = d.pop("eventDate", UNSET) + event_date: Union[Unset, datetime.datetime] + if isinstance(_event_date, Unset): + event_date = UNSET + else: + event_date = isoparse(_event_date) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_event_task_model = cls( + customer_id=customer_id, + project_id=project_id, + task_type=task_type, + has_time=has_time, + due_date_time=due_date_time, + assigned_to_company_user_id=assigned_to_company_user_id, + status=status, + created_by_company_user_id=created_by_company_user_id, + updated_by_company_user_id=updated_by_company_user_id, + created=created, + updated=updated, + visibility=visibility, + comments=comments, + type=type, + id=id, + company_id=company_id, + title=title, + description=description, + event_date=event_date, + links=links, + ) + + return project_event_task_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_model.py b/src/cinode-py-client/cinode_api_client/models/project_model.py new file mode 100644 index 0000000..f7b9268 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_model.py @@ -0,0 +1,704 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.project_priority import ProjectPriority +from ..models.project_state import ProjectState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_base_model import CompanyBaseModel + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.company_customer_contact_base_model import CompanyCustomerContactBaseModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + from ..models.project_attachment_model import ProjectAttachmentModel + from ..models.project_event_base_model import ProjectEventBaseModel + from ..models.project_reference_model import ProjectReferenceModel + from ..models.project_state_history_model import ProjectStateHistoryModel + + +T = TypeVar("T", bound="ProjectModel") + + +@_attrs_define +class ProjectModel: + """ + Attributes: + company (Union[Unset, None, CompanyBaseModel]): + customer (Union[Unset, None, CompanyCustomerBaseModel]): + seo_id (Union[Unset, None, str]): + location_id (Union[Unset, None, int]): + google_id (Union[Unset, None, str]): + probability (Union[Unset, None, int]): + estimated_value (Union[Unset, None, int]): + contract_value (Union[Unset, None, int]): + estimated_close_date (Union[Unset, None, datetime.datetime]): + managers (Union[Unset, None, List['CompanyUserBaseModel']]): + sales_manager (Union[Unset, None, CompanyUserBaseModel]): + sales_managers (Union[Unset, None, List['CompanyUserBaseModel']]): + intermediator (Union[Unset, None, CompanyCustomerBaseModel]): + events (Union[Unset, None, List['ProjectEventBaseModel']]): + customer_contacts (Union[Unset, None, List['CompanyCustomerContactBaseModel']]): + intermediator_contacts (Union[Unset, None, List['CompanyCustomerContactBaseModel']]): + assignments (Union[Unset, None, List['ProjectAssignmentBaseModel']]): + attachments (Union[Unset, None, List['ProjectAttachmentModel']]): + tags (Union[Unset, None, List['CompanyTagBaseModel']]): + pipeline_id (Union[Unset, None, int]): + current_stage_id (Union[Unset, None, int]): + currency (Union[Unset, None, CurrencyModel]): + project_references (Union[Unset, None, List['ProjectReferenceModel']]): + current_state (Union[Unset, ProjectState]): + + Öppen = 0 + + Vunnen = 30 + + Förlorad = 40 + + Avböjd = 50 + + Uppskjuten = 60 + state_history (Union[Unset, None, List['ProjectStateHistoryModel']]): + created_by (Union[Unset, None, CompanyUserBaseModel]): + updated_by (Union[Unset, None, CompanyUserBaseModel]): + created_date_time (Union[Unset, datetime.datetime]): + updated_date_time (Union[Unset, None, datetime.datetime]): + team_id (Union[Unset, None, int]): + state_reason_id (Union[Unset, None, int]): + sales_manager_ids (Union[Unset, None, List[int]]): List of sales managers employee ids + project_manager_ids (Union[Unset, None, List[int]]): List of project managers employee ids + priority (Union[Unset, ProjectPriority]): + + Låg = 3 + + Medel = 5 + + Hög = 8 + company_id (Union[Unset, int]): + customer_id (Union[Unset, int]): + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + identifier (Union[Unset, None, str]): + customer_identifier (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + company: Union[Unset, None, "CompanyBaseModel"] = UNSET + customer: Union[Unset, None, "CompanyCustomerBaseModel"] = UNSET + seo_id: Union[Unset, None, str] = UNSET + location_id: Union[Unset, None, int] = UNSET + google_id: Union[Unset, None, str] = UNSET + probability: Union[Unset, None, int] = UNSET + estimated_value: Union[Unset, None, int] = UNSET + contract_value: Union[Unset, None, int] = UNSET + estimated_close_date: Union[Unset, None, datetime.datetime] = UNSET + managers: Union[Unset, None, List["CompanyUserBaseModel"]] = UNSET + sales_manager: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + sales_managers: Union[Unset, None, List["CompanyUserBaseModel"]] = UNSET + intermediator: Union[Unset, None, "CompanyCustomerBaseModel"] = UNSET + events: Union[Unset, None, List["ProjectEventBaseModel"]] = UNSET + customer_contacts: Union[Unset, None, List["CompanyCustomerContactBaseModel"]] = UNSET + intermediator_contacts: Union[Unset, None, List["CompanyCustomerContactBaseModel"]] = UNSET + assignments: Union[Unset, None, List["ProjectAssignmentBaseModel"]] = UNSET + attachments: Union[Unset, None, List["ProjectAttachmentModel"]] = UNSET + tags: Union[Unset, None, List["CompanyTagBaseModel"]] = UNSET + pipeline_id: Union[Unset, None, int] = UNSET + current_stage_id: Union[Unset, None, int] = UNSET + currency: Union[Unset, None, "CurrencyModel"] = UNSET + project_references: Union[Unset, None, List["ProjectReferenceModel"]] = UNSET + current_state: Union[Unset, ProjectState] = UNSET + state_history: Union[Unset, None, List["ProjectStateHistoryModel"]] = UNSET + created_by: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + updated_by: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + created_date_time: Union[Unset, datetime.datetime] = UNSET + updated_date_time: Union[Unset, None, datetime.datetime] = UNSET + team_id: Union[Unset, None, int] = UNSET + state_reason_id: Union[Unset, None, int] = UNSET + sales_manager_ids: Union[Unset, None, List[int]] = UNSET + project_manager_ids: Union[Unset, None, List[int]] = UNSET + priority: Union[Unset, ProjectPriority] = UNSET + company_id: Union[Unset, int] = UNSET + customer_id: Union[Unset, int] = UNSET + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + identifier: Union[Unset, None, str] = UNSET + customer_identifier: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company, Unset): + company = self.company.to_dict() if self.company else None + + customer: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.customer, Unset): + customer = self.customer.to_dict() if self.customer else None + + seo_id = self.seo_id + location_id = self.location_id + google_id = self.google_id + probability = self.probability + estimated_value = self.estimated_value + contract_value = self.contract_value + estimated_close_date: Union[Unset, None, str] = UNSET + if not isinstance(self.estimated_close_date, Unset): + estimated_close_date = self.estimated_close_date.isoformat() if self.estimated_close_date else None + + managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.managers, Unset): + if self.managers is None: + managers = None + else: + managers = [] + for managers_item_data in self.managers: + managers_item = managers_item_data.to_dict() + + managers.append(managers_item) + + sales_manager: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.sales_manager, Unset): + sales_manager = self.sales_manager.to_dict() if self.sales_manager else None + + sales_managers: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.sales_managers, Unset): + if self.sales_managers is None: + sales_managers = None + else: + sales_managers = [] + for sales_managers_item_data in self.sales_managers: + sales_managers_item = sales_managers_item_data.to_dict() + + sales_managers.append(sales_managers_item) + + intermediator: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.intermediator, Unset): + intermediator = self.intermediator.to_dict() if self.intermediator else None + + events: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.events, Unset): + if self.events is None: + events = None + else: + events = [] + for events_item_data in self.events: + events_item = events_item_data.to_dict() + + events.append(events_item) + + customer_contacts: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.customer_contacts, Unset): + if self.customer_contacts is None: + customer_contacts = None + else: + customer_contacts = [] + for customer_contacts_item_data in self.customer_contacts: + customer_contacts_item = customer_contacts_item_data.to_dict() + + customer_contacts.append(customer_contacts_item) + + intermediator_contacts: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.intermediator_contacts, Unset): + if self.intermediator_contacts is None: + intermediator_contacts = None + else: + intermediator_contacts = [] + for intermediator_contacts_item_data in self.intermediator_contacts: + intermediator_contacts_item = intermediator_contacts_item_data.to_dict() + + intermediator_contacts.append(intermediator_contacts_item) + + assignments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.assignments, Unset): + if self.assignments is None: + assignments = None + else: + assignments = [] + for assignments_item_data in self.assignments: + assignments_item = assignments_item_data.to_dict() + + assignments.append(assignments_item) + + attachments: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.attachments, Unset): + if self.attachments is None: + attachments = None + else: + attachments = [] + for attachments_item_data in self.attachments: + attachments_item = attachments_item_data.to_dict() + + attachments.append(attachments_item) + + tags: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = [] + for tags_item_data in self.tags: + tags_item = tags_item_data.to_dict() + + tags.append(tags_item) + + pipeline_id = self.pipeline_id + current_stage_id = self.current_stage_id + currency: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.currency, Unset): + currency = self.currency.to_dict() if self.currency else None + + project_references: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.project_references, Unset): + if self.project_references is None: + project_references = None + else: + project_references = [] + for project_references_item_data in self.project_references: + project_references_item = project_references_item_data.to_dict() + + project_references.append(project_references_item) + + current_state: Union[Unset, int] = UNSET + if not isinstance(self.current_state, Unset): + current_state = self.current_state.value + + state_history: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.state_history, Unset): + if self.state_history is None: + state_history = None + else: + state_history = [] + for state_history_item_data in self.state_history: + state_history_item = state_history_item_data.to_dict() + + state_history.append(state_history_item) + + created_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.created_by, Unset): + created_by = self.created_by.to_dict() if self.created_by else None + + updated_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.updated_by, Unset): + updated_by = self.updated_by.to_dict() if self.updated_by else None + + created_date_time: Union[Unset, str] = UNSET + if not isinstance(self.created_date_time, Unset): + created_date_time = self.created_date_time.isoformat() + + updated_date_time: Union[Unset, None, str] = UNSET + if not isinstance(self.updated_date_time, Unset): + updated_date_time = self.updated_date_time.isoformat() if self.updated_date_time else None + + team_id = self.team_id + state_reason_id = self.state_reason_id + sales_manager_ids: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.sales_manager_ids, Unset): + if self.sales_manager_ids is None: + sales_manager_ids = None + else: + sales_manager_ids = self.sales_manager_ids + + project_manager_ids: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_manager_ids, Unset): + if self.project_manager_ids is None: + project_manager_ids = None + else: + project_manager_ids = self.project_manager_ids + + priority: Union[Unset, int] = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority.value + + company_id = self.company_id + customer_id = self.customer_id + id = self.id + title = self.title + description = self.description + identifier = self.identifier + customer_identifier = self.customer_identifier + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company is not UNSET: + field_dict["company"] = company + if customer is not UNSET: + field_dict["customer"] = customer + if seo_id is not UNSET: + field_dict["seoId"] = seo_id + if location_id is not UNSET: + field_dict["locationId"] = location_id + if google_id is not UNSET: + field_dict["googleId"] = google_id + if probability is not UNSET: + field_dict["probability"] = probability + if estimated_value is not UNSET: + field_dict["estimatedValue"] = estimated_value + if contract_value is not UNSET: + field_dict["contractValue"] = contract_value + if estimated_close_date is not UNSET: + field_dict["estimatedCloseDate"] = estimated_close_date + if managers is not UNSET: + field_dict["managers"] = managers + if sales_manager is not UNSET: + field_dict["salesManager"] = sales_manager + if sales_managers is not UNSET: + field_dict["salesManagers"] = sales_managers + if intermediator is not UNSET: + field_dict["intermediator"] = intermediator + if events is not UNSET: + field_dict["events"] = events + if customer_contacts is not UNSET: + field_dict["customerContacts"] = customer_contacts + if intermediator_contacts is not UNSET: + field_dict["intermediatorContacts"] = intermediator_contacts + if assignments is not UNSET: + field_dict["assignments"] = assignments + if attachments is not UNSET: + field_dict["attachments"] = attachments + if tags is not UNSET: + field_dict["tags"] = tags + if pipeline_id is not UNSET: + field_dict["pipelineId"] = pipeline_id + if current_stage_id is not UNSET: + field_dict["currentStageId"] = current_stage_id + if currency is not UNSET: + field_dict["currency"] = currency + if project_references is not UNSET: + field_dict["projectReferences"] = project_references + if current_state is not UNSET: + field_dict["currentState"] = current_state + if state_history is not UNSET: + field_dict["stateHistory"] = state_history + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if updated_by is not UNSET: + field_dict["updatedBy"] = updated_by + if created_date_time is not UNSET: + field_dict["createdDateTime"] = created_date_time + if updated_date_time is not UNSET: + field_dict["updatedDateTime"] = updated_date_time + if team_id is not UNSET: + field_dict["teamId"] = team_id + if state_reason_id is not UNSET: + field_dict["stateReasonId"] = state_reason_id + if sales_manager_ids is not UNSET: + field_dict["salesManagerIds"] = sales_manager_ids + if project_manager_ids is not UNSET: + field_dict["projectManagerIds"] = project_manager_ids + if priority is not UNSET: + field_dict["priority"] = priority + if company_id is not UNSET: + field_dict["companyId"] = company_id + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if identifier is not UNSET: + field_dict["identifier"] = identifier + if customer_identifier is not UNSET: + field_dict["customerIdentifier"] = customer_identifier + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_base_model import CompanyBaseModel + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.company_customer_contact_base_model import CompanyCustomerContactBaseModel + from ..models.company_tag_base_model import CompanyTagBaseModel + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.currency_model import CurrencyModel + from ..models.link import Link + from ..models.project_assignment_base_model import ProjectAssignmentBaseModel + from ..models.project_attachment_model import ProjectAttachmentModel + from ..models.project_event_base_model import ProjectEventBaseModel + from ..models.project_reference_model import ProjectReferenceModel + from ..models.project_state_history_model import ProjectStateHistoryModel + + d = src_dict.copy() + _company = d.pop("company", UNSET) + company: Union[Unset, None, CompanyBaseModel] + if _company is None: + company = None + elif isinstance(_company, Unset): + company = UNSET + else: + company = CompanyBaseModel.from_dict(_company) + + _customer = d.pop("customer", UNSET) + customer: Union[Unset, None, CompanyCustomerBaseModel] + if _customer is None: + customer = None + elif isinstance(_customer, Unset): + customer = UNSET + else: + customer = CompanyCustomerBaseModel.from_dict(_customer) + + seo_id = d.pop("seoId", UNSET) + + location_id = d.pop("locationId", UNSET) + + google_id = d.pop("googleId", UNSET) + + probability = d.pop("probability", UNSET) + + estimated_value = d.pop("estimatedValue", UNSET) + + contract_value = d.pop("contractValue", UNSET) + + _estimated_close_date = d.pop("estimatedCloseDate", UNSET) + estimated_close_date: Union[Unset, None, datetime.datetime] + if _estimated_close_date is None: + estimated_close_date = None + elif isinstance(_estimated_close_date, Unset): + estimated_close_date = UNSET + else: + estimated_close_date = isoparse(_estimated_close_date) + + managers = [] + _managers = d.pop("managers", UNSET) + for managers_item_data in _managers or []: + managers_item = CompanyUserBaseModel.from_dict(managers_item_data) + + managers.append(managers_item) + + _sales_manager = d.pop("salesManager", UNSET) + sales_manager: Union[Unset, None, CompanyUserBaseModel] + if _sales_manager is None: + sales_manager = None + elif isinstance(_sales_manager, Unset): + sales_manager = UNSET + else: + sales_manager = CompanyUserBaseModel.from_dict(_sales_manager) + + sales_managers = [] + _sales_managers = d.pop("salesManagers", UNSET) + for sales_managers_item_data in _sales_managers or []: + sales_managers_item = CompanyUserBaseModel.from_dict(sales_managers_item_data) + + sales_managers.append(sales_managers_item) + + _intermediator = d.pop("intermediator", UNSET) + intermediator: Union[Unset, None, CompanyCustomerBaseModel] + if _intermediator is None: + intermediator = None + elif isinstance(_intermediator, Unset): + intermediator = UNSET + else: + intermediator = CompanyCustomerBaseModel.from_dict(_intermediator) + + events = [] + _events = d.pop("events", UNSET) + for events_item_data in _events or []: + events_item = ProjectEventBaseModel.from_dict(events_item_data) + + events.append(events_item) + + customer_contacts = [] + _customer_contacts = d.pop("customerContacts", UNSET) + for customer_contacts_item_data in _customer_contacts or []: + customer_contacts_item = CompanyCustomerContactBaseModel.from_dict(customer_contacts_item_data) + + customer_contacts.append(customer_contacts_item) + + intermediator_contacts = [] + _intermediator_contacts = d.pop("intermediatorContacts", UNSET) + for intermediator_contacts_item_data in _intermediator_contacts or []: + intermediator_contacts_item = CompanyCustomerContactBaseModel.from_dict(intermediator_contacts_item_data) + + intermediator_contacts.append(intermediator_contacts_item) + + assignments = [] + _assignments = d.pop("assignments", UNSET) + for assignments_item_data in _assignments or []: + assignments_item = ProjectAssignmentBaseModel.from_dict(assignments_item_data) + + assignments.append(assignments_item) + + attachments = [] + _attachments = d.pop("attachments", UNSET) + for attachments_item_data in _attachments or []: + attachments_item = ProjectAttachmentModel.from_dict(attachments_item_data) + + attachments.append(attachments_item) + + tags = [] + _tags = d.pop("tags", UNSET) + for tags_item_data in _tags or []: + tags_item = CompanyTagBaseModel.from_dict(tags_item_data) + + tags.append(tags_item) + + pipeline_id = d.pop("pipelineId", UNSET) + + current_stage_id = d.pop("currentStageId", UNSET) + + _currency = d.pop("currency", UNSET) + currency: Union[Unset, None, CurrencyModel] + if _currency is None: + currency = None + elif isinstance(_currency, Unset): + currency = UNSET + else: + currency = CurrencyModel.from_dict(_currency) + + project_references = [] + _project_references = d.pop("projectReferences", UNSET) + for project_references_item_data in _project_references or []: + project_references_item = ProjectReferenceModel.from_dict(project_references_item_data) + + project_references.append(project_references_item) + + _current_state = d.pop("currentState", UNSET) + current_state: Union[Unset, ProjectState] + if isinstance(_current_state, Unset): + current_state = UNSET + else: + current_state = ProjectState(_current_state) + + state_history = [] + _state_history = d.pop("stateHistory", UNSET) + for state_history_item_data in _state_history or []: + state_history_item = ProjectStateHistoryModel.from_dict(state_history_item_data) + + state_history.append(state_history_item) + + _created_by = d.pop("createdBy", UNSET) + created_by: Union[Unset, None, CompanyUserBaseModel] + if _created_by is None: + created_by = None + elif isinstance(_created_by, Unset): + created_by = UNSET + else: + created_by = CompanyUserBaseModel.from_dict(_created_by) + + _updated_by = d.pop("updatedBy", UNSET) + updated_by: Union[Unset, None, CompanyUserBaseModel] + if _updated_by is None: + updated_by = None + elif isinstance(_updated_by, Unset): + updated_by = UNSET + else: + updated_by = CompanyUserBaseModel.from_dict(_updated_by) + + _created_date_time = d.pop("createdDateTime", UNSET) + created_date_time: Union[Unset, datetime.datetime] + if isinstance(_created_date_time, Unset): + created_date_time = UNSET + else: + created_date_time = isoparse(_created_date_time) + + _updated_date_time = d.pop("updatedDateTime", UNSET) + updated_date_time: Union[Unset, None, datetime.datetime] + if _updated_date_time is None: + updated_date_time = None + elif isinstance(_updated_date_time, Unset): + updated_date_time = UNSET + else: + updated_date_time = isoparse(_updated_date_time) + + team_id = d.pop("teamId", UNSET) + + state_reason_id = d.pop("stateReasonId", UNSET) + + sales_manager_ids = cast(List[int], d.pop("salesManagerIds", UNSET)) + + project_manager_ids = cast(List[int], d.pop("projectManagerIds", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: Union[Unset, ProjectPriority] + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = ProjectPriority(_priority) + + company_id = d.pop("companyId", UNSET) + + customer_id = d.pop("customerId", UNSET) + + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + identifier = d.pop("identifier", UNSET) + + customer_identifier = d.pop("customerIdentifier", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_model = cls( + company=company, + customer=customer, + seo_id=seo_id, + location_id=location_id, + google_id=google_id, + probability=probability, + estimated_value=estimated_value, + contract_value=contract_value, + estimated_close_date=estimated_close_date, + managers=managers, + sales_manager=sales_manager, + sales_managers=sales_managers, + intermediator=intermediator, + events=events, + customer_contacts=customer_contacts, + intermediator_contacts=intermediator_contacts, + assignments=assignments, + attachments=attachments, + tags=tags, + pipeline_id=pipeline_id, + current_stage_id=current_stage_id, + currency=currency, + project_references=project_references, + current_state=current_state, + state_history=state_history, + created_by=created_by, + updated_by=updated_by, + created_date_time=created_date_time, + updated_date_time=updated_date_time, + team_id=team_id, + state_reason_id=state_reason_id, + sales_manager_ids=sales_manager_ids, + project_manager_ids=project_manager_ids, + priority=priority, + company_id=company_id, + customer_id=customer_id, + id=id, + title=title, + description=description, + identifier=identifier, + customer_identifier=customer_identifier, + links=links, + ) + + return project_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_pipeline_model.py b/src/cinode-py-client/cinode_api_client/models/project_pipeline_model.py new file mode 100644 index 0000000..d809091 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_pipeline_model.py @@ -0,0 +1,82 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.project_pipeline_stage_model import ProjectPipelineStageModel + + +T = TypeVar("T", bound="ProjectPipelineModel") + + +@_attrs_define +class ProjectPipelineModel: + """ + Attributes: + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + stages (Union[Unset, None, List['ProjectPipelineStageModel']]): + """ + + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + stages: Union[Unset, None, List["ProjectPipelineStageModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + title = self.title + description = self.description + stages: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.stages, Unset): + if self.stages is None: + stages = None + else: + stages = [] + for stages_item_data in self.stages: + stages_item = stages_item_data.to_dict() + + stages.append(stages_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if stages is not UNSET: + field_dict["stages"] = stages + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.project_pipeline_stage_model import ProjectPipelineStageModel + + d = src_dict.copy() + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + stages = [] + _stages = d.pop("stages", UNSET) + for stages_item_data in _stages or []: + stages_item = ProjectPipelineStageModel.from_dict(stages_item_data) + + stages.append(stages_item) + + project_pipeline_model = cls( + id=id, + title=title, + description=description, + stages=stages, + ) + + return project_pipeline_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_pipeline_stage_model.py b/src/cinode-py-client/cinode_api_client/models/project_pipeline_stage_model.py new file mode 100644 index 0000000..1a57447 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_pipeline_stage_model.py @@ -0,0 +1,70 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectPipelineStageModel") + + +@_attrs_define +class ProjectPipelineStageModel: + """ + Attributes: + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + order (Union[Unset, int]): + probability (Union[Unset, None, int]): + """ + + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + order: Union[Unset, int] = UNSET + probability: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + title = self.title + description = self.description + order = self.order + probability = self.probability + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if order is not UNSET: + field_dict["order"] = order + if probability is not UNSET: + field_dict["probability"] = probability + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + order = d.pop("order", UNSET) + + probability = d.pop("probability", UNSET) + + project_pipeline_stage_model = cls( + id=id, + title=title, + description=description, + order=order, + probability=probability, + ) + + return project_pipeline_stage_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_priority.py b/src/cinode-py-client/cinode_api_client/models/project_priority.py new file mode 100644 index 0000000..ec4f7e5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_priority.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class ProjectPriority(IntEnum): + VALUE_3 = 3 + VALUE_5 = 5 + VALUE_8 = 8 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_query_sort.py b/src/cinode-py-client/cinode_api_client/models/project_query_sort.py new file mode 100644 index 0000000..7ceff1e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_query_sort.py @@ -0,0 +1,14 @@ +from enum import IntEnum + + +class ProjectQuerySort(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_query_sort_page_and_sort_by_model.py b/src/cinode-py-client/cinode_api_client/models/project_query_sort_page_and_sort_by_model.py new file mode 100644 index 0000000..f9a5abb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_query_sort_page_and_sort_by_model.py @@ -0,0 +1,95 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.project_query_sort import ProjectQuerySort +from ..models.sort_order import SortOrder +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectQuerySortPageAndSortByModel") + + +@_attrs_define +class ProjectQuerySortPageAndSortByModel: + """ + Attributes: + sort_by (Union[Unset, ProjectQuerySort]): + + CreatedDateTime = 0 + + Title = 1 + + Identifier = 2 + + CustomerIdentifier = 3 + + SeoId = 4 + + UpdatedDateTime = 5 + + LastTouchDateTime = 6 + sort_order (Union[Unset, SortOrder]): 0 - Ascending, + 1 - Descending + page (Union[Unset, int]): Default: 1. + items_per_page (Union[Unset, int]): Default: 15. + """ + + sort_by: Union[Unset, ProjectQuerySort] = UNSET + sort_order: Union[Unset, SortOrder] = UNSET + page: Union[Unset, int] = 1 + items_per_page: Union[Unset, int] = 15 + + def to_dict(self) -> Dict[str, Any]: + sort_by: Union[Unset, int] = UNSET + if not isinstance(self.sort_by, Unset): + sort_by = self.sort_by.value + + sort_order: Union[Unset, int] = UNSET + if not isinstance(self.sort_order, Unset): + sort_order = self.sort_order.value + + page = self.page + items_per_page = self.items_per_page + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if sort_by is not UNSET: + field_dict["sortBy"] = sort_by + if sort_order is not UNSET: + field_dict["sortOrder"] = sort_order + if page is not UNSET: + field_dict["page"] = page + if items_per_page is not UNSET: + field_dict["itemsPerPage"] = items_per_page + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _sort_by = d.pop("sortBy", UNSET) + sort_by: Union[Unset, ProjectQuerySort] + if isinstance(_sort_by, Unset): + sort_by = UNSET + else: + sort_by = ProjectQuerySort(_sort_by) + + _sort_order = d.pop("sortOrder", UNSET) + sort_order: Union[Unset, SortOrder] + if isinstance(_sort_order, Unset): + sort_order = UNSET + else: + sort_order = SortOrder(_sort_order) + + page = d.pop("page", UNSET) + + items_per_page = d.pop("itemsPerPage", UNSET) + + project_query_sort_page_and_sort_by_model = cls( + sort_by=sort_by, + sort_order=sort_order, + page=page, + items_per_page=items_per_page, + ) + + return project_query_sort_page_and_sort_by_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_reference_model.py b/src/cinode-py-client/cinode_api_client/models/project_reference_model.py new file mode 100644 index 0000000..8e20af4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_reference_model.py @@ -0,0 +1,106 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="ProjectReferenceModel") + + +@_attrs_define +class ProjectReferenceModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + project_id (Union[Unset, int]): + title (Union[Unset, None, str]): + text (Union[Unset, None, str]): + language (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + project_id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + text: Union[Unset, None, str] = UNSET + language: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + project_id = self.project_id + title = self.title + text = self.text + language = self.language + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if project_id is not UNSET: + field_dict["projectId"] = project_id + if title is not UNSET: + field_dict["title"] = title + if text is not UNSET: + field_dict["text"] = text + if language is not UNSET: + field_dict["language"] = language + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + project_id = d.pop("projectId", UNSET) + + title = d.pop("title", UNSET) + + text = d.pop("text", UNSET) + + language = d.pop("language", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + project_reference_model = cls( + id=id, + company_id=company_id, + project_id=project_id, + title=title, + text=text, + language=language, + links=links, + ) + + return project_reference_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_state.py b/src/cinode-py-client/cinode_api_client/models/project_state.py new file mode 100644 index 0000000..ec05a82 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_state.py @@ -0,0 +1,12 @@ +from enum import IntEnum + + +class ProjectState(IntEnum): + VALUE_0 = 0 + VALUE_30 = 30 + VALUE_40 = 40 + VALUE_50 = 50 + VALUE_60 = 60 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/project_state_history_model.py b/src/cinode-py-client/cinode_api_client/models/project_state_history_model.py new file mode 100644 index 0000000..e9de5ca --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_state_history_model.py @@ -0,0 +1,98 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.project_state import ProjectState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.project_state_reason_model import ProjectStateReasonModel + + +T = TypeVar("T", bound="ProjectStateHistoryModel") + + +@_attrs_define +class ProjectStateHistoryModel: + """ + Attributes: + state (Union[Unset, ProjectState]): + + Öppen = 0 + + Vunnen = 30 + + Förlorad = 40 + + Avböjd = 50 + + Uppskjuten = 60 + updated (Union[Unset, datetime.datetime]): + reason (Union[Unset, None, ProjectStateReasonModel]): + """ + + state: Union[Unset, ProjectState] = UNSET + updated: Union[Unset, datetime.datetime] = UNSET + reason: Union[Unset, None, "ProjectStateReasonModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + state: Union[Unset, int] = UNSET + if not isinstance(self.state, Unset): + state = self.state.value + + updated: Union[Unset, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() + + reason: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.reason, Unset): + reason = self.reason.to_dict() if self.reason else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if state is not UNSET: + field_dict["state"] = state + if updated is not UNSET: + field_dict["updated"] = updated + if reason is not UNSET: + field_dict["reason"] = reason + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.project_state_reason_model import ProjectStateReasonModel + + d = src_dict.copy() + _state = d.pop("state", UNSET) + state: Union[Unset, ProjectState] + if isinstance(_state, Unset): + state = UNSET + else: + state = ProjectState(_state) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, datetime.datetime] + if isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _reason = d.pop("reason", UNSET) + reason: Union[Unset, None, ProjectStateReasonModel] + if _reason is None: + reason = None + elif isinstance(_reason, Unset): + reason = UNSET + else: + reason = ProjectStateReasonModel.from_dict(_reason) + + project_state_history_model = cls( + state=state, + updated=updated, + reason=reason, + ) + + return project_state_history_model diff --git a/src/cinode-py-client/cinode_api_client/models/project_state_reason_model.py b/src/cinode-py-client/cinode_api_client/models/project_state_reason_model.py new file mode 100644 index 0000000..4390b58 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/project_state_reason_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ProjectStateReasonModel") + + +@_attrs_define +class ProjectStateReasonModel: + """ + Attributes: + id (Union[Unset, int]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + """ + + id: Union[Unset, int] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + title = self.title + description = self.description + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + project_state_reason_model = cls( + id=id, + title=title, + description=description, + ) + + return project_state_reason_model diff --git a/src/cinode-py-client/cinode_api_client/models/recruitment_source_model.py b/src/cinode-py-client/cinode_api_client/models/recruitment_source_model.py new file mode 100644 index 0000000..07e72c4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/recruitment_source_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RecruitmentSourceModel") + + +@_attrs_define +class RecruitmentSourceModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, int]): + name (Union[Unset, None, str]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, int] = UNSET + name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + name = self.name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + recruitment_source_model = cls( + id=id, + company_id=company_id, + name=name, + ) + + return recruitment_source_model diff --git a/src/cinode-py-client/cinode_api_client/models/reference_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/reference_block_item_model.py new file mode 100644 index 0000000..14cdd03 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/reference_block_item_model.py @@ -0,0 +1,180 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ReferenceBlockItemModel") + + +@_attrs_define +class ReferenceBlockItemModel: + """ + Attributes: + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + email (Union[Unset, None, str]): + telephone (Union[Unset, None, str]): + company (Union[Unset, None, str]): + position (Union[Unset, None, str]): + text (Union[Unset, None, str]): + work_experience (Union[Unset, None, str]): + work_experience_id (Union[Unset, None, int]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + email: Union[Unset, None, str] = UNSET + telephone: Union[Unset, None, str] = UNSET + company: Union[Unset, None, str] = UNSET + position: Union[Unset, None, str] = UNSET + text: Union[Unset, None, str] = UNSET + work_experience: Union[Unset, None, str] = UNSET + work_experience_id: Union[Unset, None, int] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + first_name = self.first_name + last_name = self.last_name + email = self.email + telephone = self.telephone + company = self.company + position = self.position + text = self.text + work_experience = self.work_experience + work_experience_id = self.work_experience_id + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if email is not UNSET: + field_dict["email"] = email + if telephone is not UNSET: + field_dict["telephone"] = telephone + if company is not UNSET: + field_dict["company"] = company + if position is not UNSET: + field_dict["position"] = position + if text is not UNSET: + field_dict["text"] = text + if work_experience is not UNSET: + field_dict["workExperience"] = work_experience + if work_experience_id is not UNSET: + field_dict["workExperienceId"] = work_experience_id + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + email = d.pop("email", UNSET) + + telephone = d.pop("telephone", UNSET) + + company = d.pop("company", UNSET) + + position = d.pop("position", UNSET) + + text = d.pop("text", UNSET) + + work_experience = d.pop("workExperience", UNSET) + + work_experience_id = d.pop("workExperienceId", UNSET) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + reference_block_item_model = cls( + first_name=first_name, + last_name=last_name, + email=email, + telephone=telephone, + company=company, + position=position, + text=text, + work_experience=work_experience, + work_experience_id=work_experience_id, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return reference_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/reference_block_model.py b/src/cinode-py-client/cinode_api_client/models/reference_block_model.py new file mode 100644 index 0000000..ddb6794 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/reference_block_model.py @@ -0,0 +1,111 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.reference_block_item_model import ReferenceBlockItemModel + + +T = TypeVar("T", bound="ReferenceBlockModel") + + +@_attrs_define +class ReferenceBlockModel: + """ + Attributes: + hide_description (Union[Unset, bool]): + hide_in_edit (Union[Unset, bool]): + data (Union[Unset, None, List['ReferenceBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + hide_description: Union[Unset, bool] = UNSET + hide_in_edit: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["ReferenceBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + hide_description = self.hide_description + hide_in_edit = self.hide_in_edit + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.reference_block_item_model import ReferenceBlockItemModel + + d = src_dict.copy() + hide_description = d.pop("hideDescription", UNSET) + + hide_in_edit = d.pop("hideInEdit", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = ReferenceBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + reference_block_model = cls( + hide_description=hide_description, + hide_in_edit=hide_in_edit, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return reference_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/resume_model.py b/src/cinode-py-client/cinode_api_client/models/resume_model.py new file mode 100644 index 0000000..a085d74 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/resume_model.py @@ -0,0 +1,324 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.commitment_block_model import CommitmentBlockModel + from ..models.education_block_model import EducationBlockModel + from ..models.employer_block_model import EmployerBlockModel + from ..models.extra_skill_block_model import ExtraSkillBlockModel + from ..models.highlighted_work_experience_block_model import HighlightedWorkExperienceBlockModel + from ..models.language_block_model import LanguageBlockModel + from ..models.presentation_block_model import PresentationBlockModel + from ..models.reference_block_model import ReferenceBlockModel + from ..models.skill_by_category_block_model import SkillByCategoryBlockModel + from ..models.skill_model_model import SkillModelModel + from ..models.text_block_model import TextBlockModel + from ..models.top_skill_block_model import TopSkillBlockModel + from ..models.training_block_model import TrainingBlockModel + from ..models.work_experience_block_model import WorkExperienceBlockModel + + +T = TypeVar("T", bound="ResumeModel") + + +@_attrs_define +class ResumeModel: + """ + Attributes: + presentation (Union[Unset, None, PresentationBlockModel]): + highlighted_work_experience (Union[Unset, None, HighlightedWorkExperienceBlockModel]): + skills_by_category (Union[Unset, None, SkillByCategoryBlockModel]): + top_skills (Union[Unset, None, TopSkillBlockModel]): + work_experience (Union[Unset, None, WorkExperienceBlockModel]): + skills (Union[Unset, None, SkillModelModel]): + employer (Union[Unset, None, EmployerBlockModel]): + training (Union[Unset, None, TrainingBlockModel]): + education (Union[Unset, None, EducationBlockModel]): + language (Union[Unset, None, LanguageBlockModel]): + commitment (Union[Unset, None, CommitmentBlockModel]): + extra_skills (Union[Unset, None, ExtraSkillBlockModel]): + reference (Union[Unset, None, ReferenceBlockModel]): + text (Union[Unset, None, TextBlockModel]): + id (Union[Unset, int]): + """ + + presentation: Union[Unset, None, "PresentationBlockModel"] = UNSET + highlighted_work_experience: Union[Unset, None, "HighlightedWorkExperienceBlockModel"] = UNSET + skills_by_category: Union[Unset, None, "SkillByCategoryBlockModel"] = UNSET + top_skills: Union[Unset, None, "TopSkillBlockModel"] = UNSET + work_experience: Union[Unset, None, "WorkExperienceBlockModel"] = UNSET + skills: Union[Unset, None, "SkillModelModel"] = UNSET + employer: Union[Unset, None, "EmployerBlockModel"] = UNSET + training: Union[Unset, None, "TrainingBlockModel"] = UNSET + education: Union[Unset, None, "EducationBlockModel"] = UNSET + language: Union[Unset, None, "LanguageBlockModel"] = UNSET + commitment: Union[Unset, None, "CommitmentBlockModel"] = UNSET + extra_skills: Union[Unset, None, "ExtraSkillBlockModel"] = UNSET + reference: Union[Unset, None, "ReferenceBlockModel"] = UNSET + text: Union[Unset, None, "TextBlockModel"] = UNSET + id: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + presentation: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.presentation, Unset): + presentation = self.presentation.to_dict() if self.presentation else None + + highlighted_work_experience: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.highlighted_work_experience, Unset): + highlighted_work_experience = ( + self.highlighted_work_experience.to_dict() if self.highlighted_work_experience else None + ) + + skills_by_category: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.skills_by_category, Unset): + skills_by_category = self.skills_by_category.to_dict() if self.skills_by_category else None + + top_skills: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.top_skills, Unset): + top_skills = self.top_skills.to_dict() if self.top_skills else None + + work_experience: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.work_experience, Unset): + work_experience = self.work_experience.to_dict() if self.work_experience else None + + skills: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.skills, Unset): + skills = self.skills.to_dict() if self.skills else None + + employer: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.employer, Unset): + employer = self.employer.to_dict() if self.employer else None + + training: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.training, Unset): + training = self.training.to_dict() if self.training else None + + education: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.education, Unset): + education = self.education.to_dict() if self.education else None + + language: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.language, Unset): + language = self.language.to_dict() if self.language else None + + commitment: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.commitment, Unset): + commitment = self.commitment.to_dict() if self.commitment else None + + extra_skills: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.extra_skills, Unset): + extra_skills = self.extra_skills.to_dict() if self.extra_skills else None + + reference: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.reference, Unset): + reference = self.reference.to_dict() if self.reference else None + + text: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.text, Unset): + text = self.text.to_dict() if self.text else None + + id = self.id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if presentation is not UNSET: + field_dict["presentation"] = presentation + if highlighted_work_experience is not UNSET: + field_dict["highlightedWorkExperience"] = highlighted_work_experience + if skills_by_category is not UNSET: + field_dict["skillsByCategory"] = skills_by_category + if top_skills is not UNSET: + field_dict["topSkills"] = top_skills + if work_experience is not UNSET: + field_dict["workExperience"] = work_experience + if skills is not UNSET: + field_dict["skills"] = skills + if employer is not UNSET: + field_dict["employer"] = employer + if training is not UNSET: + field_dict["training"] = training + if education is not UNSET: + field_dict["education"] = education + if language is not UNSET: + field_dict["language"] = language + if commitment is not UNSET: + field_dict["commitment"] = commitment + if extra_skills is not UNSET: + field_dict["extraSkills"] = extra_skills + if reference is not UNSET: + field_dict["reference"] = reference + if text is not UNSET: + field_dict["text"] = text + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.commitment_block_model import CommitmentBlockModel + from ..models.education_block_model import EducationBlockModel + from ..models.employer_block_model import EmployerBlockModel + from ..models.extra_skill_block_model import ExtraSkillBlockModel + from ..models.highlighted_work_experience_block_model import HighlightedWorkExperienceBlockModel + from ..models.language_block_model import LanguageBlockModel + from ..models.presentation_block_model import PresentationBlockModel + from ..models.reference_block_model import ReferenceBlockModel + from ..models.skill_by_category_block_model import SkillByCategoryBlockModel + from ..models.skill_model_model import SkillModelModel + from ..models.text_block_model import TextBlockModel + from ..models.top_skill_block_model import TopSkillBlockModel + from ..models.training_block_model import TrainingBlockModel + from ..models.work_experience_block_model import WorkExperienceBlockModel + + d = src_dict.copy() + _presentation = d.pop("presentation", UNSET) + presentation: Union[Unset, None, PresentationBlockModel] + if _presentation is None: + presentation = None + elif isinstance(_presentation, Unset): + presentation = UNSET + else: + presentation = PresentationBlockModel.from_dict(_presentation) + + _highlighted_work_experience = d.pop("highlightedWorkExperience", UNSET) + highlighted_work_experience: Union[Unset, None, HighlightedWorkExperienceBlockModel] + if _highlighted_work_experience is None: + highlighted_work_experience = None + elif isinstance(_highlighted_work_experience, Unset): + highlighted_work_experience = UNSET + else: + highlighted_work_experience = HighlightedWorkExperienceBlockModel.from_dict(_highlighted_work_experience) + + _skills_by_category = d.pop("skillsByCategory", UNSET) + skills_by_category: Union[Unset, None, SkillByCategoryBlockModel] + if _skills_by_category is None: + skills_by_category = None + elif isinstance(_skills_by_category, Unset): + skills_by_category = UNSET + else: + skills_by_category = SkillByCategoryBlockModel.from_dict(_skills_by_category) + + _top_skills = d.pop("topSkills", UNSET) + top_skills: Union[Unset, None, TopSkillBlockModel] + if _top_skills is None: + top_skills = None + elif isinstance(_top_skills, Unset): + top_skills = UNSET + else: + top_skills = TopSkillBlockModel.from_dict(_top_skills) + + _work_experience = d.pop("workExperience", UNSET) + work_experience: Union[Unset, None, WorkExperienceBlockModel] + if _work_experience is None: + work_experience = None + elif isinstance(_work_experience, Unset): + work_experience = UNSET + else: + work_experience = WorkExperienceBlockModel.from_dict(_work_experience) + + _skills = d.pop("skills", UNSET) + skills: Union[Unset, None, SkillModelModel] + if _skills is None: + skills = None + elif isinstance(_skills, Unset): + skills = UNSET + else: + skills = SkillModelModel.from_dict(_skills) + + _employer = d.pop("employer", UNSET) + employer: Union[Unset, None, EmployerBlockModel] + if _employer is None: + employer = None + elif isinstance(_employer, Unset): + employer = UNSET + else: + employer = EmployerBlockModel.from_dict(_employer) + + _training = d.pop("training", UNSET) + training: Union[Unset, None, TrainingBlockModel] + if _training is None: + training = None + elif isinstance(_training, Unset): + training = UNSET + else: + training = TrainingBlockModel.from_dict(_training) + + _education = d.pop("education", UNSET) + education: Union[Unset, None, EducationBlockModel] + if _education is None: + education = None + elif isinstance(_education, Unset): + education = UNSET + else: + education = EducationBlockModel.from_dict(_education) + + _language = d.pop("language", UNSET) + language: Union[Unset, None, LanguageBlockModel] + if _language is None: + language = None + elif isinstance(_language, Unset): + language = UNSET + else: + language = LanguageBlockModel.from_dict(_language) + + _commitment = d.pop("commitment", UNSET) + commitment: Union[Unset, None, CommitmentBlockModel] + if _commitment is None: + commitment = None + elif isinstance(_commitment, Unset): + commitment = UNSET + else: + commitment = CommitmentBlockModel.from_dict(_commitment) + + _extra_skills = d.pop("extraSkills", UNSET) + extra_skills: Union[Unset, None, ExtraSkillBlockModel] + if _extra_skills is None: + extra_skills = None + elif isinstance(_extra_skills, Unset): + extra_skills = UNSET + else: + extra_skills = ExtraSkillBlockModel.from_dict(_extra_skills) + + _reference = d.pop("reference", UNSET) + reference: Union[Unset, None, ReferenceBlockModel] + if _reference is None: + reference = None + elif isinstance(_reference, Unset): + reference = UNSET + else: + reference = ReferenceBlockModel.from_dict(_reference) + + _text = d.pop("text", UNSET) + text: Union[Unset, None, TextBlockModel] + if _text is None: + text = None + elif isinstance(_text, Unset): + text = UNSET + else: + text = TextBlockModel.from_dict(_text) + + id = d.pop("id", UNSET) + + resume_model = cls( + presentation=presentation, + highlighted_work_experience=highlighted_work_experience, + skills_by_category=skills_by_category, + top_skills=top_skills, + work_experience=work_experience, + skills=skills, + employer=employer, + training=training, + education=education, + language=language, + commitment=commitment, + extra_skills=extra_skills, + reference=reference, + text=text, + id=id, + ) + + return resume_model diff --git a/src/cinode-py-client/cinode_api_client/models/role_model.py b/src/cinode-py-client/cinode_api_client/models/role_model.py new file mode 100644 index 0000000..4abc63a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/role_model.py @@ -0,0 +1,100 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.access_level import AccessLevel +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RoleModel") + + +@_attrs_define +class RoleModel: + """ + Attributes: + id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + level (Union[Unset, None, AccessLevel]): + + NoAccess = 0 + + Anonymous = 50 + + Read = 100 + + Subcontractor = 110 + + Candidate = 115 + + RestrictedCompanyUser = 150 + + CompanyApiUser = 180 + + CompanyUser = 200 + + PartnerManager = 240 + + CompanyRecruiter = 250 + + TeamManager = 270 + + CompanyManager = 300 + + CompanyAdmin = 400 + + Owner = 500 + """ + + id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + level: Union[Unset, None, AccessLevel] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + name = self.name + description = self.description + level: Union[Unset, None, int] = UNSET + if not isinstance(self.level, Unset): + level = self.level.value if self.level else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if level is not UNSET: + field_dict["level"] = level + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + id = d.pop("id", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + _level = d.pop("level", UNSET) + level: Union[Unset, None, AccessLevel] + if _level is None: + level = None + elif isinstance(_level, Unset): + level = UNSET + else: + level = AccessLevel(_level) + + role_model = cls( + id=id, + name=name, + description=description, + level=level, + ) + + return role_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_candidate_query_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_candidate_query_model.py new file mode 100644 index 0000000..51dc7ed --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_candidate_query_model.py @@ -0,0 +1,153 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.company_candidate_state import CompanyCandidateState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_candidate_query_sort_page_and_sort_by_model import CompanyCandidateQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchCompanyCandidateQueryModel") + + +@_attrs_define +class SearchCompanyCandidateQueryModel: + """ + Attributes: + term (Union[Unset, None, str]): + rating (Union[Unset, None, int]): + states (Union[Unset, None, List[CompanyCandidateState]]): + pipeline (Union[Unset, None, int]): + no_recruiter (Union[Unset, bool]): + recruiters (Union[Unset, None, List[int]]): + teams (Union[Unset, None, List[int]]): + sources (Union[Unset, None, List[int]]): + page_and_sort_by (Union[Unset, None, CompanyCandidateQuerySortPageAndSortByModel]): + """ + + term: Union[Unset, None, str] = UNSET + rating: Union[Unset, None, int] = UNSET + states: Union[Unset, None, List[CompanyCandidateState]] = UNSET + pipeline: Union[Unset, None, int] = UNSET + no_recruiter: Union[Unset, bool] = UNSET + recruiters: Union[Unset, None, List[int]] = UNSET + teams: Union[Unset, None, List[int]] = UNSET + sources: Union[Unset, None, List[int]] = UNSET + page_and_sort_by: Union[Unset, None, "CompanyCandidateQuerySortPageAndSortByModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + term = self.term + rating = self.rating + states: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.states, Unset): + if self.states is None: + states = None + else: + states = [] + for states_item_data in self.states: + states_item = states_item_data.value + + states.append(states_item) + + pipeline = self.pipeline + no_recruiter = self.no_recruiter + recruiters: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.recruiters, Unset): + if self.recruiters is None: + recruiters = None + else: + recruiters = self.recruiters + + teams: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.teams, Unset): + if self.teams is None: + teams = None + else: + teams = self.teams + + sources: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.sources, Unset): + if self.sources is None: + sources = None + else: + sources = self.sources + + page_and_sort_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.page_and_sort_by, Unset): + page_and_sort_by = self.page_and_sort_by.to_dict() if self.page_and_sort_by else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if term is not UNSET: + field_dict["term"] = term + if rating is not UNSET: + field_dict["rating"] = rating + if states is not UNSET: + field_dict["states"] = states + if pipeline is not UNSET: + field_dict["pipeline"] = pipeline + if no_recruiter is not UNSET: + field_dict["noRecruiter"] = no_recruiter + if recruiters is not UNSET: + field_dict["recruiters"] = recruiters + if teams is not UNSET: + field_dict["teams"] = teams + if sources is not UNSET: + field_dict["sources"] = sources + if page_and_sort_by is not UNSET: + field_dict["pageAndSortBy"] = page_and_sort_by + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_candidate_query_sort_page_and_sort_by_model import ( + CompanyCandidateQuerySortPageAndSortByModel, + ) + + d = src_dict.copy() + term = d.pop("term", UNSET) + + rating = d.pop("rating", UNSET) + + states = [] + _states = d.pop("states", UNSET) + for states_item_data in _states or []: + states_item = CompanyCandidateState(states_item_data) + + states.append(states_item) + + pipeline = d.pop("pipeline", UNSET) + + no_recruiter = d.pop("noRecruiter", UNSET) + + recruiters = cast(List[int], d.pop("recruiters", UNSET)) + + teams = cast(List[int], d.pop("teams", UNSET)) + + sources = cast(List[int], d.pop("sources", UNSET)) + + _page_and_sort_by = d.pop("pageAndSortBy", UNSET) + page_and_sort_by: Union[Unset, None, CompanyCandidateQuerySortPageAndSortByModel] + if _page_and_sort_by is None: + page_and_sort_by = None + elif isinstance(_page_and_sort_by, Unset): + page_and_sort_by = UNSET + else: + page_and_sort_by = CompanyCandidateQuerySortPageAndSortByModel.from_dict(_page_and_sort_by) + + search_company_candidate_query_model = cls( + term=term, + rating=rating, + states=states, + pipeline=pipeline, + no_recruiter=no_recruiter, + recruiters=recruiters, + teams=teams, + sources=sources, + page_and_sort_by=page_and_sort_by, + ) + + return search_company_candidate_query_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_candidate_result_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_candidate_result_model.py new file mode 100644 index 0000000..28c3623 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_candidate_result_model.py @@ -0,0 +1,97 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_candidate_base_model import CompanyCandidateBaseModel + from ..models.company_candidate_query_sort_page_and_sort_by_model import CompanyCandidateQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchCompanyCandidateResultModel") + + +@_attrs_define +class SearchCompanyCandidateResultModel: + """ + Attributes: + paged_and_sorted_by (Union[Unset, None, CompanyCandidateQuerySortPageAndSortByModel]): + result (Union[Unset, None, List['CompanyCandidateBaseModel']]): + hits (Union[Unset, int]): + total_items (Union[Unset, int]): + """ + + paged_and_sorted_by: Union[Unset, None, "CompanyCandidateQuerySortPageAndSortByModel"] = UNSET + result: Union[Unset, None, List["CompanyCandidateBaseModel"]] = UNSET + hits: Union[Unset, int] = UNSET + total_items: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + paged_and_sorted_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.paged_and_sorted_by, Unset): + paged_and_sorted_by = self.paged_and_sorted_by.to_dict() if self.paged_and_sorted_by else None + + result: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.result, Unset): + if self.result is None: + result = None + else: + result = [] + for result_item_data in self.result: + result_item = result_item_data.to_dict() + + result.append(result_item) + + hits = self.hits + total_items = self.total_items + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if paged_and_sorted_by is not UNSET: + field_dict["pagedAndSortedBy"] = paged_and_sorted_by + if result is not UNSET: + field_dict["result"] = result + if hits is not UNSET: + field_dict["hits"] = hits + if total_items is not UNSET: + field_dict["totalItems"] = total_items + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_candidate_base_model import CompanyCandidateBaseModel + from ..models.company_candidate_query_sort_page_and_sort_by_model import ( + CompanyCandidateQuerySortPageAndSortByModel, + ) + + d = src_dict.copy() + _paged_and_sorted_by = d.pop("pagedAndSortedBy", UNSET) + paged_and_sorted_by: Union[Unset, None, CompanyCandidateQuerySortPageAndSortByModel] + if _paged_and_sorted_by is None: + paged_and_sorted_by = None + elif isinstance(_paged_and_sorted_by, Unset): + paged_and_sorted_by = UNSET + else: + paged_and_sorted_by = CompanyCandidateQuerySortPageAndSortByModel.from_dict(_paged_and_sorted_by) + + result = [] + _result = d.pop("result", UNSET) + for result_item_data in _result or []: + result_item = CompanyCandidateBaseModel.from_dict(result_item_data) + + result.append(result_item) + + hits = d.pop("hits", UNSET) + + total_items = d.pop("totalItems", UNSET) + + search_company_candidate_result_model = cls( + paged_and_sorted_by=paged_and_sorted_by, + result=result, + hits=hits, + total_items=total_items, + ) + + return search_company_candidate_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_query_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_query_model.py new file mode 100644 index 0000000..9c39657 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_query_model.py @@ -0,0 +1,107 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_contact_query_sort_page_and_sort_by_model import ( + CompanyCustomerContactQuerySortPageAndSortByModel, + ) + + +T = TypeVar("T", bound="SearchCompanyCustomerContactQueryModel") + + +@_attrs_define +class SearchCompanyCustomerContactQueryModel: + """ + Attributes: + term (Union[Unset, None, str]): + managers (Union[Unset, None, List[int]]): + customers (Union[Unset, None, List[int]]): + tags (Union[Unset, None, List[int]]): + page_and_sort_by (Union[Unset, None, CompanyCustomerContactQuerySortPageAndSortByModel]): + """ + + term: Union[Unset, None, str] = UNSET + managers: Union[Unset, None, List[int]] = UNSET + customers: Union[Unset, None, List[int]] = UNSET + tags: Union[Unset, None, List[int]] = UNSET + page_and_sort_by: Union[Unset, None, "CompanyCustomerContactQuerySortPageAndSortByModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + term = self.term + managers: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.managers, Unset): + if self.managers is None: + managers = None + else: + managers = self.managers + + customers: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.customers, Unset): + if self.customers is None: + customers = None + else: + customers = self.customers + + tags: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.tags, Unset): + if self.tags is None: + tags = None + else: + tags = self.tags + + page_and_sort_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.page_and_sort_by, Unset): + page_and_sort_by = self.page_and_sort_by.to_dict() if self.page_and_sort_by else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if term is not UNSET: + field_dict["term"] = term + if managers is not UNSET: + field_dict["managers"] = managers + if customers is not UNSET: + field_dict["customers"] = customers + if tags is not UNSET: + field_dict["tags"] = tags + if page_and_sort_by is not UNSET: + field_dict["pageAndSortBy"] = page_and_sort_by + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_contact_query_sort_page_and_sort_by_model import ( + CompanyCustomerContactQuerySortPageAndSortByModel, + ) + + d = src_dict.copy() + term = d.pop("term", UNSET) + + managers = cast(List[int], d.pop("managers", UNSET)) + + customers = cast(List[int], d.pop("customers", UNSET)) + + tags = cast(List[int], d.pop("tags", UNSET)) + + _page_and_sort_by = d.pop("pageAndSortBy", UNSET) + page_and_sort_by: Union[Unset, None, CompanyCustomerContactQuerySortPageAndSortByModel] + if _page_and_sort_by is None: + page_and_sort_by = None + elif isinstance(_page_and_sort_by, Unset): + page_and_sort_by = UNSET + else: + page_and_sort_by = CompanyCustomerContactQuerySortPageAndSortByModel.from_dict(_page_and_sort_by) + + search_company_customer_contact_query_model = cls( + term=term, + managers=managers, + customers=customers, + tags=tags, + page_and_sort_by=page_and_sort_by, + ) + + return search_company_customer_contact_query_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_result_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_result_model.py new file mode 100644 index 0000000..6618d9e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_customer_contact_result_model.py @@ -0,0 +1,99 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_contact_model import CompanyCustomerContactModel + from ..models.company_customer_contact_query_sort_page_and_sort_by_model import ( + CompanyCustomerContactQuerySortPageAndSortByModel, + ) + + +T = TypeVar("T", bound="SearchCompanyCustomerContactResultModel") + + +@_attrs_define +class SearchCompanyCustomerContactResultModel: + """ + Attributes: + paged_and_sorted_by (Union[Unset, None, CompanyCustomerContactQuerySortPageAndSortByModel]): + result (Union[Unset, None, List['CompanyCustomerContactModel']]): + hits (Union[Unset, int]): + total_items (Union[Unset, int]): + """ + + paged_and_sorted_by: Union[Unset, None, "CompanyCustomerContactQuerySortPageAndSortByModel"] = UNSET + result: Union[Unset, None, List["CompanyCustomerContactModel"]] = UNSET + hits: Union[Unset, int] = UNSET + total_items: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + paged_and_sorted_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.paged_and_sorted_by, Unset): + paged_and_sorted_by = self.paged_and_sorted_by.to_dict() if self.paged_and_sorted_by else None + + result: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.result, Unset): + if self.result is None: + result = None + else: + result = [] + for result_item_data in self.result: + result_item = result_item_data.to_dict() + + result.append(result_item) + + hits = self.hits + total_items = self.total_items + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if paged_and_sorted_by is not UNSET: + field_dict["pagedAndSortedBy"] = paged_and_sorted_by + if result is not UNSET: + field_dict["result"] = result + if hits is not UNSET: + field_dict["hits"] = hits + if total_items is not UNSET: + field_dict["totalItems"] = total_items + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_contact_model import CompanyCustomerContactModel + from ..models.company_customer_contact_query_sort_page_and_sort_by_model import ( + CompanyCustomerContactQuerySortPageAndSortByModel, + ) + + d = src_dict.copy() + _paged_and_sorted_by = d.pop("pagedAndSortedBy", UNSET) + paged_and_sorted_by: Union[Unset, None, CompanyCustomerContactQuerySortPageAndSortByModel] + if _paged_and_sorted_by is None: + paged_and_sorted_by = None + elif isinstance(_paged_and_sorted_by, Unset): + paged_and_sorted_by = UNSET + else: + paged_and_sorted_by = CompanyCustomerContactQuerySortPageAndSortByModel.from_dict(_paged_and_sorted_by) + + result = [] + _result = d.pop("result", UNSET) + for result_item_data in _result or []: + result_item = CompanyCustomerContactModel.from_dict(result_item_data) + + result.append(result_item) + + hits = d.pop("hits", UNSET) + + total_items = d.pop("totalItems", UNSET) + + search_company_customer_contact_result_model = cls( + paged_and_sorted_by=paged_and_sorted_by, + result=result, + hits=hits, + total_items=total_items, + ) + + return search_company_customer_contact_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_customer_query_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_customer_query_model.py new file mode 100644 index 0000000..fa4931b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_customer_query_model.py @@ -0,0 +1,152 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.string_comparison_operator import StringComparisonOperator +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_query_sort_page_and_sort_by_model import CompanyCustomerQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchCompanyCustomerQueryModel") + + +@_attrs_define +class SearchCompanyCustomerQueryModel: + """ + Attributes: + name (Union[Unset, None, str]): + name_operator (Union[Unset, StringComparisonOperator]): + + Contains = 0 + + StartsWith = 1 + + EndsWith = 2 + + Equals = 3 + identification (Union[Unset, None, str]): + identification_operator (Union[Unset, StringComparisonOperator]): + + Contains = 0 + + StartsWith = 1 + + EndsWith = 2 + + Equals = 3 + corporate_identity_number (Union[Unset, None, str]): + corporate_identity_number_operator (Union[Unset, StringComparisonOperator]): + + Contains = 0 + + StartsWith = 1 + + EndsWith = 2 + + Equals = 3 + page_and_sort_by (Union[Unset, None, CompanyCustomerQuerySortPageAndSortByModel]): + """ + + name: Union[Unset, None, str] = UNSET + name_operator: Union[Unset, StringComparisonOperator] = UNSET + identification: Union[Unset, None, str] = UNSET + identification_operator: Union[Unset, StringComparisonOperator] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + corporate_identity_number_operator: Union[Unset, StringComparisonOperator] = UNSET + page_and_sort_by: Union[Unset, None, "CompanyCustomerQuerySortPageAndSortByModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + name_operator: Union[Unset, int] = UNSET + if not isinstance(self.name_operator, Unset): + name_operator = self.name_operator.value + + identification = self.identification + identification_operator: Union[Unset, int] = UNSET + if not isinstance(self.identification_operator, Unset): + identification_operator = self.identification_operator.value + + corporate_identity_number = self.corporate_identity_number + corporate_identity_number_operator: Union[Unset, int] = UNSET + if not isinstance(self.corporate_identity_number_operator, Unset): + corporate_identity_number_operator = self.corporate_identity_number_operator.value + + page_and_sort_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.page_and_sort_by, Unset): + page_and_sort_by = self.page_and_sort_by.to_dict() if self.page_and_sort_by else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if name_operator is not UNSET: + field_dict["nameOperator"] = name_operator + if identification is not UNSET: + field_dict["identification"] = identification + if identification_operator is not UNSET: + field_dict["identificationOperator"] = identification_operator + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if corporate_identity_number_operator is not UNSET: + field_dict["corporateIdentityNumberOperator"] = corporate_identity_number_operator + if page_and_sort_by is not UNSET: + field_dict["pageAndSortBy"] = page_and_sort_by + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_query_sort_page_and_sort_by_model import ( + CompanyCustomerQuerySortPageAndSortByModel, + ) + + d = src_dict.copy() + name = d.pop("name", UNSET) + + _name_operator = d.pop("nameOperator", UNSET) + name_operator: Union[Unset, StringComparisonOperator] + if isinstance(_name_operator, Unset): + name_operator = UNSET + else: + name_operator = StringComparisonOperator(_name_operator) + + identification = d.pop("identification", UNSET) + + _identification_operator = d.pop("identificationOperator", UNSET) + identification_operator: Union[Unset, StringComparisonOperator] + if isinstance(_identification_operator, Unset): + identification_operator = UNSET + else: + identification_operator = StringComparisonOperator(_identification_operator) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + _corporate_identity_number_operator = d.pop("corporateIdentityNumberOperator", UNSET) + corporate_identity_number_operator: Union[Unset, StringComparisonOperator] + if isinstance(_corporate_identity_number_operator, Unset): + corporate_identity_number_operator = UNSET + else: + corporate_identity_number_operator = StringComparisonOperator(_corporate_identity_number_operator) + + _page_and_sort_by = d.pop("pageAndSortBy", UNSET) + page_and_sort_by: Union[Unset, None, CompanyCustomerQuerySortPageAndSortByModel] + if _page_and_sort_by is None: + page_and_sort_by = None + elif isinstance(_page_and_sort_by, Unset): + page_and_sort_by = UNSET + else: + page_and_sort_by = CompanyCustomerQuerySortPageAndSortByModel.from_dict(_page_and_sort_by) + + search_company_customer_query_model = cls( + name=name, + name_operator=name_operator, + identification=identification, + identification_operator=identification_operator, + corporate_identity_number=corporate_identity_number, + corporate_identity_number_operator=corporate_identity_number_operator, + page_and_sort_by=page_and_sort_by, + ) + + return search_company_customer_query_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_customer_result_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_customer_result_model.py new file mode 100644 index 0000000..2ee7784 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_customer_result_model.py @@ -0,0 +1,97 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.company_customer_query_sort_page_and_sort_by_model import CompanyCustomerQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchCompanyCustomerResultModel") + + +@_attrs_define +class SearchCompanyCustomerResultModel: + """ + Attributes: + paged_and_sorted_by (Union[Unset, None, CompanyCustomerQuerySortPageAndSortByModel]): + result (Union[Unset, None, List['CompanyCustomerBaseModel']]): + hits (Union[Unset, int]): + total_items (Union[Unset, int]): + """ + + paged_and_sorted_by: Union[Unset, None, "CompanyCustomerQuerySortPageAndSortByModel"] = UNSET + result: Union[Unset, None, List["CompanyCustomerBaseModel"]] = UNSET + hits: Union[Unset, int] = UNSET + total_items: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + paged_and_sorted_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.paged_and_sorted_by, Unset): + paged_and_sorted_by = self.paged_and_sorted_by.to_dict() if self.paged_and_sorted_by else None + + result: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.result, Unset): + if self.result is None: + result = None + else: + result = [] + for result_item_data in self.result: + result_item = result_item_data.to_dict() + + result.append(result_item) + + hits = self.hits + total_items = self.total_items + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if paged_and_sorted_by is not UNSET: + field_dict["pagedAndSortedBy"] = paged_and_sorted_by + if result is not UNSET: + field_dict["result"] = result + if hits is not UNSET: + field_dict["hits"] = hits + if total_items is not UNSET: + field_dict["totalItems"] = total_items + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_customer_base_model import CompanyCustomerBaseModel + from ..models.company_customer_query_sort_page_and_sort_by_model import ( + CompanyCustomerQuerySortPageAndSortByModel, + ) + + d = src_dict.copy() + _paged_and_sorted_by = d.pop("pagedAndSortedBy", UNSET) + paged_and_sorted_by: Union[Unset, None, CompanyCustomerQuerySortPageAndSortByModel] + if _paged_and_sorted_by is None: + paged_and_sorted_by = None + elif isinstance(_paged_and_sorted_by, Unset): + paged_and_sorted_by = UNSET + else: + paged_and_sorted_by = CompanyCustomerQuerySortPageAndSortByModel.from_dict(_paged_and_sorted_by) + + result = [] + _result = d.pop("result", UNSET) + for result_item_data in _result or []: + result_item = CompanyCustomerBaseModel.from_dict(result_item_data) + + result.append(result_item) + + hits = d.pop("hits", UNSET) + + total_items = d.pop("totalItems", UNSET) + + search_company_customer_result_model = cls( + paged_and_sorted_by=paged_and_sorted_by, + result=result, + hits=hits, + total_items=total_items, + ) + + return search_company_customer_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_user_query_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_user_query_model.py new file mode 100644 index 0000000..8fe8d6b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_user_query_model.py @@ -0,0 +1,69 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_query_sort_page_and_sort_by_model import CompanyUserQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchCompanyUserQueryModel") + + +@_attrs_define +class SearchCompanyUserQueryModel: + """ + Attributes: + term (Union[Unset, None, str]): + include_disconnected (Union[Unset, bool]): + page_and_sort_by (Union[Unset, None, CompanyUserQuerySortPageAndSortByModel]): + """ + + term: Union[Unset, None, str] = UNSET + include_disconnected: Union[Unset, bool] = UNSET + page_and_sort_by: Union[Unset, None, "CompanyUserQuerySortPageAndSortByModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + term = self.term + include_disconnected = self.include_disconnected + page_and_sort_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.page_and_sort_by, Unset): + page_and_sort_by = self.page_and_sort_by.to_dict() if self.page_and_sort_by else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if term is not UNSET: + field_dict["term"] = term + if include_disconnected is not UNSET: + field_dict["includeDisconnected"] = include_disconnected + if page_and_sort_by is not UNSET: + field_dict["pageAndSortBy"] = page_and_sort_by + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_query_sort_page_and_sort_by_model import CompanyUserQuerySortPageAndSortByModel + + d = src_dict.copy() + term = d.pop("term", UNSET) + + include_disconnected = d.pop("includeDisconnected", UNSET) + + _page_and_sort_by = d.pop("pageAndSortBy", UNSET) + page_and_sort_by: Union[Unset, None, CompanyUserQuerySortPageAndSortByModel] + if _page_and_sort_by is None: + page_and_sort_by = None + elif isinstance(_page_and_sort_by, Unset): + page_and_sort_by = UNSET + else: + page_and_sort_by = CompanyUserQuerySortPageAndSortByModel.from_dict(_page_and_sort_by) + + search_company_user_query_model = cls( + term=term, + include_disconnected=include_disconnected, + page_and_sort_by=page_and_sort_by, + ) + + return search_company_user_query_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_company_user_result_model.py b/src/cinode-py-client/cinode_api_client/models/search_company_user_result_model.py new file mode 100644 index 0000000..ecb9f93 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_company_user_result_model.py @@ -0,0 +1,95 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_extended_model import CompanyUserExtendedModel + from ..models.company_user_query_sort_page_and_sort_by_model import CompanyUserQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchCompanyUserResultModel") + + +@_attrs_define +class SearchCompanyUserResultModel: + """ + Attributes: + paged_and_sorted_by (Union[Unset, None, CompanyUserQuerySortPageAndSortByModel]): + result (Union[Unset, None, List['CompanyUserExtendedModel']]): + hits (Union[Unset, int]): + total_items (Union[Unset, int]): + """ + + paged_and_sorted_by: Union[Unset, None, "CompanyUserQuerySortPageAndSortByModel"] = UNSET + result: Union[Unset, None, List["CompanyUserExtendedModel"]] = UNSET + hits: Union[Unset, int] = UNSET + total_items: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + paged_and_sorted_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.paged_and_sorted_by, Unset): + paged_and_sorted_by = self.paged_and_sorted_by.to_dict() if self.paged_and_sorted_by else None + + result: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.result, Unset): + if self.result is None: + result = None + else: + result = [] + for result_item_data in self.result: + result_item = result_item_data.to_dict() + + result.append(result_item) + + hits = self.hits + total_items = self.total_items + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if paged_and_sorted_by is not UNSET: + field_dict["pagedAndSortedBy"] = paged_and_sorted_by + if result is not UNSET: + field_dict["result"] = result + if hits is not UNSET: + field_dict["hits"] = hits + if total_items is not UNSET: + field_dict["totalItems"] = total_items + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_extended_model import CompanyUserExtendedModel + from ..models.company_user_query_sort_page_and_sort_by_model import CompanyUserQuerySortPageAndSortByModel + + d = src_dict.copy() + _paged_and_sorted_by = d.pop("pagedAndSortedBy", UNSET) + paged_and_sorted_by: Union[Unset, None, CompanyUserQuerySortPageAndSortByModel] + if _paged_and_sorted_by is None: + paged_and_sorted_by = None + elif isinstance(_paged_and_sorted_by, Unset): + paged_and_sorted_by = UNSET + else: + paged_and_sorted_by = CompanyUserQuerySortPageAndSortByModel.from_dict(_paged_and_sorted_by) + + result = [] + _result = d.pop("result", UNSET) + for result_item_data in _result or []: + result_item = CompanyUserExtendedModel.from_dict(result_item_data) + + result.append(result_item) + + hits = d.pop("hits", UNSET) + + total_items = d.pop("totalItems", UNSET) + + search_company_user_result_model = cls( + paged_and_sorted_by=paged_and_sorted_by, + result=result, + hits=hits, + total_items=total_items, + ) + + return search_company_user_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_project_query_model.py b/src/cinode-py-client/cinode_api_client/models/search_project_query_model.py new file mode 100644 index 0000000..0981ad5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_project_query_model.py @@ -0,0 +1,178 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union, cast + +from attrs import define as _attrs_define + +from ..models.project_state import ProjectState +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.project_query_sort_page_and_sort_by_model import ProjectQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchProjectQueryModel") + + +@_attrs_define +class SearchProjectQueryModel: + """ + Attributes: + title (Union[Unset, None, str]): + identification (Union[Unset, None, str]): + customer_identifier (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + customer_id (Union[Unset, None, int]): + page_and_sort_by (Union[Unset, None, ProjectQuerySortPageAndSortByModel]): + pipelines (Union[Unset, None, List[int]]): Your Project Pipelines can be retrieved from the GET ProjectPipelines + endpoint + sales_managers (Union[Unset, None, List[int]]): + customers (Union[Unset, None, List[int]]): + intermediators (Union[Unset, None, List[int]]): + project_states (Union[Unset, None, List[ProjectState]]): Open = 0, + Won = 30, + Lost = 40, + Abandoned = 50, + Suspended = 60 + """ + + title: Union[Unset, None, str] = UNSET + identification: Union[Unset, None, str] = UNSET + customer_identifier: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + customer_id: Union[Unset, None, int] = UNSET + page_and_sort_by: Union[Unset, None, "ProjectQuerySortPageAndSortByModel"] = UNSET + pipelines: Union[Unset, None, List[int]] = UNSET + sales_managers: Union[Unset, None, List[int]] = UNSET + customers: Union[Unset, None, List[int]] = UNSET + intermediators: Union[Unset, None, List[int]] = UNSET + project_states: Union[Unset, None, List[ProjectState]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + title = self.title + identification = self.identification + customer_identifier = self.customer_identifier + corporate_identity_number = self.corporate_identity_number + customer_id = self.customer_id + page_and_sort_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.page_and_sort_by, Unset): + page_and_sort_by = self.page_and_sort_by.to_dict() if self.page_and_sort_by else None + + pipelines: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.pipelines, Unset): + if self.pipelines is None: + pipelines = None + else: + pipelines = self.pipelines + + sales_managers: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.sales_managers, Unset): + if self.sales_managers is None: + sales_managers = None + else: + sales_managers = self.sales_managers + + customers: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.customers, Unset): + if self.customers is None: + customers = None + else: + customers = self.customers + + intermediators: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.intermediators, Unset): + if self.intermediators is None: + intermediators = None + else: + intermediators = self.intermediators + + project_states: Union[Unset, None, List[int]] = UNSET + if not isinstance(self.project_states, Unset): + if self.project_states is None: + project_states = None + else: + project_states = [] + for project_states_item_data in self.project_states: + project_states_item = project_states_item_data.value + + project_states.append(project_states_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if identification is not UNSET: + field_dict["identification"] = identification + if customer_identifier is not UNSET: + field_dict["customerIdentifier"] = customer_identifier + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if customer_id is not UNSET: + field_dict["customerId"] = customer_id + if page_and_sort_by is not UNSET: + field_dict["pageAndSortBy"] = page_and_sort_by + if pipelines is not UNSET: + field_dict["pipelines"] = pipelines + if sales_managers is not UNSET: + field_dict["salesManagers"] = sales_managers + if customers is not UNSET: + field_dict["customers"] = customers + if intermediators is not UNSET: + field_dict["intermediators"] = intermediators + if project_states is not UNSET: + field_dict["projectStates"] = project_states + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.project_query_sort_page_and_sort_by_model import ProjectQuerySortPageAndSortByModel + + d = src_dict.copy() + title = d.pop("title", UNSET) + + identification = d.pop("identification", UNSET) + + customer_identifier = d.pop("customerIdentifier", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + customer_id = d.pop("customerId", UNSET) + + _page_and_sort_by = d.pop("pageAndSortBy", UNSET) + page_and_sort_by: Union[Unset, None, ProjectQuerySortPageAndSortByModel] + if _page_and_sort_by is None: + page_and_sort_by = None + elif isinstance(_page_and_sort_by, Unset): + page_and_sort_by = UNSET + else: + page_and_sort_by = ProjectQuerySortPageAndSortByModel.from_dict(_page_and_sort_by) + + pipelines = cast(List[int], d.pop("pipelines", UNSET)) + + sales_managers = cast(List[int], d.pop("salesManagers", UNSET)) + + customers = cast(List[int], d.pop("customers", UNSET)) + + intermediators = cast(List[int], d.pop("intermediators", UNSET)) + + project_states = [] + _project_states = d.pop("projectStates", UNSET) + for project_states_item_data in _project_states or []: + project_states_item = ProjectState(project_states_item_data) + + project_states.append(project_states_item) + + search_project_query_model = cls( + title=title, + identification=identification, + customer_identifier=customer_identifier, + corporate_identity_number=corporate_identity_number, + customer_id=customer_id, + page_and_sort_by=page_and_sort_by, + pipelines=pipelines, + sales_managers=sales_managers, + customers=customers, + intermediators=intermediators, + project_states=project_states, + ) + + return search_project_query_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_projects_result_model.py b/src/cinode-py-client/cinode_api_client/models/search_projects_result_model.py new file mode 100644 index 0000000..126010a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_projects_result_model.py @@ -0,0 +1,95 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.project_base_model import ProjectBaseModel + from ..models.project_query_sort_page_and_sort_by_model import ProjectQuerySortPageAndSortByModel + + +T = TypeVar("T", bound="SearchProjectsResultModel") + + +@_attrs_define +class SearchProjectsResultModel: + """ + Attributes: + paged_and_sorted_by (Union[Unset, None, ProjectQuerySortPageAndSortByModel]): + result (Union[Unset, None, List['ProjectBaseModel']]): + hits (Union[Unset, int]): + total_items (Union[Unset, int]): + """ + + paged_and_sorted_by: Union[Unset, None, "ProjectQuerySortPageAndSortByModel"] = UNSET + result: Union[Unset, None, List["ProjectBaseModel"]] = UNSET + hits: Union[Unset, int] = UNSET + total_items: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + paged_and_sorted_by: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.paged_and_sorted_by, Unset): + paged_and_sorted_by = self.paged_and_sorted_by.to_dict() if self.paged_and_sorted_by else None + + result: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.result, Unset): + if self.result is None: + result = None + else: + result = [] + for result_item_data in self.result: + result_item = result_item_data.to_dict() + + result.append(result_item) + + hits = self.hits + total_items = self.total_items + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if paged_and_sorted_by is not UNSET: + field_dict["pagedAndSortedBy"] = paged_and_sorted_by + if result is not UNSET: + field_dict["result"] = result + if hits is not UNSET: + field_dict["hits"] = hits + if total_items is not UNSET: + field_dict["totalItems"] = total_items + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.project_base_model import ProjectBaseModel + from ..models.project_query_sort_page_and_sort_by_model import ProjectQuerySortPageAndSortByModel + + d = src_dict.copy() + _paged_and_sorted_by = d.pop("pagedAndSortedBy", UNSET) + paged_and_sorted_by: Union[Unset, None, ProjectQuerySortPageAndSortByModel] + if _paged_and_sorted_by is None: + paged_and_sorted_by = None + elif isinstance(_paged_and_sorted_by, Unset): + paged_and_sorted_by = UNSET + else: + paged_and_sorted_by = ProjectQuerySortPageAndSortByModel.from_dict(_paged_and_sorted_by) + + result = [] + _result = d.pop("result", UNSET) + for result_item_data in _result or []: + result_item = ProjectBaseModel.from_dict(result_item_data) + + result.append(result_item) + + hits = d.pop("hits", UNSET) + + total_items = d.pop("totalItems", UNSET) + + search_projects_result_model = cls( + paged_and_sorted_by=paged_and_sorted_by, + result=result, + hits=hits, + total_items=total_items, + ) + + return search_projects_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_skill_model.py b/src/cinode-py-client/cinode_api_client/models/search_skill_model.py new file mode 100644 index 0000000..014b0ea --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_skill_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SearchSkillModel") + + +@_attrs_define +class SearchSkillModel: + """ + Attributes: + keyword_id (Union[Unset, None, int]): + min_ (Union[Unset, None, int]): + max_ (Union[Unset, None, int]): + """ + + keyword_id: Union[Unset, None, int] = UNSET + min_: Union[Unset, None, int] = UNSET + max_: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_id = self.keyword_id + min_ = self.min_ + max_ = self.max_ + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if min_ is not UNSET: + field_dict["min"] = min_ + if max_ is not UNSET: + field_dict["max"] = max_ + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + keyword_id = d.pop("keywordId", UNSET) + + min_ = d.pop("min", UNSET) + + max_ = d.pop("max", UNSET) + + search_skill_model = cls( + keyword_id=keyword_id, + min_=min_, + max_=max_, + ) + + return search_skill_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_skill_query_model.py b/src/cinode-py-client/cinode_api_client/models/search_skill_query_model.py new file mode 100644 index 0000000..0eeadc5 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_skill_query_model.py @@ -0,0 +1,83 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.filter_model import FilterModel + from ..models.search_skill_model import SearchSkillModel + + +T = TypeVar("T", bound="SearchSkillQueryModel") + + +@_attrs_define +class SearchSkillQueryModel: + """ + Attributes: + skills (Union[Unset, None, List['SearchSkillModel']]): + filters (Union[Unset, None, List['FilterModel']]): + """ + + skills: Union[Unset, None, List["SearchSkillModel"]] = UNSET + filters: Union[Unset, None, List["FilterModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + filters: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.filters, Unset): + if self.filters is None: + filters = None + else: + filters = [] + for filters_item_data in self.filters: + filters_item = filters_item_data.to_dict() + + filters.append(filters_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if skills is not UNSET: + field_dict["skills"] = skills + if filters is not UNSET: + field_dict["filters"] = filters + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.filter_model import FilterModel + from ..models.search_skill_model import SearchSkillModel + + d = src_dict.copy() + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = SearchSkillModel.from_dict(skills_item_data) + + skills.append(skills_item) + + filters = [] + _filters = d.pop("filters", UNSET) + for filters_item_data in _filters or []: + filters_item = FilterModel.from_dict(filters_item_data) + + filters.append(filters_item) + + search_skill_query_model = cls( + skills=skills, + filters=filters, + ) + + return search_skill_query_model diff --git a/src/cinode-py-client/cinode_api_client/models/search_skill_result_model.py b/src/cinode-py-client/cinode_api_client/models/search_skill_result_model.py new file mode 100644 index 0000000..e0d2f1d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/search_skill_result_model.py @@ -0,0 +1,78 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_search_skill_model import CompanyUserSearchSkillModel + from ..models.search_skill_query_model import SearchSkillQueryModel + + +T = TypeVar("T", bound="SearchSkillResultModel") + + +@_attrs_define +class SearchSkillResultModel: + """ + Attributes: + query (Union[Unset, None, SearchSkillQueryModel]): + hits (Union[Unset, None, List['CompanyUserSearchSkillModel']]): + """ + + query: Union[Unset, None, "SearchSkillQueryModel"] = UNSET + hits: Union[Unset, None, List["CompanyUserSearchSkillModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + query: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.query, Unset): + query = self.query.to_dict() if self.query else None + + hits: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.hits, Unset): + if self.hits is None: + hits = None + else: + hits = [] + for hits_item_data in self.hits: + hits_item = hits_item_data.to_dict() + + hits.append(hits_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if query is not UNSET: + field_dict["query"] = query + if hits is not UNSET: + field_dict["hits"] = hits + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_search_skill_model import CompanyUserSearchSkillModel + from ..models.search_skill_query_model import SearchSkillQueryModel + + d = src_dict.copy() + _query = d.pop("query", UNSET) + query: Union[Unset, None, SearchSkillQueryModel] + if _query is None: + query = None + elif isinstance(_query, Unset): + query = UNSET + else: + query = SearchSkillQueryModel.from_dict(_query) + + hits = [] + _hits = d.pop("hits", UNSET) + for hits_item_data in _hits or []: + hits_item = CompanyUserSearchSkillModel.from_dict(hits_item_data) + + hits.append(hits_item) + + search_skill_result_model = cls( + query=query, + hits=hits, + ) + + return search_skill_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/skill_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/skill_block_item_model.py new file mode 100644 index 0000000..dd775b3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/skill_block_item_model.py @@ -0,0 +1,168 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SkillBlockItemModel") + + +@_attrs_define +class SkillBlockItemModel: + """ + Attributes: + name (Union[Unset, None, str]): + level (Union[Unset, int]): + keyword_type_id (Union[Unset, None, int]): + keyword_type_name (Union[Unset, None, str]): + number_of_days_work_experience (Union[Unset, None, int]): + last_work_experience_date (Union[Unset, None, datetime.datetime]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + name: Union[Unset, None, str] = UNSET + level: Union[Unset, int] = UNSET + keyword_type_id: Union[Unset, None, int] = UNSET + keyword_type_name: Union[Unset, None, str] = UNSET + number_of_days_work_experience: Union[Unset, None, int] = UNSET + last_work_experience_date: Union[Unset, None, datetime.datetime] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + level = self.level + keyword_type_id = self.keyword_type_id + keyword_type_name = self.keyword_type_name + number_of_days_work_experience = self.number_of_days_work_experience + last_work_experience_date: Union[Unset, None, str] = UNSET + if not isinstance(self.last_work_experience_date, Unset): + last_work_experience_date = ( + self.last_work_experience_date.isoformat() if self.last_work_experience_date else None + ) + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if level is not UNSET: + field_dict["level"] = level + if keyword_type_id is not UNSET: + field_dict["keywordTypeId"] = keyword_type_id + if keyword_type_name is not UNSET: + field_dict["keywordTypeName"] = keyword_type_name + if number_of_days_work_experience is not UNSET: + field_dict["numberOfDaysWorkExperience"] = number_of_days_work_experience + if last_work_experience_date is not UNSET: + field_dict["lastWorkExperienceDate"] = last_work_experience_date + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name", UNSET) + + level = d.pop("level", UNSET) + + keyword_type_id = d.pop("keywordTypeId", UNSET) + + keyword_type_name = d.pop("keywordTypeName", UNSET) + + number_of_days_work_experience = d.pop("numberOfDaysWorkExperience", UNSET) + + _last_work_experience_date = d.pop("lastWorkExperienceDate", UNSET) + last_work_experience_date: Union[Unset, None, datetime.datetime] + if _last_work_experience_date is None: + last_work_experience_date = None + elif isinstance(_last_work_experience_date, Unset): + last_work_experience_date = UNSET + else: + last_work_experience_date = isoparse(_last_work_experience_date) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + skill_block_item_model = cls( + name=name, + level=level, + keyword_type_id=keyword_type_id, + keyword_type_name=keyword_type_name, + number_of_days_work_experience=number_of_days_work_experience, + last_work_experience_date=last_work_experience_date, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return skill_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/skill_by_category_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/skill_by_category_block_item_model.py new file mode 100644 index 0000000..d2579e4 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/skill_by_category_block_item_model.py @@ -0,0 +1,161 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.skill_block_item_model import SkillBlockItemModel + + +T = TypeVar("T", bound="SkillByCategoryBlockItemModel") + + +@_attrs_define +class SkillByCategoryBlockItemModel: + """ + Attributes: + keyword_type_id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + skills (Union[Unset, None, List['SkillBlockItemModel']]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + keyword_type_id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + skills: Union[Unset, None, List["SkillBlockItemModel"]] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_type_id = self.keyword_type_id + name = self.name + description = self.description + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_type_id is not UNSET: + field_dict["keywordTypeId"] = keyword_type_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if skills is not UNSET: + field_dict["skills"] = skills + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.skill_block_item_model import SkillBlockItemModel + + d = src_dict.copy() + keyword_type_id = d.pop("keywordTypeId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = SkillBlockItemModel.from_dict(skills_item_data) + + skills.append(skills_item) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + skill_by_category_block_item_model = cls( + keyword_type_id=keyword_type_id, + name=name, + description=description, + skills=skills, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return skill_by_category_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/skill_by_category_block_model.py b/src/cinode-py-client/cinode_api_client/models/skill_by_category_block_model.py new file mode 100644 index 0000000..79ab7d2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/skill_by_category_block_model.py @@ -0,0 +1,95 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.skill_by_category_block_item_model import SkillByCategoryBlockItemModel + + +T = TypeVar("T", bound="SkillByCategoryBlockModel") + + +@_attrs_define +class SkillByCategoryBlockModel: + """ + Attributes: + data (Union[Unset, None, List['SkillByCategoryBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + data: Union[Unset, None, List["SkillByCategoryBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.skill_by_category_block_item_model import SkillByCategoryBlockItemModel + + d = src_dict.copy() + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = SkillByCategoryBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + skill_by_category_block_model = cls( + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return skill_by_category_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/skill_model_model.py b/src/cinode-py-client/cinode_api_client/models/skill_model_model.py new file mode 100644 index 0000000..5eac2aa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/skill_model_model.py @@ -0,0 +1,127 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.skill_block_item_model import SkillBlockItemModel + + +T = TypeVar("T", bound="SkillModelModel") + + +@_attrs_define +class SkillModelModel: + """ + Attributes: + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + data (Union[Unset, None, List['SkillBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["SkillBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.skill_block_item_model import SkillBlockItemModel + + d = src_dict.copy() + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = SkillBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + skill_model_model = cls( + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return skill_model_model diff --git a/src/cinode-py-client/cinode_api_client/models/skill_result_model.py b/src/cinode-py-client/cinode_api_client/models/skill_result_model.py new file mode 100644 index 0000000..cd85104 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/skill_result_model.py @@ -0,0 +1,78 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SkillResultModel") + + +@_attrs_define +class SkillResultModel: + """ + Attributes: + keyword_id (Union[Unset, None, int]): + keyword_synonym_id (Union[Unset, None, int]): + keyword_synonym_name (Union[Unset, None, str]): + master_synonym_id (Union[Unset, None, int]): + master_synonym_name (Union[Unset, None, str]): + level (Union[Unset, None, int]): + """ + + keyword_id: Union[Unset, None, int] = UNSET + keyword_synonym_id: Union[Unset, None, int] = UNSET + keyword_synonym_name: Union[Unset, None, str] = UNSET + master_synonym_id: Union[Unset, None, int] = UNSET + master_synonym_name: Union[Unset, None, str] = UNSET + level: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + keyword_id = self.keyword_id + keyword_synonym_id = self.keyword_synonym_id + keyword_synonym_name = self.keyword_synonym_name + master_synonym_id = self.master_synonym_id + master_synonym_name = self.master_synonym_name + level = self.level + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if keyword_id is not UNSET: + field_dict["keywordId"] = keyword_id + if keyword_synonym_id is not UNSET: + field_dict["keywordSynonymId"] = keyword_synonym_id + if keyword_synonym_name is not UNSET: + field_dict["keywordSynonymName"] = keyword_synonym_name + if master_synonym_id is not UNSET: + field_dict["masterSynonymId"] = master_synonym_id + if master_synonym_name is not UNSET: + field_dict["masterSynonymName"] = master_synonym_name + if level is not UNSET: + field_dict["level"] = level + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + keyword_id = d.pop("keywordId", UNSET) + + keyword_synonym_id = d.pop("keywordSynonymId", UNSET) + + keyword_synonym_name = d.pop("keywordSynonymName", UNSET) + + master_synonym_id = d.pop("masterSynonymId", UNSET) + + master_synonym_name = d.pop("masterSynonymName", UNSET) + + level = d.pop("level", UNSET) + + skill_result_model = cls( + keyword_id=keyword_id, + keyword_synonym_id=keyword_synonym_id, + keyword_synonym_name=keyword_synonym_name, + master_synonym_id=master_synonym_id, + master_synonym_name=master_synonym_name, + level=level, + ) + + return skill_result_model diff --git a/src/cinode-py-client/cinode_api_client/models/skill_search_query_term_model.py b/src/cinode-py-client/cinode_api_client/models/skill_search_query_term_model.py new file mode 100644 index 0000000..334efd3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/skill_search_query_term_model.py @@ -0,0 +1,64 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="SkillSearchQueryTermModel") + + +@_attrs_define +class SkillSearchQueryTermModel: + """ + Attributes: + term (str): + min_ (Union[Unset, None, int]): + max_ (Union[Unset, None, int]): + limit (Union[Unset, None, int]): + """ + + term: str + min_: Union[Unset, None, int] = UNSET + max_: Union[Unset, None, int] = UNSET + limit: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + term = self.term + min_ = self.min_ + max_ = self.max_ + limit = self.limit + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "term": term, + } + ) + if min_ is not UNSET: + field_dict["min"] = min_ + if max_ is not UNSET: + field_dict["max"] = max_ + if limit is not UNSET: + field_dict["limit"] = limit + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + term = d.pop("term") + + min_ = d.pop("min", UNSET) + + max_ = d.pop("max", UNSET) + + limit = d.pop("limit", UNSET) + + skill_search_query_term_model = cls( + term=term, + min_=min_, + max_=max_, + limit=limit, + ) + + return skill_search_query_term_model diff --git a/src/cinode-py-client/cinode_api_client/models/sort_order.py b/src/cinode-py-client/cinode_api_client/models/sort_order.py new file mode 100644 index 0000000..06f2849 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/sort_order.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class SortOrder(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/status.py b/src/cinode-py-client/cinode_api_client/models/status.py new file mode 100644 index 0000000..d397945 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/status.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class Status(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/string_comparison_operator.py b/src/cinode-py-client/cinode_api_client/models/string_comparison_operator.py new file mode 100644 index 0000000..3055c25 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/string_comparison_operator.py @@ -0,0 +1,11 @@ +from enum import IntEnum + + +class StringComparisonOperator(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/subcontractor_attachment_multipart_data.py b/src/cinode-py-client/cinode_api_client/models/subcontractor_attachment_multipart_data.py new file mode 100644 index 0000000..821ec62 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/subcontractor_attachment_multipart_data.py @@ -0,0 +1,117 @@ +import json +from io import BytesIO +from typing import Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, File, Unset + +T = TypeVar("T", bound="SubcontractorAttachmentMultipartData") + + +@_attrs_define +class SubcontractorAttachmentMultipartData: + """ + Attributes: + files (List[File]): + title (str): + description (Union[Unset, str]): + """ + + files: List[File] + title: str + description: Union[Unset, str] = UNSET + additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + files = [] + for files_item_data in self.files: + files_item = files_item_data.to_tuple() + + files.append(files_item) + + title = self.title + description = self.description + + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "Files": files, + "Title": title, + } + ) + if description is not UNSET: + field_dict["Description"] = description + + return field_dict + + def to_multipart(self) -> Dict[str, Any]: + _temp_files = [] + for files_item_data in self.files: + files_item = files_item_data.to_tuple() + + _temp_files.append(files_item) + files = (None, json.dumps(_temp_files).encode(), "application/json") + + title = self.title if isinstance(self.title, Unset) else (None, str(self.title).encode(), "text/plain") + description = ( + self.description + if isinstance(self.description, Unset) + else (None, str(self.description).encode(), "text/plain") + ) + + field_dict: Dict[str, Any] = {} + field_dict.update( + {key: (None, str(value).encode(), "text/plain") for key, value in self.additional_properties.items()} + ) + field_dict.update( + { + "Files": files, + "Title": title, + } + ) + if description is not UNSET: + field_dict["Description"] = description + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + files = [] + _files = d.pop("Files") + for files_item_data in _files: + files_item = File(payload=BytesIO(files_item_data)) + + files.append(files_item) + + title = d.pop("Title") + + description = d.pop("Description", UNSET) + + subcontractor_attachment_multipart_data = cls( + files=files, + title=title, + description=description, + ) + + subcontractor_attachment_multipart_data.additional_properties = d + return subcontractor_attachment_multipart_data + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/team_add_edit_model.py b/src/cinode-py-client/cinode_api_client/models/team_add_edit_model.py new file mode 100644 index 0000000..dbae27e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_add_edit_model.py @@ -0,0 +1,86 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TeamAddEditModel") + + +@_attrs_define +class TeamAddEditModel: + """ + Attributes: + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + internal_identification (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + cost_center (Union[Unset, None, str]): + parent_team_id (Union[Unset, None, int]): + location_id (Union[Unset, None, int]): + """ + + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + internal_identification: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + cost_center: Union[Unset, None, str] = UNSET + parent_team_id: Union[Unset, None, int] = UNSET + location_id: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + description = self.description + internal_identification = self.internal_identification + corporate_identity_number = self.corporate_identity_number + cost_center = self.cost_center + parent_team_id = self.parent_team_id + location_id = self.location_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if internal_identification is not UNSET: + field_dict["internalIdentification"] = internal_identification + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if cost_center is not UNSET: + field_dict["costCenter"] = cost_center + if parent_team_id is not UNSET: + field_dict["parentTeamId"] = parent_team_id + if location_id is not UNSET: + field_dict["locationId"] = location_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + internal_identification = d.pop("internalIdentification", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + cost_center = d.pop("costCenter", UNSET) + + parent_team_id = d.pop("parentTeamId", UNSET) + + location_id = d.pop("locationId", UNSET) + + team_add_edit_model = cls( + name=name, + description=description, + internal_identification=internal_identification, + corporate_identity_number=corporate_identity_number, + cost_center=cost_center, + parent_team_id=parent_team_id, + location_id=location_id, + ) + + return team_add_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_base_model.py b/src/cinode-py-client/cinode_api_client/models/team_base_model.py new file mode 100644 index 0000000..ca591f8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_base_model.py @@ -0,0 +1,90 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="TeamBaseModel") + + +@_attrs_define +class TeamBaseModel: + """ + Attributes: + id (Union[Unset, int]): + company_id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + id: Union[Unset, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + company_id = self.company_id + name = self.name + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + team_base_model = cls( + id=id, + company_id=company_id, + name=name, + description=description, + links=links, + ) + + return team_base_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_manager_edit_model.py b/src/cinode-py-client/cinode_api_client/models/team_manager_edit_model.py new file mode 100644 index 0000000..bdec4fa --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_manager_edit_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TeamManagerEditModel") + + +@_attrs_define +class TeamManagerEditModel: + """ + Attributes: + team_id (Union[Unset, int]): + company_user_id (Union[Unset, int]): + """ + + team_id: Union[Unset, int] = UNSET + company_user_id: Union[Unset, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + team_id = self.team_id + company_user_id = self.company_user_id + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if team_id is not UNSET: + field_dict["teamId"] = team_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + team_id = d.pop("teamId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + team_manager_edit_model = cls( + team_id=team_id, + company_user_id=company_user_id, + ) + + return team_manager_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_manager_model.py b/src/cinode-py-client/cinode_api_client/models/team_manager_model.py new file mode 100644 index 0000000..9593ce2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_manager_model.py @@ -0,0 +1,89 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.team_base_model import TeamBaseModel + + +T = TypeVar("T", bound="TeamManagerModel") + + +@_attrs_define +class TeamManagerModel: + """ + Attributes: + team_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + company_user (Union[Unset, None, CompanyUserBaseModel]): + team (Union[Unset, None, TeamBaseModel]): + """ + + team_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_user: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + team: Union[Unset, None, "TeamBaseModel"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + team_id = self.team_id + company_user_id = self.company_user_id + company_user: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_user, Unset): + company_user = self.company_user.to_dict() if self.company_user else None + + team: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.team, Unset): + team = self.team.to_dict() if self.team else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if team_id is not UNSET: + field_dict["teamId"] = team_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_user is not UNSET: + field_dict["companyUser"] = company_user + if team is not UNSET: + field_dict["team"] = team + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.team_base_model import TeamBaseModel + + d = src_dict.copy() + team_id = d.pop("teamId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + _company_user = d.pop("companyUser", UNSET) + company_user: Union[Unset, None, CompanyUserBaseModel] + if _company_user is None: + company_user = None + elif isinstance(_company_user, Unset): + company_user = UNSET + else: + company_user = CompanyUserBaseModel.from_dict(_company_user) + + _team = d.pop("team", UNSET) + team: Union[Unset, None, TeamBaseModel] + if _team is None: + team = None + elif isinstance(_team, Unset): + team = UNSET + else: + team = TeamBaseModel.from_dict(_team) + + team_manager_model = cls( + team_id=team_id, + company_user_id=company_user_id, + company_user=company_user, + team=team, + ) + + return team_manager_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_member_add_model.py b/src/cinode-py-client/cinode_api_client/models/team_member_add_model.py new file mode 100644 index 0000000..779dc42 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_member_add_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TeamMemberAddModel") + + +@_attrs_define +class TeamMemberAddModel: + """ + Attributes: + company_user_id (Union[Unset, int]): + availability_percent (Union[Unset, None, int]): + """ + + company_user_id: Union[Unset, int] = UNSET + availability_percent: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + availability_percent = self.availability_percent + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + availability_percent = d.pop("availabilityPercent", UNSET) + + team_member_add_model = cls( + company_user_id=company_user_id, + availability_percent=availability_percent, + ) + + return team_member_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_member_edit_model.py b/src/cinode-py-client/cinode_api_client/models/team_member_edit_model.py new file mode 100644 index 0000000..6647bf0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_member_edit_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TeamMemberEditModel") + + +@_attrs_define +class TeamMemberEditModel: + """ + Attributes: + availability_percent (Union[Unset, None, int]): + """ + + availability_percent: Union[Unset, None, int] = UNSET + + def to_dict(self) -> Dict[str, Any]: + availability_percent = self.availability_percent + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + availability_percent = d.pop("availabilityPercent", UNSET) + + team_member_edit_model = cls( + availability_percent=availability_percent, + ) + + return team_member_edit_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_member_model.py b/src/cinode-py-client/cinode_api_client/models/team_member_model.py new file mode 100644 index 0000000..448313d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_member_model.py @@ -0,0 +1,122 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + from ..models.team_base_model import TeamBaseModel + + +T = TypeVar("T", bound="TeamMemberModel") + + +@_attrs_define +class TeamMemberModel: + """ + Attributes: + team_id (Union[Unset, None, int]): + company_user_id (Union[Unset, None, int]): + company_user (Union[Unset, None, CompanyUserBaseModel]): + team (Union[Unset, None, TeamBaseModel]): + availability_percent (Union[Unset, None, int]): + links (Union[Unset, None, List['Link']]): + """ + + team_id: Union[Unset, None, int] = UNSET + company_user_id: Union[Unset, None, int] = UNSET + company_user: Union[Unset, None, "CompanyUserBaseModel"] = UNSET + team: Union[Unset, None, "TeamBaseModel"] = UNSET + availability_percent: Union[Unset, None, int] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + team_id = self.team_id + company_user_id = self.company_user_id + company_user: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.company_user, Unset): + company_user = self.company_user.to_dict() if self.company_user else None + + team: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.team, Unset): + team = self.team.to_dict() if self.team else None + + availability_percent = self.availability_percent + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if team_id is not UNSET: + field_dict["teamId"] = team_id + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if company_user is not UNSET: + field_dict["companyUser"] = company_user + if team is not UNSET: + field_dict["team"] = team + if availability_percent is not UNSET: + field_dict["availabilityPercent"] = availability_percent + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.company_user_base_model import CompanyUserBaseModel + from ..models.link import Link + from ..models.team_base_model import TeamBaseModel + + d = src_dict.copy() + team_id = d.pop("teamId", UNSET) + + company_user_id = d.pop("companyUserId", UNSET) + + _company_user = d.pop("companyUser", UNSET) + company_user: Union[Unset, None, CompanyUserBaseModel] + if _company_user is None: + company_user = None + elif isinstance(_company_user, Unset): + company_user = UNSET + else: + company_user = CompanyUserBaseModel.from_dict(_company_user) + + _team = d.pop("team", UNSET) + team: Union[Unset, None, TeamBaseModel] + if _team is None: + team = None + elif isinstance(_team, Unset): + team = UNSET + else: + team = TeamBaseModel.from_dict(_team) + + availability_percent = d.pop("availabilityPercent", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + team_member_model = cls( + team_id=team_id, + company_user_id=company_user_id, + company_user=company_user, + team=team, + availability_percent=availability_percent, + links=links, + ) + + return team_member_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_member_move_model.py b/src/cinode-py-client/cinode_api_client/models/team_member_move_model.py new file mode 100644 index 0000000..49b35b3 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_member_move_model.py @@ -0,0 +1,38 @@ +from typing import Any, Dict, Type, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="TeamMemberMoveModel") + + +@_attrs_define +class TeamMemberMoveModel: + """ + Attributes: + to_team_id (int): + """ + + to_team_id: int + + def to_dict(self) -> Dict[str, Any]: + to_team_id = self.to_team_id + + field_dict: Dict[str, Any] = {} + field_dict.update( + { + "toTeamId": to_team_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + to_team_id = d.pop("toTeamId") + + team_member_move_model = cls( + to_team_id=to_team_id, + ) + + return team_member_move_model diff --git a/src/cinode-py-client/cinode_api_client/models/team_model.py b/src/cinode-py-client/cinode_api_client/models/team_model.py new file mode 100644 index 0000000..9eeeddd --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/team_model.py @@ -0,0 +1,176 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.link import Link + + +T = TypeVar("T", bound="TeamModel") + + +@_attrs_define +class TeamModel: + """ + Attributes: + internal_identification (Union[Unset, None, str]): + corporate_identity_number (Union[Unset, None, str]): + cost_center (Union[Unset, None, str]): + location (Union[Unset, None, str]): + parent_team_id (Union[Unset, None, int]): + created (Union[Unset, None, datetime.datetime]): + updated (Union[Unset, None, datetime.datetime]): + location_id (Union[Unset, None, int]): + id (Union[Unset, int]): + company_id (Union[Unset, None, int]): + name (Union[Unset, None, str]): + description (Union[Unset, None, str]): + links (Union[Unset, None, List['Link']]): + """ + + internal_identification: Union[Unset, None, str] = UNSET + corporate_identity_number: Union[Unset, None, str] = UNSET + cost_center: Union[Unset, None, str] = UNSET + location: Union[Unset, None, str] = UNSET + parent_team_id: Union[Unset, None, int] = UNSET + created: Union[Unset, None, datetime.datetime] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + location_id: Union[Unset, None, int] = UNSET + id: Union[Unset, int] = UNSET + company_id: Union[Unset, None, int] = UNSET + name: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + links: Union[Unset, None, List["Link"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + internal_identification = self.internal_identification + corporate_identity_number = self.corporate_identity_number + cost_center = self.cost_center + location = self.location + parent_team_id = self.parent_team_id + created: Union[Unset, None, str] = UNSET + if not isinstance(self.created, Unset): + created = self.created.isoformat() if self.created else None + + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + location_id = self.location_id + id = self.id + company_id = self.company_id + name = self.name + description = self.description + links: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.links, Unset): + if self.links is None: + links = None + else: + links = [] + for links_item_data in self.links: + links_item = links_item_data.to_dict() + + links.append(links_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if internal_identification is not UNSET: + field_dict["internalIdentification"] = internal_identification + if corporate_identity_number is not UNSET: + field_dict["corporateIdentityNumber"] = corporate_identity_number + if cost_center is not UNSET: + field_dict["costCenter"] = cost_center + if location is not UNSET: + field_dict["location"] = location + if parent_team_id is not UNSET: + field_dict["parentTeamId"] = parent_team_id + if created is not UNSET: + field_dict["created"] = created + if updated is not UNSET: + field_dict["updated"] = updated + if location_id is not UNSET: + field_dict["locationId"] = location_id + if id is not UNSET: + field_dict["id"] = id + if company_id is not UNSET: + field_dict["companyId"] = company_id + if name is not UNSET: + field_dict["name"] = name + if description is not UNSET: + field_dict["description"] = description + if links is not UNSET: + field_dict["links"] = links + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.link import Link + + d = src_dict.copy() + internal_identification = d.pop("internalIdentification", UNSET) + + corporate_identity_number = d.pop("corporateIdentityNumber", UNSET) + + cost_center = d.pop("costCenter", UNSET) + + location = d.pop("location", UNSET) + + parent_team_id = d.pop("parentTeamId", UNSET) + + _created = d.pop("created", UNSET) + created: Union[Unset, None, datetime.datetime] + if _created is None: + created = None + elif isinstance(_created, Unset): + created = UNSET + else: + created = isoparse(_created) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + location_id = d.pop("locationId", UNSET) + + id = d.pop("id", UNSET) + + company_id = d.pop("companyId", UNSET) + + name = d.pop("name", UNSET) + + description = d.pop("description", UNSET) + + links = [] + _links = d.pop("links", UNSET) + for links_item_data in _links or []: + links_item = Link.from_dict(links_item_data) + + links.append(links_item) + + team_model = cls( + internal_identification=internal_identification, + corporate_identity_number=corporate_identity_number, + cost_center=cost_center, + location=location, + parent_team_id=parent_team_id, + created=created, + updated=updated, + location_id=location_id, + id=id, + company_id=company_id, + name=name, + description=description, + links=links, + ) + + return team_model diff --git a/src/cinode-py-client/cinode_api_client/models/template_asset_type.py b/src/cinode-py-client/cinode_api_client/models/template_asset_type.py new file mode 100644 index 0000000..82833d0 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/template_asset_type.py @@ -0,0 +1,17 @@ +from enum import IntEnum + + +class TemplateAssetType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_6 = 6 + VALUE_7 = 7 + VALUE_50 = 50 + VALUE_51 = 51 + VALUE_100 = 100 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/text_block_model.py b/src/cinode-py-client/cinode_api_client/models/text_block_model.py new file mode 100644 index 0000000..e2d6c22 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/text_block_model.py @@ -0,0 +1,114 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TextBlockModel") + + +@_attrs_define +class TextBlockModel: + """ + Attributes: + description (Union[Unset, None, str]): + text (Union[Unset, None, str]): + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + description: Union[Unset, None, str] = UNSET + text: Union[Unset, None, str] = UNSET + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + description = self.description + text = self.text + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if description is not UNSET: + field_dict["description"] = description + if text is not UNSET: + field_dict["text"] = text + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + description = d.pop("description", UNSET) + + text = d.pop("text", UNSET) + + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + text_block_model = cls( + description=description, + text=text, + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return text_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/top_skill_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/top_skill_block_item_model.py new file mode 100644 index 0000000..50c8822 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/top_skill_block_item_model.py @@ -0,0 +1,124 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TopSkillBlockItemModel") + + +@_attrs_define +class TopSkillBlockItemModel: + """ + Attributes: + name (Union[Unset, None, str]): + level (Union[Unset, None, int]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + name: Union[Unset, None, str] = UNSET + level: Union[Unset, None, int] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + name = self.name + level = self.level + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if level is not UNSET: + field_dict["level"] = level + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + name = d.pop("name", UNSET) + + level = d.pop("level", UNSET) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + top_skill_block_item_model = cls( + name=name, + level=level, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return top_skill_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/top_skill_block_model.py b/src/cinode-py-client/cinode_api_client/models/top_skill_block_model.py new file mode 100644 index 0000000..b3ecfb2 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/top_skill_block_model.py @@ -0,0 +1,127 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.top_skill_block_item_model import TopSkillBlockItemModel + + +T = TypeVar("T", bound="TopSkillBlockModel") + + +@_attrs_define +class TopSkillBlockModel: + """ + Attributes: + use_level (Union[Unset, bool]): + min_value (Union[Unset, int]): + max_value (Union[Unset, int]): + number_of_items_in_list (Union[Unset, int]): + data (Union[Unset, None, List['TopSkillBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + use_level: Union[Unset, bool] = UNSET + min_value: Union[Unset, int] = UNSET + max_value: Union[Unset, int] = UNSET + number_of_items_in_list: Union[Unset, int] = UNSET + data: Union[Unset, None, List["TopSkillBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + use_level = self.use_level + min_value = self.min_value + max_value = self.max_value + number_of_items_in_list = self.number_of_items_in_list + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if use_level is not UNSET: + field_dict["useLevel"] = use_level + if min_value is not UNSET: + field_dict["minValue"] = min_value + if max_value is not UNSET: + field_dict["maxValue"] = max_value + if number_of_items_in_list is not UNSET: + field_dict["numberOfItemsInList"] = number_of_items_in_list + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.top_skill_block_item_model import TopSkillBlockItemModel + + d = src_dict.copy() + use_level = d.pop("useLevel", UNSET) + + min_value = d.pop("minValue", UNSET) + + max_value = d.pop("maxValue", UNSET) + + number_of_items_in_list = d.pop("numberOfItemsInList", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = TopSkillBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + top_skill_block_model = cls( + use_level=use_level, + min_value=min_value, + max_value=max_value, + number_of_items_in_list=number_of_items_in_list, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return top_skill_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/training_block_model.py b/src/cinode-py-client/cinode_api_client/models/training_block_model.py new file mode 100644 index 0000000..3873e34 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/training_block_model.py @@ -0,0 +1,127 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.training_item_block_model import TrainingItemBlockModel + + +T = TypeVar("T", bound="TrainingBlockModel") + + +@_attrs_define +class TrainingBlockModel: + """ + Attributes: + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + data (Union[Unset, None, List['TrainingItemBlockModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["TrainingItemBlockModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.training_item_block_model import TrainingItemBlockModel + + d = src_dict.copy() + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = TrainingItemBlockModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + training_block_model = cls( + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return training_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/training_item_block_model.py b/src/cinode-py-client/cinode_api_client/models/training_item_block_model.py new file mode 100644 index 0000000..9e0c90b --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/training_item_block_model.py @@ -0,0 +1,177 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..models.training_type import TrainingType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TrainingItemBlockModel") + + +@_attrs_define +class TrainingItemBlockModel: + """ + Attributes: + training_type (Union[Unset, TrainingType]): + + Kurs = 0 + + Certifiering = 1 + url (Union[Unset, None, str]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + issuer (Union[Unset, None, str]): + year (Union[Unset, int]): + supplier (Union[Unset, None, str]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + training_type: Union[Unset, TrainingType] = UNSET + url: Union[Unset, None, str] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + issuer: Union[Unset, None, str] = UNSET + year: Union[Unset, int] = UNSET + supplier: Union[Unset, None, str] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + training_type: Union[Unset, int] = UNSET + if not isinstance(self.training_type, Unset): + training_type = self.training_type.value + + url = self.url + title = self.title + description = self.description + issuer = self.issuer + year = self.year + supplier = self.supplier + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if training_type is not UNSET: + field_dict["trainingType"] = training_type + if url is not UNSET: + field_dict["url"] = url + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if issuer is not UNSET: + field_dict["issuer"] = issuer + if year is not UNSET: + field_dict["year"] = year + if supplier is not UNSET: + field_dict["supplier"] = supplier + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _training_type = d.pop("trainingType", UNSET) + training_type: Union[Unset, TrainingType] + if isinstance(_training_type, Unset): + training_type = UNSET + else: + training_type = TrainingType(_training_type) + + url = d.pop("url", UNSET) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + issuer = d.pop("issuer", UNSET) + + year = d.pop("year", UNSET) + + supplier = d.pop("supplier", UNSET) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + training_item_block_model = cls( + training_type=training_type, + url=url, + title=title, + description=description, + issuer=issuer, + year=year, + supplier=supplier, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return training_item_block_model diff --git a/src/cinode-py-client/cinode_api_client/models/training_type.py b/src/cinode-py-client/cinode_api_client/models/training_type.py new file mode 100644 index 0000000..4d6fbfb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/training_type.py @@ -0,0 +1,9 @@ +from enum import IntEnum + + +class TrainingType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/updated_model.py b/src/cinode-py-client/cinode_api_client/models/updated_model.py new file mode 100644 index 0000000..df4ea24 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/updated_model.py @@ -0,0 +1,73 @@ +import datetime +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdatedModel") + + +@_attrs_define +class UpdatedModel: + """ + Attributes: + company_user_id (Union[Unset, None, int]): + first_name (Union[Unset, None, str]): + last_name (Union[Unset, None, str]): + time (Union[Unset, None, datetime.datetime]): + """ + + company_user_id: Union[Unset, None, int] = UNSET + first_name: Union[Unset, None, str] = UNSET + last_name: Union[Unset, None, str] = UNSET + time: Union[Unset, None, datetime.datetime] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_user_id = self.company_user_id + first_name = self.first_name + last_name = self.last_name + time: Union[Unset, None, str] = UNSET + if not isinstance(self.time, Unset): + time = self.time.isoformat() if self.time else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_user_id is not UNSET: + field_dict["companyUserId"] = company_user_id + if first_name is not UNSET: + field_dict["firstName"] = first_name + if last_name is not UNSET: + field_dict["lastName"] = last_name + if time is not UNSET: + field_dict["time"] = time + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + company_user_id = d.pop("companyUserId", UNSET) + + first_name = d.pop("firstName", UNSET) + + last_name = d.pop("lastName", UNSET) + + _time = d.pop("time", UNSET) + time: Union[Unset, None, datetime.datetime] + if _time is None: + time = None + elif isinstance(_time, Unset): + time = UNSET + else: + time = isoparse(_time) + + updated_model = cls( + company_user_id=company_user_id, + first_name=first_name, + last_name=last_name, + time=time, + ) + + return updated_model diff --git a/src/cinode-py-client/cinode_api_client/models/user_gender.py b/src/cinode-py-client/cinode_api_client/models/user_gender.py new file mode 100644 index 0000000..f52eb28 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/user_gender.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class UserGender(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/validation_model.py b/src/cinode-py-client/cinode_api_client/models/validation_model.py new file mode 100644 index 0000000..3cd5ea7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/validation_model.py @@ -0,0 +1,53 @@ +from typing import TYPE_CHECKING, Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.validation_model_errors import ValidationModelErrors + + +T = TypeVar("T", bound="ValidationModel") + + +@_attrs_define +class ValidationModel: + """ + Attributes: + errors (Union[Unset, None, ValidationModelErrors]): Collection of validation errors + """ + + errors: Union[Unset, None, "ValidationModelErrors"] = UNSET + + def to_dict(self) -> Dict[str, Any]: + errors: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.errors, Unset): + errors = self.errors.to_dict() if self.errors else None + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if errors is not UNSET: + field_dict["errors"] = errors + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.validation_model_errors import ValidationModelErrors + + d = src_dict.copy() + _errors = d.pop("errors", UNSET) + errors: Union[Unset, None, ValidationModelErrors] + if _errors is None: + errors = None + elif isinstance(_errors, Unset): + errors = UNSET + else: + errors = ValidationModelErrors.from_dict(_errors) + + validation_model = cls( + errors=errors, + ) + + return validation_model diff --git a/src/cinode-py-client/cinode_api_client/models/validation_model_errors.py b/src/cinode-py-client/cinode_api_client/models/validation_model_errors.py new file mode 100644 index 0000000..3d6f426 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/validation_model_errors.py @@ -0,0 +1,55 @@ +from typing import Any, Dict, List, Optional, Type, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ValidationModelErrors") + + +@_attrs_define +class ValidationModelErrors: + """Collection of validation errors""" + + additional_properties: Dict[str, Optional[List[str]]] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + if prop is None: + field_dict[prop_name] = None + else: + field_dict[prop_name] = prop + + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + validation_model_errors = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = cast(List[str], prop_dict) + + additional_properties[prop_name] = additional_property + + validation_model_errors.additional_properties = additional_properties + return validation_model_errors + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Optional[List[str]]: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Optional[List[str]]) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_add_model.py b/src/cinode-py-client/cinode_api_client/models/webhook_add_model.py new file mode 100644 index 0000000..0a13974 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_add_model.py @@ -0,0 +1,107 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook_configuration_add_model import WebhookConfigurationAddModel + from ..models.webhook_credentials_add_model import WebhookCredentialsAddModel + + +T = TypeVar("T", bound="WebhookAddModel") + + +@_attrs_define +class WebhookAddModel: + """ + Attributes: + company_id (Union[Unset, None, int]): + is_active (Union[Unset, bool]): + endpoint_url (Union[Unset, None, str]): + configurations (Union[Unset, None, List['WebhookConfigurationAddModel']]): + credentials (Union[Unset, None, List['WebhookCredentialsAddModel']]): + """ + + company_id: Union[Unset, None, int] = UNSET + is_active: Union[Unset, bool] = UNSET + endpoint_url: Union[Unset, None, str] = UNSET + configurations: Union[Unset, None, List["WebhookConfigurationAddModel"]] = UNSET + credentials: Union[Unset, None, List["WebhookCredentialsAddModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + company_id = self.company_id + is_active = self.is_active + endpoint_url = self.endpoint_url + configurations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.configurations, Unset): + if self.configurations is None: + configurations = None + else: + configurations = [] + for configurations_item_data in self.configurations: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + credentials: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.credentials, Unset): + if self.credentials is None: + credentials = None + else: + credentials = [] + for credentials_item_data in self.credentials: + credentials_item = credentials_item_data.to_dict() + + credentials.append(credentials_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if company_id is not UNSET: + field_dict["companyId"] = company_id + if is_active is not UNSET: + field_dict["isActive"] = is_active + if endpoint_url is not UNSET: + field_dict["endpointUrl"] = endpoint_url + if configurations is not UNSET: + field_dict["configurations"] = configurations + if credentials is not UNSET: + field_dict["credentials"] = credentials + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.webhook_configuration_add_model import WebhookConfigurationAddModel + from ..models.webhook_credentials_add_model import WebhookCredentialsAddModel + + d = src_dict.copy() + company_id = d.pop("companyId", UNSET) + + is_active = d.pop("isActive", UNSET) + + endpoint_url = d.pop("endpointUrl", UNSET) + + configurations = [] + _configurations = d.pop("configurations", UNSET) + for configurations_item_data in _configurations or []: + configurations_item = WebhookConfigurationAddModel.from_dict(configurations_item_data) + + configurations.append(configurations_item) + + credentials = [] + _credentials = d.pop("credentials", UNSET) + for credentials_item_data in _credentials or []: + credentials_item = WebhookCredentialsAddModel.from_dict(credentials_item_data) + + credentials.append(credentials_item) + + webhook_add_model = cls( + company_id=company_id, + is_active=is_active, + endpoint_url=endpoint_url, + configurations=configurations, + credentials=credentials, + ) + + return webhook_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_configuration_add_model.py b/src/cinode-py-client/cinode_api_client/models/webhook_configuration_add_model.py new file mode 100644 index 0000000..fe4be83 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_configuration_add_model.py @@ -0,0 +1,91 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.action_type import ActionType +from ..models.webhook_entity_type import WebhookEntityType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebhookConfigurationAddModel") + + +@_attrs_define +class WebhookConfigurationAddModel: + """ + Attributes: + entity_type (Union[Unset, WebhookEntityType]): + + All = 1 + + CompanyCandidate = 2 + + CompanyEmployee = 3 + + CompanySubcontractor = 4 + + CompanyCustomer = 5 + + CompanyProject = 6 + + Role = 7 + + PublicAnnouncement = 8 + + Absence = 9 + + CompanyCustomerContact = 10 + action_type (Union[Unset, ActionType]): + + All = 1 + + Created = 2 + + Updated = 3 + + Borttagen = 4 + """ + + entity_type: Union[Unset, WebhookEntityType] = UNSET + action_type: Union[Unset, ActionType] = UNSET + + def to_dict(self) -> Dict[str, Any]: + entity_type: Union[Unset, int] = UNSET + if not isinstance(self.entity_type, Unset): + entity_type = self.entity_type.value + + action_type: Union[Unset, int] = UNSET + if not isinstance(self.action_type, Unset): + action_type = self.action_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if entity_type is not UNSET: + field_dict["entityType"] = entity_type + if action_type is not UNSET: + field_dict["actionType"] = action_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _entity_type = d.pop("entityType", UNSET) + entity_type: Union[Unset, WebhookEntityType] + if isinstance(_entity_type, Unset): + entity_type = UNSET + else: + entity_type = WebhookEntityType(_entity_type) + + _action_type = d.pop("actionType", UNSET) + action_type: Union[Unset, ActionType] + if isinstance(_action_type, Unset): + action_type = UNSET + else: + action_type = ActionType(_action_type) + + webhook_configuration_add_model = cls( + entity_type=entity_type, + action_type=action_type, + ) + + return webhook_configuration_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_configuration_model.py b/src/cinode-py-client/cinode_api_client/models/webhook_configuration_model.py new file mode 100644 index 0000000..a632536 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_configuration_model.py @@ -0,0 +1,91 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..models.action_type import ActionType +from ..models.webhook_entity_type import WebhookEntityType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebhookConfigurationModel") + + +@_attrs_define +class WebhookConfigurationModel: + """ + Attributes: + entity_type (Union[Unset, WebhookEntityType]): + + All = 1 + + CompanyCandidate = 2 + + CompanyEmployee = 3 + + CompanySubcontractor = 4 + + CompanyCustomer = 5 + + CompanyProject = 6 + + Role = 7 + + PublicAnnouncement = 8 + + Absence = 9 + + CompanyCustomerContact = 10 + action_type (Union[Unset, ActionType]): + + All = 1 + + Created = 2 + + Updated = 3 + + Borttagen = 4 + """ + + entity_type: Union[Unset, WebhookEntityType] = UNSET + action_type: Union[Unset, ActionType] = UNSET + + def to_dict(self) -> Dict[str, Any]: + entity_type: Union[Unset, int] = UNSET + if not isinstance(self.entity_type, Unset): + entity_type = self.entity_type.value + + action_type: Union[Unset, int] = UNSET + if not isinstance(self.action_type, Unset): + action_type = self.action_type.value + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if entity_type is not UNSET: + field_dict["entityType"] = entity_type + if action_type is not UNSET: + field_dict["actionType"] = action_type + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + _entity_type = d.pop("entityType", UNSET) + entity_type: Union[Unset, WebhookEntityType] + if isinstance(_entity_type, Unset): + entity_type = UNSET + else: + entity_type = WebhookEntityType(_entity_type) + + _action_type = d.pop("actionType", UNSET) + action_type: Union[Unset, ActionType] + if isinstance(_action_type, Unset): + action_type = UNSET + else: + action_type = ActionType(_action_type) + + webhook_configuration_model = cls( + entity_type=entity_type, + action_type=action_type, + ) + + return webhook_configuration_model diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_credentials_add_model.py b/src/cinode-py-client/cinode_api_client/models/webhook_credentials_add_model.py new file mode 100644 index 0000000..3e29f1a --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_credentials_add_model.py @@ -0,0 +1,54 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebhookCredentialsAddModel") + + +@_attrs_define +class WebhookCredentialsAddModel: + """ + Attributes: + header_value (Union[Unset, None, str]): + is_basic_authentication (Union[Unset, None, bool]): + header_name (Union[Unset, None, str]): + """ + + header_value: Union[Unset, None, str] = UNSET + is_basic_authentication: Union[Unset, None, bool] = UNSET + header_name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + header_value = self.header_value + is_basic_authentication = self.is_basic_authentication + header_name = self.header_name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if header_value is not UNSET: + field_dict["headerValue"] = header_value + if is_basic_authentication is not UNSET: + field_dict["isBasicAuthentication"] = is_basic_authentication + if header_name is not UNSET: + field_dict["headerName"] = header_name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + header_value = d.pop("headerValue", UNSET) + + is_basic_authentication = d.pop("isBasicAuthentication", UNSET) + + header_name = d.pop("headerName", UNSET) + + webhook_credentials_add_model = cls( + header_value=header_value, + is_basic_authentication=is_basic_authentication, + header_name=header_name, + ) + + return webhook_credentials_add_model diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_credentials_model.py b/src/cinode-py-client/cinode_api_client/models/webhook_credentials_model.py new file mode 100644 index 0000000..07147bb --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_credentials_model.py @@ -0,0 +1,46 @@ +from typing import Any, Dict, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="WebhookCredentialsModel") + + +@_attrs_define +class WebhookCredentialsModel: + """ + Attributes: + is_basic_authentication (Union[Unset, None, bool]): + header_name (Union[Unset, None, str]): + """ + + is_basic_authentication: Union[Unset, None, bool] = UNSET + header_name: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + is_basic_authentication = self.is_basic_authentication + header_name = self.header_name + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if is_basic_authentication is not UNSET: + field_dict["isBasicAuthentication"] = is_basic_authentication + if header_name is not UNSET: + field_dict["headerName"] = header_name + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + is_basic_authentication = d.pop("isBasicAuthentication", UNSET) + + header_name = d.pop("headerName", UNSET) + + webhook_credentials_model = cls( + is_basic_authentication=is_basic_authentication, + header_name=header_name, + ) + + return webhook_credentials_model diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_entity_type.py b/src/cinode-py-client/cinode_api_client/models/webhook_entity_type.py new file mode 100644 index 0000000..a159db7 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_entity_type.py @@ -0,0 +1,17 @@ +from enum import IntEnum + + +class WebhookEntityType(IntEnum): + VALUE_1 = 1 + VALUE_2 = 2 + VALUE_3 = 3 + VALUE_4 = 4 + VALUE_5 = 5 + VALUE_6 = 6 + VALUE_7 = 7 + VALUE_8 = 8 + VALUE_9 = 9 + VALUE_10 = 10 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/webhook_model.py b/src/cinode-py-client/cinode_api_client/models/webhook_model.py new file mode 100644 index 0000000..d6ee799 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/webhook_model.py @@ -0,0 +1,107 @@ +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.webhook_configuration_model import WebhookConfigurationModel + from ..models.webhook_credentials_model import WebhookCredentialsModel + + +T = TypeVar("T", bound="WebhookModel") + + +@_attrs_define +class WebhookModel: + """ + Attributes: + id (Union[Unset, str]): + is_active (Union[Unset, bool]): + endpoint_url (Union[Unset, None, str]): + configurations (Union[Unset, None, List['WebhookConfigurationModel']]): + credentials (Union[Unset, None, List['WebhookCredentialsModel']]): + """ + + id: Union[Unset, str] = UNSET + is_active: Union[Unset, bool] = UNSET + endpoint_url: Union[Unset, None, str] = UNSET + configurations: Union[Unset, None, List["WebhookConfigurationModel"]] = UNSET + credentials: Union[Unset, None, List["WebhookCredentialsModel"]] = UNSET + + def to_dict(self) -> Dict[str, Any]: + id = self.id + is_active = self.is_active + endpoint_url = self.endpoint_url + configurations: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.configurations, Unset): + if self.configurations is None: + configurations = None + else: + configurations = [] + for configurations_item_data in self.configurations: + configurations_item = configurations_item_data.to_dict() + + configurations.append(configurations_item) + + credentials: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.credentials, Unset): + if self.credentials is None: + credentials = None + else: + credentials = [] + for credentials_item_data in self.credentials: + credentials_item = credentials_item_data.to_dict() + + credentials.append(credentials_item) + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id + if is_active is not UNSET: + field_dict["isActive"] = is_active + if endpoint_url is not UNSET: + field_dict["endpointUrl"] = endpoint_url + if configurations is not UNSET: + field_dict["configurations"] = configurations + if credentials is not UNSET: + field_dict["credentials"] = credentials + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.webhook_configuration_model import WebhookConfigurationModel + from ..models.webhook_credentials_model import WebhookCredentialsModel + + d = src_dict.copy() + id = d.pop("id", UNSET) + + is_active = d.pop("isActive", UNSET) + + endpoint_url = d.pop("endpointUrl", UNSET) + + configurations = [] + _configurations = d.pop("configurations", UNSET) + for configurations_item_data in _configurations or []: + configurations_item = WebhookConfigurationModel.from_dict(configurations_item_data) + + configurations.append(configurations_item) + + credentials = [] + _credentials = d.pop("credentials", UNSET) + for credentials_item_data in _credentials or []: + credentials_item = WebhookCredentialsModel.from_dict(credentials_item_data) + + credentials.append(credentials_item) + + webhook_model = cls( + id=id, + is_active=is_active, + endpoint_url=endpoint_url, + configurations=configurations, + credentials=credentials, + ) + + return webhook_model diff --git a/src/cinode-py-client/cinode_api_client/models/word_engine_type.py b/src/cinode-py-client/cinode_api_client/models/word_engine_type.py new file mode 100644 index 0000000..bd9f66d --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/word_engine_type.py @@ -0,0 +1,10 @@ +from enum import IntEnum + + +class WordEngineType(IntEnum): + VALUE_0 = 0 + VALUE_1 = 1 + VALUE_2 = 2 + + def __str__(self) -> str: + return str(self.value) diff --git a/src/cinode-py-client/cinode_api_client/models/work_experience_block_item_model.py b/src/cinode-py-client/cinode_api_client/models/work_experience_block_item_model.py new file mode 100644 index 0000000..2bd2b93 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/work_experience_block_item_model.py @@ -0,0 +1,243 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.image_block_model import ImageBlockModel + from ..models.location_block_model import LocationBlockModel + from ..models.skill_block_item_model import SkillBlockItemModel + + +T = TypeVar("T", bound="WorkExperienceBlockItemModel") + + +@_attrs_define +class WorkExperienceBlockItemModel: + """ + Attributes: + skills (Union[Unset, None, List['SkillBlockItemModel']]): + title (Union[Unset, None, str]): + description (Union[Unset, None, str]): + employer (Union[Unset, None, str]): + location (Union[Unset, None, LocationBlockModel]): + start_date (Union[Unset, datetime.datetime]): + end_date (Union[Unset, None, datetime.datetime]): + url (Union[Unset, None, str]): + logotype (Union[Unset, None, ImageBlockModel]): + parent_block_item_id (Union[Unset, None, int]): + parent_block_item_updated (Union[Unset, None, bool]): + profile_translation_id (Union[Unset, None, int]): + updated (Union[Unset, None, datetime.datetime]): + discarded (Union[Unset, None, datetime.datetime]): + id (Union[Unset, str]): + disabled (Union[Unset, bool]): + """ + + skills: Union[Unset, None, List["SkillBlockItemModel"]] = UNSET + title: Union[Unset, None, str] = UNSET + description: Union[Unset, None, str] = UNSET + employer: Union[Unset, None, str] = UNSET + location: Union[Unset, None, "LocationBlockModel"] = UNSET + start_date: Union[Unset, datetime.datetime] = UNSET + end_date: Union[Unset, None, datetime.datetime] = UNSET + url: Union[Unset, None, str] = UNSET + logotype: Union[Unset, None, "ImageBlockModel"] = UNSET + parent_block_item_id: Union[Unset, None, int] = UNSET + parent_block_item_updated: Union[Unset, None, bool] = UNSET + profile_translation_id: Union[Unset, None, int] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + discarded: Union[Unset, None, datetime.datetime] = UNSET + id: Union[Unset, str] = UNSET + disabled: Union[Unset, bool] = UNSET + + def to_dict(self) -> Dict[str, Any]: + skills: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.skills, Unset): + if self.skills is None: + skills = None + else: + skills = [] + for skills_item_data in self.skills: + skills_item = skills_item_data.to_dict() + + skills.append(skills_item) + + title = self.title + description = self.description + employer = self.employer + location: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.location, Unset): + location = self.location.to_dict() if self.location else None + + start_date: Union[Unset, str] = UNSET + if not isinstance(self.start_date, Unset): + start_date = self.start_date.isoformat() + + end_date: Union[Unset, None, str] = UNSET + if not isinstance(self.end_date, Unset): + end_date = self.end_date.isoformat() if self.end_date else None + + url = self.url + logotype: Union[Unset, None, Dict[str, Any]] = UNSET + if not isinstance(self.logotype, Unset): + logotype = self.logotype.to_dict() if self.logotype else None + + parent_block_item_id = self.parent_block_item_id + parent_block_item_updated = self.parent_block_item_updated + profile_translation_id = self.profile_translation_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + discarded: Union[Unset, None, str] = UNSET + if not isinstance(self.discarded, Unset): + discarded = self.discarded.isoformat() if self.discarded else None + + id = self.id + disabled = self.disabled + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if skills is not UNSET: + field_dict["skills"] = skills + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if employer is not UNSET: + field_dict["employer"] = employer + if location is not UNSET: + field_dict["location"] = location + if start_date is not UNSET: + field_dict["startDate"] = start_date + if end_date is not UNSET: + field_dict["endDate"] = end_date + if url is not UNSET: + field_dict["url"] = url + if logotype is not UNSET: + field_dict["logotype"] = logotype + if parent_block_item_id is not UNSET: + field_dict["parentBlockItemId"] = parent_block_item_id + if parent_block_item_updated is not UNSET: + field_dict["parentBlockItemUpdated"] = parent_block_item_updated + if profile_translation_id is not UNSET: + field_dict["profileTranslationId"] = profile_translation_id + if updated is not UNSET: + field_dict["updated"] = updated + if discarded is not UNSET: + field_dict["discarded"] = discarded + if id is not UNSET: + field_dict["id"] = id + if disabled is not UNSET: + field_dict["disabled"] = disabled + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.image_block_model import ImageBlockModel + from ..models.location_block_model import LocationBlockModel + from ..models.skill_block_item_model import SkillBlockItemModel + + d = src_dict.copy() + skills = [] + _skills = d.pop("skills", UNSET) + for skills_item_data in _skills or []: + skills_item = SkillBlockItemModel.from_dict(skills_item_data) + + skills.append(skills_item) + + title = d.pop("title", UNSET) + + description = d.pop("description", UNSET) + + employer = d.pop("employer", UNSET) + + _location = d.pop("location", UNSET) + location: Union[Unset, None, LocationBlockModel] + if _location is None: + location = None + elif isinstance(_location, Unset): + location = UNSET + else: + location = LocationBlockModel.from_dict(_location) + + _start_date = d.pop("startDate", UNSET) + start_date: Union[Unset, datetime.datetime] + if isinstance(_start_date, Unset): + start_date = UNSET + else: + start_date = isoparse(_start_date) + + _end_date = d.pop("endDate", UNSET) + end_date: Union[Unset, None, datetime.datetime] + if _end_date is None: + end_date = None + elif isinstance(_end_date, Unset): + end_date = UNSET + else: + end_date = isoparse(_end_date) + + url = d.pop("url", UNSET) + + _logotype = d.pop("logotype", UNSET) + logotype: Union[Unset, None, ImageBlockModel] + if _logotype is None: + logotype = None + elif isinstance(_logotype, Unset): + logotype = UNSET + else: + logotype = ImageBlockModel.from_dict(_logotype) + + parent_block_item_id = d.pop("parentBlockItemId", UNSET) + + parent_block_item_updated = d.pop("parentBlockItemUpdated", UNSET) + + profile_translation_id = d.pop("profileTranslationId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + _discarded = d.pop("discarded", UNSET) + discarded: Union[Unset, None, datetime.datetime] + if _discarded is None: + discarded = None + elif isinstance(_discarded, Unset): + discarded = UNSET + else: + discarded = isoparse(_discarded) + + id = d.pop("id", UNSET) + + disabled = d.pop("disabled", UNSET) + + work_experience_block_item_model = cls( + skills=skills, + title=title, + description=description, + employer=employer, + location=location, + start_date=start_date, + end_date=end_date, + url=url, + logotype=logotype, + parent_block_item_id=parent_block_item_id, + parent_block_item_updated=parent_block_item_updated, + profile_translation_id=profile_translation_id, + updated=updated, + discarded=discarded, + id=id, + disabled=disabled, + ) + + return work_experience_block_item_model diff --git a/src/cinode-py-client/cinode_api_client/models/work_experience_block_model.py b/src/cinode-py-client/cinode_api_client/models/work_experience_block_model.py new file mode 100644 index 0000000..7aa344e --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/models/work_experience_block_model.py @@ -0,0 +1,159 @@ +import datetime +from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union + +from attrs import define as _attrs_define +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.work_experience_block_item_model import WorkExperienceBlockItemModel + + +T = TypeVar("T", bound="WorkExperienceBlockModel") + + +@_attrs_define +class WorkExperienceBlockModel: + """ + Attributes: + skills_heading (Union[Unset, None, str]): + sub_heading (Union[Unset, None, str]): + hide_sub_heading (Union[Unset, bool]): + hide_in_edit (Union[Unset, bool]): + hide_title (Union[Unset, bool]): + hide_description (Union[Unset, bool]): + hide_text (Union[Unset, bool]): + use_logotype (Union[Unset, bool]): + data (Union[Unset, None, List['WorkExperienceBlockItemModel']]): + block_id (Union[Unset, str]): + updated (Union[Unset, None, datetime.datetime]): + heading (Union[Unset, None, str]): + """ + + skills_heading: Union[Unset, None, str] = UNSET + sub_heading: Union[Unset, None, str] = UNSET + hide_sub_heading: Union[Unset, bool] = UNSET + hide_in_edit: Union[Unset, bool] = UNSET + hide_title: Union[Unset, bool] = UNSET + hide_description: Union[Unset, bool] = UNSET + hide_text: Union[Unset, bool] = UNSET + use_logotype: Union[Unset, bool] = UNSET + data: Union[Unset, None, List["WorkExperienceBlockItemModel"]] = UNSET + block_id: Union[Unset, str] = UNSET + updated: Union[Unset, None, datetime.datetime] = UNSET + heading: Union[Unset, None, str] = UNSET + + def to_dict(self) -> Dict[str, Any]: + skills_heading = self.skills_heading + sub_heading = self.sub_heading + hide_sub_heading = self.hide_sub_heading + hide_in_edit = self.hide_in_edit + hide_title = self.hide_title + hide_description = self.hide_description + hide_text = self.hide_text + use_logotype = self.use_logotype + data: Union[Unset, None, List[Dict[str, Any]]] = UNSET + if not isinstance(self.data, Unset): + if self.data is None: + data = None + else: + data = [] + for data_item_data in self.data: + data_item = data_item_data.to_dict() + + data.append(data_item) + + block_id = self.block_id + updated: Union[Unset, None, str] = UNSET + if not isinstance(self.updated, Unset): + updated = self.updated.isoformat() if self.updated else None + + heading = self.heading + + field_dict: Dict[str, Any] = {} + field_dict.update({}) + if skills_heading is not UNSET: + field_dict["skillsHeading"] = skills_heading + if sub_heading is not UNSET: + field_dict["subHeading"] = sub_heading + if hide_sub_heading is not UNSET: + field_dict["hideSubHeading"] = hide_sub_heading + if hide_in_edit is not UNSET: + field_dict["hideInEdit"] = hide_in_edit + if hide_title is not UNSET: + field_dict["hideTitle"] = hide_title + if hide_description is not UNSET: + field_dict["hideDescription"] = hide_description + if hide_text is not UNSET: + field_dict["hideText"] = hide_text + if use_logotype is not UNSET: + field_dict["useLogotype"] = use_logotype + if data is not UNSET: + field_dict["data"] = data + if block_id is not UNSET: + field_dict["blockId"] = block_id + if updated is not UNSET: + field_dict["updated"] = updated + if heading is not UNSET: + field_dict["heading"] = heading + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + from ..models.work_experience_block_item_model import WorkExperienceBlockItemModel + + d = src_dict.copy() + skills_heading = d.pop("skillsHeading", UNSET) + + sub_heading = d.pop("subHeading", UNSET) + + hide_sub_heading = d.pop("hideSubHeading", UNSET) + + hide_in_edit = d.pop("hideInEdit", UNSET) + + hide_title = d.pop("hideTitle", UNSET) + + hide_description = d.pop("hideDescription", UNSET) + + hide_text = d.pop("hideText", UNSET) + + use_logotype = d.pop("useLogotype", UNSET) + + data = [] + _data = d.pop("data", UNSET) + for data_item_data in _data or []: + data_item = WorkExperienceBlockItemModel.from_dict(data_item_data) + + data.append(data_item) + + block_id = d.pop("blockId", UNSET) + + _updated = d.pop("updated", UNSET) + updated: Union[Unset, None, datetime.datetime] + if _updated is None: + updated = None + elif isinstance(_updated, Unset): + updated = UNSET + else: + updated = isoparse(_updated) + + heading = d.pop("heading", UNSET) + + work_experience_block_model = cls( + skills_heading=skills_heading, + sub_heading=sub_heading, + hide_sub_heading=hide_sub_heading, + hide_in_edit=hide_in_edit, + hide_title=hide_title, + hide_description=hide_description, + hide_text=hide_text, + use_logotype=use_logotype, + data=data, + block_id=block_id, + updated=updated, + heading=heading, + ) + + return work_experience_block_model diff --git a/src/cinode-py-client/cinode_api_client/py.typed b/src/cinode-py-client/cinode_api_client/py.typed new file mode 100644 index 0000000..1aad327 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561 \ No newline at end of file diff --git a/src/cinode-py-client/cinode_api_client/types.py b/src/cinode-py-client/cinode_api_client/types.py new file mode 100644 index 0000000..15700b8 --- /dev/null +++ b/src/cinode-py-client/cinode_api_client/types.py @@ -0,0 +1,44 @@ +""" Contains some shared types for properties """ +from http import HTTPStatus +from typing import BinaryIO, Generic, Literal, MutableMapping, Optional, Tuple, TypeVar + +from attrs import define + + +class Unset: + def __bool__(self) -> Literal[False]: + return False + + +UNSET: Unset = Unset() + +FileJsonType = Tuple[Optional[str], BinaryIO, Optional[str]] + + +@define +class File: + """Contains information for file uploads""" + + payload: BinaryIO + file_name: Optional[str] = None + mime_type: Optional[str] = None + + def to_tuple(self) -> FileJsonType: + """Return a tuple representation that httpx will accept for multipart/form-data""" + return self.file_name, self.payload, self.mime_type + + +T = TypeVar("T") + + +@define +class Response(Generic[T]): + """A response from an endpoint""" + + status_code: HTTPStatus + content: bytes + headers: MutableMapping[str, str] + parsed: Optional[T] + + +__all__ = ["File", "Response", "FileJsonType"] diff --git a/src/cinode-py-client/pyproject.toml b/src/cinode-py-client/pyproject.toml new file mode 100644 index 0000000..5bd92e7 --- /dev/null +++ b/src/cinode-py-client/pyproject.toml @@ -0,0 +1,39 @@ +[tool.poetry] +name = "cinode-api-client" +version = "0.1" +description = "A client library for accessing Cinode API" + +authors = [] + +readme = "README.md" +packages = [ + {include = "cinode_api_client"}, +] +include = ["CHANGELOG.md", "cinode_api_client/py.typed"] + +[tool.poetry.dependencies] +python = "^3.8" +httpx = ">=0.20.0,<0.25.0" +attrs = ">=21.3.0" +python-dateutil = "^2.8.0" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.black] +line-length = 120 +target_version = ['py38', 'py39', 'py310', 'py311'] +exclude = ''' +( + /( + | \.git + | \.venv + | \.mypy_cache + )/ +) +''' + +[tool.isort] +line_length = 120 +profile = "black" diff --git a/src/cinode.d.ts b/src/cinode.d.ts index 9cfd511..96a32e2 100644 --- a/src/cinode.d.ts +++ b/src/cinode.d.ts @@ -1197,6 +1197,20 @@ export type paths = { */ post: operations['SubcontractorAttachment'] } + '/v0.1/companies/{companyId}/subcontractors/{subcontractorId}/roles': { + /** + * Get assigned and prospect roles for subcontractor + * @description Requires access level: CompanyManager. Requires module: Assignments. + */ + get: operations['GetSubcontractorRoles'] + } + '/v0.1/companies/{companyId}/subcontractors/{subcontractorId}/roles/{projectAssignmentId}': { + /** + * Get a specific role, assigned and or prospected, for subcontractor by role id + * @description Requires access level: CompanyManager. Requires module: Assignments. + */ + get: operations['GetSubcontractorRole'] + } '/v0.1/companies/{companyId}/users/{companyUserId}/tags': { /** * Edit Tags for User @@ -1885,6 +1899,11 @@ export type components = { disabled?: boolean } CommitmentBlockModel: { + hideInEdit?: boolean + hideTitle?: boolean + hideDescription?: boolean + hideText?: boolean + hideUrl?: boolean data?: components['schemas']['CommitmentBlockItemModel'][] | null /** Format: uuid */ blockId?: string @@ -4083,6 +4102,19 @@ export type components = { id?: number | null links?: components['schemas']['Link'][] | null } + CompanyUserSubcontractorRoleMemberModel: { + /** Format: int32 */ + projectAssignmentId?: number + /** Format: int32 */ + assignmentTariff?: number | null + currency?: components['schemas']['CurrencyModel'] | null + currentState?: components['schemas']['ProjectAssignmentMemberStateHistoryModel'] | null + projectAssignment?: components['schemas']['ProjectAssignmentBaseModel'] | null + } + CompanyUserSubcontractorRolesModel: { + assigned?: components['schemas']['CompanyUserSubcontractorRoleMemberModel'][] | null + prospect?: components['schemas']['CompanyUserSubcontractorRoleMemberModel'][] | null + } /** * Format: int32 * @description @@ -5635,6 +5667,10 @@ export type components = { * @enum {integer} */ ProjectAssignmentMemberState: 0 | 10 | 20 | 30 | 40 + ProjectAssignmentMemberStateHistoryModel: { + state?: components['schemas']['ProjectAssignmentMemberState'] + note?: string | null + } ProjectAssignmentMemberSubcontractorAddModel: { /** Format: int32 */ groupId?: number | null @@ -6393,11 +6429,12 @@ export type components = { } SearchCompanyUserQueryModel: { term?: string | null + includeDisconnected?: boolean pageAndSortBy?: components['schemas']['CompanyUserQuerySortPageAndSortByModel'] | null } SearchCompanyUserResultModel: { pagedAndSortedBy?: components['schemas']['CompanyUserQuerySortPageAndSortByModel'] | null - result?: components['schemas']['CompanyUserBaseModel'][] | null + result?: components['schemas']['CompanyUserExtendedModel'][] | null /** Format: int32 */ hits?: number /** Format: int32 */ @@ -7464,7 +7501,7 @@ export type operations = { * "op": "replace" * }, * { - * "value": "2023-08-03T18:00:09.8364399+02:00", + * "value": "2023-08-28T13:13:38.3094173+02:00", * "path": "/availablefromdate", * "op": "replace" * }, @@ -12885,12 +12922,12 @@ export type operations = { * "op": "replace" * }, * { - * "value": "2023-08-03T18:00:10.0953997+02:00", + * "value": "2023-08-28T13:13:38.5546243+02:00", * "path": "/employmentstartdate", * "op": "replace" * }, * { - * "value": "2023-08-03T18:00:10.0954045+02:00", + * "value": "2023-08-28T13:13:38.5546283+02:00", * "path": "/employmentenddate", * "op": "replace" * }, @@ -12915,7 +12952,7 @@ export type operations = { * "op": "replace" * }, * { - * "value": "2023-08-03T18:00:10.0954082+02:00", + * "value": "2023-08-28T13:13:38.5546312+02:00", * "path": "/availablefromdate", * "op": "replace" * }, @@ -12980,7 +13017,7 @@ export type operations = { * "op": "replace" * }, * { - * "value": "2023-08-03T18:00:10.0954145+02:00", + * "value": "2023-08-28T13:13:38.5546364+02:00", * "path": "/dateofbirth", * "op": "replace" * }, @@ -17958,6 +17995,108 @@ export type operations = { } } } + /** + * Get assigned and prospect roles for subcontractor + * @description Requires access level: CompanyManager. Requires module: Assignments. + */ + GetSubcontractorRoles: { + parameters: { + path: { + /** @description Company Id */ + companyId: number + /** @description Subcontractor Id */ + subcontractorId: number + } + } + responses: { + /** @description All went well */ + 200: { + content: { + 'text/plain': components['schemas']['CompanyUserSubcontractorRolesModel'] + 'application/json': components['schemas']['CompanyUserSubcontractorRolesModel'] + 'text/json': components['schemas']['CompanyUserSubcontractorRolesModel'] + 'application/xml': components['schemas']['CompanyUserSubcontractorRolesModel'] + 'text/xml': components['schemas']['CompanyUserSubcontractorRolesModel'] + } + } + /** @description Incorrect request */ + 400: { + content: { + 'text/plain': components['schemas']['ValidationModel'] + 'application/json': components['schemas']['ValidationModel'] + 'text/json': components['schemas']['ValidationModel'] + 'application/xml': components['schemas']['ValidationModel'] + 'text/xml': components['schemas']['ValidationModel'] + } + } + /** @description Unauthorized request */ + 401: never + /** @description Resource not found */ + 404: never + /** @description Server error */ + 500: { + content: { + 'text/plain': components['schemas']['ErrorModel'] + 'application/json': components['schemas']['ErrorModel'] + 'text/json': components['schemas']['ErrorModel'] + 'application/xml': components['schemas']['ErrorModel'] + 'text/xml': components['schemas']['ErrorModel'] + } + } + } + } + /** + * Get a specific role, assigned and or prospected, for subcontractor by role id + * @description Requires access level: CompanyManager. Requires module: Assignments. + */ + GetSubcontractorRole: { + parameters: { + path: { + /** @description Company Id */ + companyId: number + /** @description Subcontractor Id */ + subcontractorId: number + /** @description Project assignment Id */ + projectAssignmentId: number + } + } + responses: { + /** @description All went well */ + 200: { + content: { + 'text/plain': components['schemas']['CompanyUserSubcontractorRoleMemberModel'] + 'application/json': components['schemas']['CompanyUserSubcontractorRoleMemberModel'] + 'text/json': components['schemas']['CompanyUserSubcontractorRoleMemberModel'] + 'application/xml': components['schemas']['CompanyUserSubcontractorRoleMemberModel'] + 'text/xml': components['schemas']['CompanyUserSubcontractorRoleMemberModel'] + } + } + /** @description Incorrect request */ + 400: { + content: { + 'text/plain': components['schemas']['ValidationModel'] + 'application/json': components['schemas']['ValidationModel'] + 'text/json': components['schemas']['ValidationModel'] + 'application/xml': components['schemas']['ValidationModel'] + 'text/xml': components['schemas']['ValidationModel'] + } + } + /** @description Unauthorized request */ + 401: never + /** @description Resource not found */ + 404: never + /** @description Server error */ + 500: { + content: { + 'text/plain': components['schemas']['ErrorModel'] + 'application/json': components['schemas']['ErrorModel'] + 'text/json': components['schemas']['ErrorModel'] + 'application/xml': components['schemas']['ErrorModel'] + 'text/xml': components['schemas']['ErrorModel'] + } + } + } + } /** * Edit Tags for User * @description Note: