def get_students_affectations_count(cls, person, specialty_uuid,
                                     organization_uuid):
     return InternshipAPIClient(
     ).students_affectations_specialty_organization_stats_get(
         specialty=specialty_uuid,
         organization=organization_uuid,
         **utils.build_mandatory_auth_headers(person))
 def delete_master_allocation(cls, person, allocation_uuid):
     data, status, headers = InternshipAPIClient(
     ).masters_allocations_uuid_delete(
         uuid=allocation_uuid,
         _return_http_data_only=False,
         **utils.build_mandatory_auth_headers(person))
     return status == 204
 def post_master(cls, person, master):
     try:
         return InternshipAPIClient().masters_post(
             master_get=master,
             **utils.build_mandatory_auth_headers(person))
     except ApiException:
         raise InternshipServiceException
 def get_delegated_allocations(cls, person, specialty_uuid,
                               organization_uuid):
     return get_paginated_results(
         InternshipAPIClient().masters_allocations_get(
             specialty=specialty_uuid,
             organization=organization_uuid,
             role=ChoiceRole.DELEGATE.name,
             **utils.build_mandatory_auth_headers(person)))
 def validate_internship_score(cls, person, affectation_uuid):
     try:
         return InternshipAPIClient().scores_affectation_uuid_validate_post(
             affectation_uuid=affectation_uuid,
             _return_http_data_only=False,
             **utils.build_mandatory_auth_headers(person))
     except ApiException as e:
         return e.body, e.status, e.headers
 def update_score(cls, person, affectation_uuid, score):
     data, status, headers = InternshipAPIClient(
     ).scores_affectation_uuid_put(
         affectation_uuid,
         score_get=score,
         _return_http_data_only=False,
         **utils.build_mandatory_auth_headers(person))
     return status == 200
 def get_students_affectations(cls,
                               person,
                               specialty_uuid,
                               organization_uuid,
                               period=DEFAULT_PERIODS,
                               **kwargs):
     return InternshipAPIClient(
     ).students_affectations_specialty_organization_get(
         specialty=specialty_uuid,
         organization=organization_uuid,
         period=period,
         **utils.build_mandatory_auth_headers(person),
         **kwargs)
 def get_organization(cls, person, organization_uuid) -> OrganizationGet:
     return InternshipAPIClient().organizations_uuid_get(
         uuid=organization_uuid,
         **utils.build_mandatory_auth_headers(person))
 def get_specialty(cls, person, specialty_uuid):
     return InternshipAPIClient().specialties_uuid_get(
         uuid=specialty_uuid, **utils.build_mandatory_auth_headers(person))
예제 #10
0
 def get_master_allocations(cls, person, master_uuid=None):
     return get_paginated_results(
         InternshipAPIClient().masters_uuid_allocations_get(
             uuid=master_uuid,
             current=True,
             **utils.build_mandatory_auth_headers(person)))
예제 #11
0
 def activate_master_account(cls, person, master_uuid):
     return InternshipAPIClient().masters_uuid_activate_account_post(
         uuid=master_uuid, **utils.build_mandatory_auth_headers(person))
예제 #12
0
 def get_master(cls, person):
     return get_first_paginated_result(InternshipAPIClient().masters_get(
         search=person.email, **utils.build_mandatory_auth_headers(person)))
예제 #13
0
 def post_master_allocation(cls, person, allocation):
     return InternshipAPIClient().masters_allocations_post(
         allocation_get=allocation,
         **utils.build_mandatory_auth_headers(person))
예제 #14
0
 def get_score(cls, person, affectation_uuid):
     try:
         return InternshipAPIClient().scores_affectation_uuid_get(
             affectation_uuid, **utils.build_mandatory_auth_headers(person))
     except ApiException:
         return None
예제 #15
0
 def get_active_period(cls, person):
     return get_first_paginated_result(InternshipAPIClient().periods_get(
         active=True, **utils.build_mandatory_auth_headers(person)))
예제 #16
0
 def get_affectation(cls, person, affectation_uuid):
     return InternshipAPIClient().students_affectations_uuid_get(
         uuid=affectation_uuid,
         **utils.build_mandatory_auth_headers(person))